Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- TableLayoutPanelCodeDomSerializer.cs
- SafeWaitHandle.cs
- ListView.cs
- WindowsTokenRoleProvider.cs
- TextRunCache.cs
- VersionPair.cs
- SourceElementsCollection.cs
- TextEditorLists.cs
- ChildChangedEventArgs.cs
- RouteParser.cs
- PasswordTextContainer.cs
- ExecutionScope.cs
- ALinqExpressionVisitor.cs
- Evaluator.cs
- SlotInfo.cs
- DataGridViewMethods.cs
- X509Utils.cs
- SpecularMaterial.cs
- Stylus.cs
- WebPartMenuStyle.cs
- Base64Decoder.cs
- Gdiplus.cs
- SmtpSection.cs
- PowerStatus.cs
- PKCS1MaskGenerationMethod.cs
- MulticastNotSupportedException.cs
- DataView.cs
- BigInt.cs
- IItemProperties.cs
- WindowsProgressbar.cs
- PanelStyle.cs
- ProgressBar.cs
- TabControlCancelEvent.cs
- FieldCollectionEditor.cs
- IgnoreFileBuildProvider.cs
- MachineKeyConverter.cs
- XmlSchemaInfo.cs
- WorkflowItemPresenter.cs
- PromptEventArgs.cs
- UserNamePasswordValidator.cs
- OrCondition.cs
- RangeEnumerable.cs
- DataContractJsonSerializerOperationBehavior.cs
- PtsPage.cs
- AbandonedMutexException.cs
- SymbolEqualComparer.cs
- AbstractDataSvcMapFileLoader.cs
- XmlSchemaFacet.cs
- AccessibleObject.cs
- EntityUtil.cs
- RectAnimationUsingKeyFrames.cs
- ModifierKeysValueSerializer.cs
- QuaternionAnimationUsingKeyFrames.cs
- UnauthorizedAccessException.cs
- StringToken.cs
- ExponentialEase.cs
- SynchronizationHandlesCodeDomSerializer.cs
- FlowDocumentScrollViewer.cs
- DoubleLinkListEnumerator.cs
- MemberHolder.cs
- ManagementPath.cs
- FileLogRecordStream.cs
- SqlConnectionHelper.cs
- HitTestDrawingContextWalker.cs
- Sql8ConformanceChecker.cs
- Quaternion.cs
- ObjectListCommandsPage.cs
- PointAnimationUsingPath.cs
- clipboard.cs
- PaintValueEventArgs.cs
- RuntimeUtils.cs
- StretchValidation.cs
- PropertyGridView.cs
- ManagementPath.cs
- PathNode.cs
- FlowDocumentPage.cs
- ContravarianceAdapter.cs
- XmlSerializerFactory.cs
- CroppedBitmap.cs
- AssemblyInfo.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ToolStripItemEventArgs.cs
- BoundField.cs
- CultureInfoConverter.cs
- X509PeerCertificateAuthentication.cs
- SamlNameIdentifierClaimResource.cs
- LogAppendAsyncResult.cs
- LicenseException.cs
- _ConnectionGroup.cs
- SystemWebSectionGroup.cs
- Int16.cs
- XXXOnTypeBuilderInstantiation.cs
- ProtectedProviderSettings.cs
- BitmapEffectInput.cs
- IndexedGlyphRun.cs
- TagPrefixAttribute.cs
- IntegrationExceptionEventArgs.cs
- JavaScriptObjectDeserializer.cs
- BitmapEffectDrawing.cs
- TimeSpanConverter.cs