Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / TextTreeInsertElementUndoUnit.cs / 1 / TextTreeInsertElementUndoUnit.cs
//---------------------------------------------------------------------------- // // File: TextTreeInsertElementUndoUnit.cs // // Description: Undo unit for TextContainer.InsertElement calls. // // History: // 03/03/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using MS.Internal; namespace System.Windows.Documents { // Undo unit for TextContainer.InsertElement calls. internal class TextTreeInsertElementUndoUnit : TextTreeUndoUnit { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Creates a new undo unit instance. // symbolOffset should be just before the start edge of the TextElement to remove. // If deep is true, this unit will undo not only the scoping element // insert, but also all content scoped by the element. internal TextTreeInsertElementUndoUnit(TextContainer tree, int symbolOffset, bool deep) : base(tree, symbolOffset) { _deep = deep; } #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 start; TextPointer end; TextElement element; VerifyTreeContentHashCode(); start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree."); element = start.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); if (_deep) { // Extract the element and its content. end = new TextPointer(this.TextContainer, element.TextElementNode, ElementEdge.AfterEnd); this.TextContainer.DeleteContentInternal(start, end); } else { // Just extract the element, not its content. this.TextContainer.ExtractElementInternal(element); } } #endregion Public Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // If true, this unit tracks a TextElement and its scoped content. // Otherwise, this unit only tracks the TextElement. private readonly bool _deep; #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
- DeadCharTextComposition.cs
- HwndSource.cs
- DataGridPagerStyle.cs
- WebPartMinimizeVerb.cs
- oledbconnectionstring.cs
- SQLBinaryStorage.cs
- AuthStoreRoleProvider.cs
- FixedSOMTextRun.cs
- WmpBitmapEncoder.cs
- ExpressionEditor.cs
- QuaternionAnimationUsingKeyFrames.cs
- DetailsViewModeEventArgs.cs
- StrokeNode.cs
- CircleEase.cs
- DataContractSerializerElement.cs
- ReadOnlyCollectionBase.cs
- ServiceHostingEnvironment.cs
- SqlDuplicator.cs
- DataGrid.cs
- SQLDoubleStorage.cs
- QueryCursorEventArgs.cs
- COM2ColorConverter.cs
- SQLStringStorage.cs
- listitem.cs
- DataBoundControlActionList.cs
- LineGeometry.cs
- PluggableProtocol.cs
- TextEffectCollection.cs
- BindingContext.cs
- TemplateEditingVerb.cs
- CodeVariableDeclarationStatement.cs
- XmlCustomFormatter.cs
- CatalogZone.cs
- CopyNodeSetAction.cs
- DodSequenceMerge.cs
- RIPEMD160Managed.cs
- Transform3D.cs
- CalendarDay.cs
- DelegateBodyWriter.cs
- TdsRecordBufferSetter.cs
- XmlSchemaAnnotation.cs
- Animatable.cs
- PersonalizationProviderCollection.cs
- ThreadLocal.cs
- PermissionListSet.cs
- TypefaceCollection.cs
- WebException.cs
- SmtpClient.cs
- MergeLocalizationDirectives.cs
- Int32EqualityComparer.cs
- XmlILModule.cs
- PersonalizablePropertyEntry.cs
- FontUnit.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TransformedBitmap.cs
- ApplicationId.cs
- Error.cs
- StringArrayConverter.cs
- DbCommandDefinition.cs
- XhtmlBasicSelectionListAdapter.cs
- ISAPIRuntime.cs
- NameNode.cs
- EntityCollection.cs
- BaseCollection.cs
- RegistrationContext.cs
- JobCollate.cs
- PerfCounters.cs
- FixedDocumentPaginator.cs
- GridViewRowPresenter.cs
- StateBag.cs
- LocatorManager.cs
- LinqDataSourceInsertEventArgs.cs
- PriorityItem.cs
- SqlCacheDependency.cs
- Executor.cs
- SchemaNamespaceManager.cs
- HelpEvent.cs
- SimpleTypeResolver.cs
- RoutingUtilities.cs
- PersistChildrenAttribute.cs
- ExtensibleClassFactory.cs
- CodeSnippetStatement.cs
- DefaultValidator.cs
- HandleRef.cs
- XmlSchemaAttributeGroupRef.cs
- InvokeGenerator.cs
- WinInetCache.cs
- PointLightBase.cs
- ThreadExceptionEvent.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- KeyedPriorityQueue.cs
- Peer.cs
- EncoderFallback.cs
- BoundsDrawingContextWalker.cs
- FormClosedEvent.cs
- FtpWebRequest.cs
- SafeCryptContextHandle.cs
- Trace.cs
- CacheOutputQuery.cs
- HealthMonitoringSection.cs