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
- XmlCodeExporter.cs
- Fonts.cs
- CryptoKeySecurity.cs
- GridSplitter.cs
- ColumnMap.cs
- TakeOrSkipWhileQueryOperator.cs
- InvalidateEvent.cs
- TransactionTable.cs
- SettingsPropertyValueCollection.cs
- XmlSchemaSequence.cs
- SqlNamer.cs
- BehaviorEditorPart.cs
- Int16.cs
- HtmlTableCell.cs
- InvalidPrinterException.cs
- DataBoundLiteralControl.cs
- X509WindowsSecurityToken.cs
- HttpFileCollection.cs
- FocusTracker.cs
- StyleBamlTreeBuilder.cs
- UrlPath.cs
- XmlEntity.cs
- GetIndexBinder.cs
- FixedSOMElement.cs
- SqlTransaction.cs
- StrongNameIdentityPermission.cs
- ObjectDataSourceFilteringEventArgs.cs
- InkCanvasSelectionAdorner.cs
- ThemeDirectoryCompiler.cs
- RSACryptoServiceProvider.cs
- SequenceRange.cs
- ResourceDisplayNameAttribute.cs
- ContentPosition.cs
- TableLayoutStyleCollection.cs
- SqlUtil.cs
- GeneratedContractType.cs
- ChangePasswordAutoFormat.cs
- Function.cs
- MultiDataTrigger.cs
- EqualityComparer.cs
- StateRuntime.cs
- AsyncParams.cs
- CodePageUtils.cs
- RegionData.cs
- PerformanceCounterCategory.cs
- _ProxyChain.cs
- TransferMode.cs
- XmlSchemaObjectCollection.cs
- BinaryReader.cs
- PaginationProgressEventArgs.cs
- odbcmetadatafactory.cs
- WebSysDescriptionAttribute.cs
- CalendarDay.cs
- Module.cs
- CharConverter.cs
- EdmConstants.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- BrushValueSerializer.cs
- TypeBrowser.xaml.cs
- DbMetaDataCollectionNames.cs
- QueryCorrelationInitializer.cs
- ThreadPool.cs
- BrowserInteropHelper.cs
- CryptoHelper.cs
- UserThread.cs
- XmlHierarchyData.cs
- XmlReflectionMember.cs
- ObjectDataSourceMethodEventArgs.cs
- SqlRowUpdatingEvent.cs
- Size3DConverter.cs
- BackgroundWorker.cs
- BitmapEffectInput.cs
- TextLineResult.cs
- AbstractExpressions.cs
- FormatConvertedBitmap.cs
- GridViewRowCollection.cs
- HtmlEmptyTagControlBuilder.cs
- CmsUtils.cs
- Operators.cs
- TabControl.cs
- Geometry3D.cs
- PermissionAttributes.cs
- ListManagerBindingsCollection.cs
- StoragePropertyMapping.cs
- UpdateManifestForBrowserApplication.cs
- HWStack.cs
- WebPartDescription.cs
- UnsafeNativeMethods.cs
- ServiceErrorHandler.cs
- WorkItem.cs
- SystemIPGlobalProperties.cs
- Formatter.cs
- VarRemapper.cs
- HealthMonitoringSectionHelper.cs
- Comparer.cs
- XNodeValidator.cs
- ClientTargetSection.cs
- DataGridViewColumnEventArgs.cs
- RelationshipEnd.cs
- MarshalDirectiveException.cs