Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TextTreePropertyUndoUnit.cs / 1305600 / TextTreePropertyUndoUnit.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Undo unit for TextContainer.SetValue, etc. calls. // // History: // 03/03/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using MS.Internal; namespace System.Windows.Documents { // Undo unit for TextContainer.SetValue, etc. calls. internal class TextTreePropertyUndoUnit : TextTreeUndoUnit { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Create a new undo unit instance. // symbolOffset is where property values will be set. internal TextTreePropertyUndoUnit(TextContainer tree, int symbolOffset, PropertyRecord propertyRecord) : base(tree, symbolOffset) { _propertyRecord = propertyRecord; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods // Called by the undo manager. Restores tree state to its condition // when the unit was created. Assumes the tree state matches conditions // just after the unit was created. public override void DoCore() { TextPointer position; VerifyTreeContentHashCode(); position = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, "TextTree undo unit out of [....] with TextTree."); if (_propertyRecord.Value != DependencyProperty.UnsetValue) { this.TextContainer.SetValue(position, _propertyRecord.Property, _propertyRecord.Value); } else { position.Parent.ClearValue(_propertyRecord.Property); } } #endregion Public Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // Property/value pair to restore. private readonly PropertyRecord _propertyRecord; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- messageonlyhwndwrapper.cs
- FormViewInsertedEventArgs.cs
- Schema.cs
- AuthenticateEventArgs.cs
- HiddenFieldPageStatePersister.cs
- HtmlInputImage.cs
- ArraySubsetEnumerator.cs
- WebPartConnectionsCancelEventArgs.cs
- ResetableIterator.cs
- MaskedTextProvider.cs
- ArrayItemValue.cs
- SID.cs
- XmlSerializerFactory.cs
- StringWriter.cs
- DbMetaDataColumnNames.cs
- MultipleViewPattern.cs
- HexParser.cs
- WindowsContainer.cs
- FixedTextContainer.cs
- MetadataPropertyvalue.cs
- EdmItemCollection.cs
- SaveFileDialog.cs
- QuarticEase.cs
- TextElement.cs
- ExpressionEvaluator.cs
- ComAwareEventInfo.cs
- BasePattern.cs
- PiiTraceSource.cs
- DocumentGridContextMenu.cs
- ParseNumbers.cs
- HtmlTableCell.cs
- DataSourceComponent.cs
- UrlParameterWriter.cs
- SlipBehavior.cs
- TypeInitializationException.cs
- CopyCodeAction.cs
- TargetException.cs
- XmlIgnoreAttribute.cs
- WindowPatternIdentifiers.cs
- DataGridViewElement.cs
- URI.cs
- IndexedString.cs
- SafePointer.cs
- DataGridViewLayoutData.cs
- QilStrConcat.cs
- ManagedIStream.cs
- WorkflowStateRollbackService.cs
- SortedList.cs
- SubpageParaClient.cs
- HttpListenerContext.cs
- FixedBufferAttribute.cs
- SqlNamer.cs
- SettingsPropertyValueCollection.cs
- DoubleLinkList.cs
- SectionUpdates.cs
- Image.cs
- Interlocked.cs
- XmlAutoDetectWriter.cs
- KnownBoxes.cs
- DefaultPrintController.cs
- EventEntry.cs
- QuaternionAnimation.cs
- ContentHostHelper.cs
- ThicknessAnimationUsingKeyFrames.cs
- XmlSchemaAny.cs
- _Semaphore.cs
- VerticalAlignConverter.cs
- FileUtil.cs
- DBBindings.cs
- MouseWheelEventArgs.cs
- MergeFilterQuery.cs
- FixedTextSelectionProcessor.cs
- XmlObjectSerializerReadContextComplexJson.cs
- MetafileHeaderWmf.cs
- FigureParagraph.cs
- ForceCopyBuildProvider.cs
- AuthenticatedStream.cs
- FileAuthorizationModule.cs
- Solver.cs
- SQLUtility.cs
- WSSecurityTokenSerializer.cs
- HttpConfigurationContext.cs
- ExpressionBuilderContext.cs
- SqlDataSourceSelectingEventArgs.cs
- WebPartEditorApplyVerb.cs
- VectorAnimation.cs
- TraceContext.cs
- TdsValueSetter.cs
- ListViewUpdateEventArgs.cs
- TransmissionStrategy.cs
- UserNameSecurityTokenAuthenticator.cs
- AjaxFrameworkAssemblyAttribute.cs
- EventLogTraceListener.cs
- HttpException.cs
- MemberDomainMap.cs
- CodeMemberEvent.cs
- DNS.cs
- BindingParameterCollection.cs
- MimeTextImporter.cs
- GenerateTemporaryTargetAssembly.cs