Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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 : benwest - 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. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Undo unit for TextContainer.SetValue, etc. calls. // // History: // 03/03/2004 : benwest - 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
- DataSourceXmlElementAttribute.cs
- HttpRequest.cs
- RouteValueDictionary.cs
- FormatControl.cs
- Listbox.cs
- EntityTypeBase.cs
- PaginationProgressEventArgs.cs
- SortQuery.cs
- MsmqOutputChannel.cs
- DataException.cs
- DocumentCollection.cs
- XmlParser.cs
- COM2ExtendedUITypeEditor.cs
- ReturnValue.cs
- SortFieldComparer.cs
- LocalizationComments.cs
- SamlConstants.cs
- VirtualDirectoryMapping.cs
- DateRangeEvent.cs
- Divide.cs
- HitTestParameters3D.cs
- TextSimpleMarkerProperties.cs
- SendSecurityHeader.cs
- DecoderNLS.cs
- StickyNote.cs
- SafeSecurityHelper.cs
- DBSchemaTable.cs
- Compress.cs
- Grant.cs
- XPathMessageFilter.cs
- userdatakeys.cs
- SaveFileDialog.cs
- SessionState.cs
- ManagedFilter.cs
- AQNBuilder.cs
- ContentPlaceHolder.cs
- DragCompletedEventArgs.cs
- BitArray.cs
- PropertyDescriptorCollection.cs
- FormViewInsertedEventArgs.cs
- RadialGradientBrush.cs
- wgx_commands.cs
- CoreSwitches.cs
- ComponentChangedEvent.cs
- SettingsPropertyNotFoundException.cs
- SamlAttribute.cs
- RowUpdatingEventArgs.cs
- SqlTopReducer.cs
- CodeExporter.cs
- ParameterModifier.cs
- SingleConverter.cs
- TextHidden.cs
- EntityTypeEmitter.cs
- ObjectQueryState.cs
- OleDbCommand.cs
- CompareInfo.cs
- SearchForVirtualItemEventArgs.cs
- OdbcError.cs
- DataControlButton.cs
- validationstate.cs
- FixedPageStructure.cs
- ComponentResourceManager.cs
- XmlRawWriter.cs
- ModulesEntry.cs
- Int64AnimationBase.cs
- CanExecuteRoutedEventArgs.cs
- DataGridViewLinkColumn.cs
- CookieParameter.cs
- X509Certificate2Collection.cs
- RuntimeEnvironment.cs
- CngProvider.cs
- RightsManagementEncryptedStream.cs
- InvokeHandlers.cs
- TreeNodeClickEventArgs.cs
- DataTemplateSelector.cs
- QilNode.cs
- ProfileService.cs
- DataControlFieldCollection.cs
- ListViewGroup.cs
- AspProxy.cs
- LoginViewDesigner.cs
- SignatureDescription.cs
- Decorator.cs
- SyntaxCheck.cs
- SchemaCreator.cs
- CultureTableRecord.cs
- IERequestCache.cs
- ClientSponsor.cs
- FontStyle.cs
- SqlPersonalizationProvider.cs
- PenContext.cs
- SessionPageStatePersister.cs
- MethodCallTranslator.cs
- CacheRequest.cs
- TextRangeEditLists.cs
- DataBinding.cs
- LoadedOrUnloadedOperation.cs
- GroupBox.cs
- ComplusTypeValidator.cs
- ThrowHelper.cs