Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TextTreePropertyUndoUnit.cs / 1305600 / 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 [....] 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 : [....] - 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
- XmlSecureResolver.cs
- XmlNodeChangedEventArgs.cs
- PageClientProxyGenerator.cs
- ClientUtils.cs
- WebPermission.cs
- NullableIntAverageAggregationOperator.cs
- XmlSiteMapProvider.cs
- Memoizer.cs
- MessageQueueTransaction.cs
- WebBrowserContainer.cs
- PixelFormats.cs
- CodeGen.cs
- behaviorssection.cs
- WebPartVerbCollection.cs
- ParameterModifier.cs
- Win32Native.cs
- XmlEncodedRawTextWriter.cs
- TailPinnedEventArgs.cs
- GetParentChain.cs
- EnterpriseServicesHelper.cs
- AmbientValueAttribute.cs
- BinaryObjectReader.cs
- Automation.cs
- Console.cs
- TargetControlTypeCache.cs
- PointLight.cs
- XmlException.cs
- PerformanceCountersElement.cs
- RecordsAffectedEventArgs.cs
- filewebresponse.cs
- InlinedAggregationOperator.cs
- SqlParameter.cs
- RuleSettingsCollection.cs
- CompressionTransform.cs
- ValueChangedEventManager.cs
- Visitor.cs
- login.cs
- XPathException.cs
- WebPartTransformer.cs
- DataRow.cs
- BufferedGraphicsContext.cs
- SrgsRule.cs
- RegexTree.cs
- bidPrivateBase.cs
- DesignerTransaction.cs
- MaterialGroup.cs
- MetadataItem_Static.cs
- MobileContainerDesigner.cs
- CommandBindingCollection.cs
- VariableAction.cs
- PropertyInfoSet.cs
- DragDropHelper.cs
- ClientSettingsSection.cs
- ArraySortHelper.cs
- EventLogPermissionEntry.cs
- TabControlAutomationPeer.cs
- ScriptResourceInfo.cs
- XmlFormatExtensionPrefixAttribute.cs
- AnimationStorage.cs
- GraphicsContainer.cs
- SafeLocalMemHandle.cs
- ReadonlyMessageFilter.cs
- SiteMapNodeItem.cs
- DocumentPageViewAutomationPeer.cs
- EmbossBitmapEffect.cs
- ImageMap.cs
- EndpointFilterProvider.cs
- DPTypeDescriptorContext.cs
- GeneralTransform3D.cs
- ReferenceEqualityComparer.cs
- DependencyObjectCodeDomSerializer.cs
- ClientConfigPaths.cs
- FtpRequestCacheValidator.cs
- FlowLayoutPanel.cs
- XmlNamespaceDeclarationsAttribute.cs
- BoundingRectTracker.cs
- DataColumnPropertyDescriptor.cs
- SafeFileMappingHandle.cs
- AttributeProviderAttribute.cs
- AttributeQuery.cs
- RegisteredScript.cs
- NotImplementedException.cs
- WebPartEditorOkVerb.cs
- VisualStyleTypesAndProperties.cs
- CultureMapper.cs
- OptionUsage.cs
- PasswordBoxAutomationPeer.cs
- ThicknessKeyFrameCollection.cs
- ConsumerConnectionPointCollection.cs
- AdornedElementPlaceholder.cs
- BrowserDefinitionCollection.cs
- GridViewDeleteEventArgs.cs
- JavascriptCallbackBehaviorAttribute.cs
- XPathNodeList.cs
- MessageAction.cs
- NetMsmqBindingCollectionElement.cs
- StaticExtensionConverter.cs
- XmlAttributeCache.cs
- DesignerResources.cs
- SessionSwitchEventArgs.cs