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
- ReflectionPermission.cs
- UnauthorizedWebPart.cs
- ModelItemDictionaryImpl.cs
- SelectionItemProviderWrapper.cs
- typedescriptorpermissionattribute.cs
- MediaTimeline.cs
- DataKey.cs
- RenderingEventArgs.cs
- InfoCardMetadataExchangeClient.cs
- QilName.cs
- XPathItem.cs
- EventProxy.cs
- BaseContextMenu.cs
- PersonalizationStateInfoCollection.cs
- DispatchWrapper.cs
- ScriptReferenceEventArgs.cs
- InstallerTypeAttribute.cs
- SessionEndingEventArgs.cs
- AvTraceFormat.cs
- CodeIterationStatement.cs
- EdgeModeValidation.cs
- StringWriter.cs
- EnumerableRowCollection.cs
- SHA384.cs
- XPathPatternParser.cs
- FtpRequestCacheValidator.cs
- PrivilegeNotHeldException.cs
- EditorZone.cs
- HostedBindingBehavior.cs
- Rotation3DKeyFrameCollection.cs
- WeakEventTable.cs
- ShapingWorkspace.cs
- AutomationPropertyChangedEventArgs.cs
- HtmlElementErrorEventArgs.cs
- CancelEventArgs.cs
- AssemblyUtil.cs
- ProtocolsConfigurationEntry.cs
- NamedPermissionSet.cs
- MdImport.cs
- FormattedTextSymbols.cs
- HwndSubclass.cs
- XmlSchemas.cs
- ContainerParaClient.cs
- ElementHostPropertyMap.cs
- ClientApiGenerator.cs
- QuaternionIndependentAnimationStorage.cs
- InteropAutomationProvider.cs
- EventEntry.cs
- DesignTimeParseData.cs
- FacetEnabledSchemaElement.cs
- CompiledRegexRunnerFactory.cs
- DependencyPropertyAttribute.cs
- FeatureSupport.cs
- CacheOutputQuery.cs
- ISFClipboardData.cs
- Paragraph.cs
- MDIControlStrip.cs
- RelationshipSet.cs
- CollectionViewGroupInternal.cs
- CodeDOMProvider.cs
- DataGridViewTextBoxCell.cs
- SqlDataSource.cs
- TextTreeExtractElementUndoUnit.cs
- DragDrop.cs
- StatusBarPanel.cs
- RightsManagementPermission.cs
- TrustManagerPromptUI.cs
- ClientRuntimeConfig.cs
- State.cs
- CaseInsensitiveOrdinalStringComparer.cs
- BoolExpression.cs
- FixedTextView.cs
- RadioButton.cs
- MD5CryptoServiceProvider.cs
- MouseEventArgs.cs
- ZipPackagePart.cs
- TileBrush.cs
- DesignerRegion.cs
- OleTxTransaction.cs
- Sql8ExpressionRewriter.cs
- Block.cs
- glyphs.cs
- PolicyValidationException.cs
- MergablePropertyAttribute.cs
- BinaryParser.cs
- PointF.cs
- FeatureManager.cs
- RefreshPropertiesAttribute.cs
- SchemaElementDecl.cs
- NetMsmqSecurityMode.cs
- ColorConvertedBitmap.cs
- MouseGestureConverter.cs
- PlatformCulture.cs
- ADMembershipProvider.cs
- ServerValidateEventArgs.cs
- DbParameterCollectionHelper.cs
- CompilerGeneratedAttribute.cs
- Content.cs
- SqlConnectionFactory.cs
- _WebProxyDataBuilder.cs