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
- TextParagraphProperties.cs
- EncryptedPackageFilter.cs
- ClaimTypes.cs
- TextEncodedRawTextWriter.cs
- CapabilitiesUse.cs
- Process.cs
- HyperLinkField.cs
- ResolveNameEventArgs.cs
- TranslateTransform3D.cs
- CommandConverter.cs
- HelpOperationInvoker.cs
- listitem.cs
- MergeFilterQuery.cs
- WebConfigurationHostFileChange.cs
- BitConverter.cs
- TypeDescriptor.cs
- CharacterHit.cs
- ArgumentsParser.cs
- RadioButtonPopupAdapter.cs
- _HeaderInfoTable.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ObjectPersistData.cs
- HttpResponseInternalWrapper.cs
- WebPartVerbCollection.cs
- PerfCounterSection.cs
- UriSection.cs
- FileUpload.cs
- CryptoConfig.cs
- ObjRef.cs
- NativeMethods.cs
- AtomServiceDocumentSerializer.cs
- MSAANativeProvider.cs
- ConnectionsZoneDesigner.cs
- IndexedGlyphRun.cs
- ManagedFilter.cs
- QilChoice.cs
- QueuePropertyVariants.cs
- Image.cs
- CheckBoxPopupAdapter.cs
- WindowsBrush.cs
- SerializationInfo.cs
- RoamingStoreFileUtility.cs
- OutputCacheSettings.cs
- CodeMethodInvokeExpression.cs
- ComplexTypeEmitter.cs
- DataGridHeaderBorder.cs
- XmlSerializerNamespaces.cs
- TypeToArgumentTypeConverter.cs
- ListDataHelper.cs
- Regex.cs
- FormatterServicesNoSerializableCheck.cs
- ListViewItemCollectionEditor.cs
- RadioButtonAutomationPeer.cs
- FormView.cs
- SecurityDescriptor.cs
- DurableInstance.cs
- ColorMap.cs
- EntitySet.cs
- MsmqIntegrationBindingElement.cs
- ConnectionPoint.cs
- ListViewDataItem.cs
- PerformanceCounterPermissionEntry.cs
- XmlSerializableReader.cs
- DataObjectMethodAttribute.cs
- wgx_commands.cs
- EntityClientCacheKey.cs
- ModelItemImpl.cs
- BasicViewGenerator.cs
- ManagementOperationWatcher.cs
- OrderedDictionary.cs
- CommandField.cs
- EndEvent.cs
- XsdCachingReader.cs
- QueryAccessibilityHelpEvent.cs
- FrameworkElementAutomationPeer.cs
- BaseProcessor.cs
- BufferedReadStream.cs
- SiteMapDataSourceView.cs
- ReadOnlyAttribute.cs
- SurrogateEncoder.cs
- XPathNodeInfoAtom.cs
- BufferedResponseStream.cs
- WizardPanelChangingEventArgs.cs
- BamlRecordWriter.cs
- Object.cs
- GridEntryCollection.cs
- ParseNumbers.cs
- AnyAllSearchOperator.cs
- WebConfigurationManager.cs
- MetadataItemSerializer.cs
- OleDbCommandBuilder.cs
- KeyedCollection.cs
- FrameworkTextComposition.cs
- XamlStream.cs
- CacheDependency.cs
- ExpressionVisitor.cs
- ClientScriptItemCollection.cs
- ComboBox.cs
- TdsParserSafeHandles.cs
- printdlgexmarshaler.cs