Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TextTreeInsertElementUndoUnit.cs / 1305600 / 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 [....] 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
- PreProcessInputEventArgs.cs
- OpenTypeMethods.cs
- ProtocolsConfigurationHandler.cs
- BitmapData.cs
- XmlQueryOutput.cs
- ParameterBuilder.cs
- Msec.cs
- FamilyCollection.cs
- OleDbRowUpdatingEvent.cs
- HtmlTableRowCollection.cs
- FixedDocumentSequencePaginator.cs
- ContextItem.cs
- AllMembershipCondition.cs
- RTLAwareMessageBox.cs
- MaskedTextBox.cs
- ContentPathSegment.cs
- DocumentViewerAutomationPeer.cs
- LineVisual.cs
- GraphicsContext.cs
- Thread.cs
- TableLayoutStyleCollection.cs
- SelectionWordBreaker.cs
- DesignerActionListCollection.cs
- DynamicPropertyReader.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- XsltException.cs
- PublisherIdentityPermission.cs
- Tokenizer.cs
- PrimarySelectionGlyph.cs
- SpellerHighlightLayer.cs
- KeyValuePair.cs
- figurelengthconverter.cs
- GridPatternIdentifiers.cs
- GridToolTip.cs
- FileLoadException.cs
- TransportReplyChannelAcceptor.cs
- SendActivityEventArgs.cs
- BreakRecordTable.cs
- GeneralTransform3DCollection.cs
- SchemaElementDecl.cs
- ColorDialog.cs
- ParagraphResult.cs
- HostingPreferredMapPath.cs
- HtmlGenericControl.cs
- TraceUtility.cs
- RecordBuilder.cs
- WebConfigurationHost.cs
- UnsafeNetInfoNativeMethods.cs
- SerializationEventsCache.cs
- SqlMethodCallConverter.cs
- Attributes.cs
- ServerValidateEventArgs.cs
- EncodingNLS.cs
- StandardOleMarshalObject.cs
- StorageSetMapping.cs
- XmlSchemaSet.cs
- CompiledQueryCacheEntry.cs
- GPPOINT.cs
- IssuanceTokenProviderBase.cs
- PowerStatus.cs
- MailMessageEventArgs.cs
- sqlser.cs
- SafeCancelMibChangeNotify.cs
- FilterQuery.cs
- FileUtil.cs
- Lasso.cs
- CompiledQuery.cs
- CacheDict.cs
- TextRangeEditTables.cs
- DataKey.cs
- EncoderParameter.cs
- WebHttpSecurity.cs
- CodeParameterDeclarationExpressionCollection.cs
- WriterOutput.cs
- CheckBoxRenderer.cs
- NavigatorInput.cs
- GrammarBuilderRuleRef.cs
- FakeModelPropertyImpl.cs
- PageAsyncTask.cs
- NavigationWindowAutomationPeer.cs
- SchemaCollectionPreprocessor.cs
- FeatureSupport.cs
- Activity.cs
- MimeMultiPart.cs
- LightweightCodeGenerator.cs
- BrowserCapabilitiesCodeGenerator.cs
- MgmtResManager.cs
- CompositeFontFamily.cs
- WebDescriptionAttribute.cs
- ByteViewer.cs
- LinqDataView.cs
- SymbolDocumentGenerator.cs
- BehaviorEditorPart.cs
- Monitor.cs
- ProfileBuildProvider.cs
- FontClient.cs
- CodePrimitiveExpression.cs
- EdmEntityTypeAttribute.cs
- PopupRootAutomationPeer.cs
- XmlSchemaFacet.cs