Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / TextTreePropertyUndoUnit.cs / 1 / 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 sync 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
- EntityWithKeyStrategy.cs
- ITextView.cs
- AnnotationDocumentPaginator.cs
- SQLDoubleStorage.cs
- TypeDescriptorContext.cs
- XmlElementCollection.cs
- FocusChangedEventArgs.cs
- SQLResource.cs
- TransactionFlowProperty.cs
- PrePrepareMethodAttribute.cs
- OperationFormatUse.cs
- ToolStripControlHost.cs
- WebPartDisplayModeEventArgs.cs
- XmlDataSource.cs
- ScriptModule.cs
- HyperLink.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- PassportPrincipal.cs
- SharedDp.cs
- BaseAddressElementCollection.cs
- Action.cs
- FontDialog.cs
- oledbconnectionstring.cs
- ClientUtils.cs
- SymDocumentType.cs
- ArrayElementGridEntry.cs
- _Semaphore.cs
- AbsoluteQuery.cs
- CompiledXpathExpr.cs
- Style.cs
- EntityStoreSchemaFilterEntry.cs
- XmlWhitespace.cs
- WebResourceAttribute.cs
- ConfigUtil.cs
- Main.cs
- Inline.cs
- DeclarativeCatalogPart.cs
- MediaPlayer.cs
- SystemResourceKey.cs
- AsyncOperationLifetimeManager.cs
- UnsafeNativeMethods.cs
- ItemCollection.cs
- AutoGeneratedField.cs
- Token.cs
- ObjectDataProvider.cs
- EndGetFileNameFromUserRequest.cs
- AnnotationComponentChooser.cs
- RectangleConverter.cs
- DoubleAnimationUsingKeyFrames.cs
- MessageFilterException.cs
- SspiSecurityTokenParameters.cs
- _ListenerResponseStream.cs
- SessionStateItemCollection.cs
- ConfigXmlText.cs
- TextSelectionHighlightLayer.cs
- ScaleTransform.cs
- SqlDataSourceQueryEditor.cs
- RichTextBoxConstants.cs
- HMACSHA1.cs
- MobileControlsSectionHandler.cs
- UnsafeNetInfoNativeMethods.cs
- HttpInputStream.cs
- XmlTextAttribute.cs
- PieceDirectory.cs
- ChangeNode.cs
- ProxyElement.cs
- XmlBoundElement.cs
- HwndMouseInputProvider.cs
- DesignerActionPanel.cs
- SkinBuilder.cs
- EditorZoneBase.cs
- MenuItemAutomationPeer.cs
- MouseEventArgs.cs
- StrokeNodeData.cs
- XmlArrayItemAttributes.cs
- EnvironmentPermission.cs
- FontStyle.cs
- _emptywebproxy.cs
- TreeNodeCollectionEditorDialog.cs
- WindowsComboBox.cs
- TableRowCollection.cs
- StreamInfo.cs
- StandardCommands.cs
- FilterException.cs
- LoadedOrUnloadedOperation.cs
- CleanUpVirtualizedItemEventArgs.cs
- ErrorRuntimeConfig.cs
- FixedPageStructure.cs
- FormViewPagerRow.cs
- XmlQualifiedNameTest.cs
- XmlSchemaRedefine.cs
- WSFederationHttpBinding.cs
- XsltCompileContext.cs
- SoapFormatter.cs
- Style.cs
- XmlDataProvider.cs
- PrivilegeNotHeldException.cs
- AnonymousIdentificationModule.cs
- MonitoringDescriptionAttribute.cs
- Int16Converter.cs