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
- QueryPageSettingsEventArgs.cs
- CommandField.cs
- ShaperBuffers.cs
- SamlAttribute.cs
- SafeFileHandle.cs
- CapabilitiesAssignment.cs
- SemaphoreSecurity.cs
- PopOutPanel.cs
- Freezable.cs
- ChannelCredentials.cs
- WindowsGraphics2.cs
- TableColumn.cs
- SevenBitStream.cs
- MissingManifestResourceException.cs
- HwndSourceParameters.cs
- VerticalAlignConverter.cs
- DocumentGridContextMenu.cs
- Authorization.cs
- MembershipValidatePasswordEventArgs.cs
- PropertyToken.cs
- OrderedDictionaryStateHelper.cs
- PageThemeBuildProvider.cs
- CdpEqualityComparer.cs
- assertwrapper.cs
- XamlBrushSerializer.cs
- ThicknessConverter.cs
- ISAPIApplicationHost.cs
- AuthenticodeSignatureInformation.cs
- RawAppCommandInputReport.cs
- ConnectionOrientedTransportChannelListener.cs
- DeviceContext2.cs
- XamlInterfaces.cs
- VisualProxy.cs
- FlowDocumentReader.cs
- PolicyException.cs
- ObjectStateEntryDbDataRecord.cs
- ControlUtil.cs
- SessionStateContainer.cs
- ScriptingProfileServiceSection.cs
- _ListenerAsyncResult.cs
- DefaultTraceListener.cs
- WebBrowserUriTypeConverter.cs
- XPathEmptyIterator.cs
- CmsInterop.cs
- ErrorHandlingAcceptor.cs
- MonthChangedEventArgs.cs
- Errors.cs
- LinqDataSourceContextEventArgs.cs
- PauseStoryboard.cs
- ReferentialConstraint.cs
- MonikerUtility.cs
- PagerSettings.cs
- FocusWithinProperty.cs
- RepeaterItemCollection.cs
- SafeBitVector32.cs
- SqlAliasesReferenced.cs
- CounterSampleCalculator.cs
- ActivityXRefPropertyEditor.cs
- XmlSchemaDocumentation.cs
- TextSearch.cs
- CatalogZoneBase.cs
- DrawingContextDrawingContextWalker.cs
- TreeNodeCollection.cs
- DataBindingHandlerAttribute.cs
- BindingSource.cs
- WebPartConnectionsConfigureVerb.cs
- DispatcherEventArgs.cs
- InstanceHandleConflictException.cs
- CollectionViewGroupRoot.cs
- DbDataAdapter.cs
- Error.cs
- DataSet.cs
- AtomContentProperty.cs
- CodeMemberField.cs
- EventDescriptorCollection.cs
- CustomAttribute.cs
- Highlights.cs
- PointAnimation.cs
- CachingHintValidation.cs
- SiteMapProvider.cs
- NumericExpr.cs
- Vector3DConverter.cs
- DataReaderContainer.cs
- DbXmlEnabledProviderManifest.cs
- loginstatus.cs
- GridPattern.cs
- EventWaitHandle.cs
- EmulateRecognizeCompletedEventArgs.cs
- AxisAngleRotation3D.cs
- SchemaCollectionPreprocessor.cs
- UInt64.cs
- InputBuffer.cs
- TransformProviderWrapper.cs
- Item.cs
- SettingsPropertyValue.cs
- HostedElements.cs
- ErasingStroke.cs
- StatusBarPanelClickEvent.cs
- FormViewDeleteEventArgs.cs
- FormsAuthentication.cs