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
- RegisteredArrayDeclaration.cs
- XPathSelectionIterator.cs
- DataGridItemCollection.cs
- SchemaConstraints.cs
- HttpConfigurationContext.cs
- sqlser.cs
- KeyManager.cs
- ResourcePermissionBase.cs
- CodeExpressionStatement.cs
- PeerApplication.cs
- DataSvcMapFileSerializer.cs
- SelectionPatternIdentifiers.cs
- CustomAttributeFormatException.cs
- NetworkInformationPermission.cs
- ImageAttributes.cs
- CellPartitioner.cs
- TaskCanceledException.cs
- XPathArrayIterator.cs
- DelegatedStream.cs
- TypeHelper.cs
- RelationalExpressions.cs
- Point.cs
- ParserStreamGeometryContext.cs
- ToolStripManager.cs
- XPathChildIterator.cs
- DataGridViewRowStateChangedEventArgs.cs
- XmlSchemaSimpleTypeUnion.cs
- NotifyIcon.cs
- BaseValidatorDesigner.cs
- GridEntry.cs
- DoubleCollection.cs
- DbDataAdapter.cs
- WebRequest.cs
- BridgeDataRecord.cs
- WorkflowPageSetupDialog.cs
- CancellableEnumerable.cs
- XmlObjectSerializerWriteContextComplex.cs
- SurrogateSelector.cs
- TransactionState.cs
- TimeSpanValidatorAttribute.cs
- VariableQuery.cs
- FunctionDetailsReader.cs
- BinaryFormatter.cs
- AttributeSetAction.cs
- ExpanderAutomationPeer.cs
- BitmapInitialize.cs
- ConstraintManager.cs
- ColumnWidthChangingEvent.cs
- Context.cs
- ExpressionBindings.cs
- BinaryFormatterWriter.cs
- HashHelper.cs
- MessageHeaderDescriptionCollection.cs
- Translator.cs
- wgx_exports.cs
- XamlRtfConverter.cs
- DependencyPropertyDescriptor.cs
- SharedStatics.cs
- SinglePageViewer.cs
- SerializationInfo.cs
- WmlCommandAdapter.cs
- ConfigurationSectionGroupCollection.cs
- AxParameterData.cs
- ToolStripPanelRow.cs
- ColorContext.cs
- OleAutBinder.cs
- DynamicObject.cs
- WorkflowTerminatedException.cs
- FixedTextSelectionProcessor.cs
- ScrollBar.cs
- PDBReader.cs
- TemplateColumn.cs
- FileDataSourceCache.cs
- TransformationRules.cs
- ObjectKeyFrameCollection.cs
- XmlEncoding.cs
- HtmlToClrEventProxy.cs
- TagPrefixCollection.cs
- XmlIterators.cs
- TdsParser.cs
- CompModSwitches.cs
- DefaultParameterValueAttribute.cs
- SymLanguageVendor.cs
- wpf-etw.cs
- DataViewManager.cs
- HtmlShim.cs
- ArraySortHelper.cs
- mediaeventshelper.cs
- DataTableNewRowEvent.cs
- AndCondition.cs
- Image.cs
- XNodeSchemaApplier.cs
- DbResourceAllocator.cs
- ContentFilePart.cs
- SystemInformation.cs
- ClientSponsor.cs
- StyleXamlParser.cs
- HttpStreams.cs
- XmlCustomFormatter.cs
- FixedTextView.cs