Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / TextTreeInsertUndoUnit.cs / 1 / TextTreeInsertUndoUnit.cs
//---------------------------------------------------------------------------- // // File: TextTreeInsertUndoUnit.cs // // Description: Undo unit for TextContainer.InsertText and InsertEmbeddedObject calls. // // History: // 03/03/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using MS.Internal; namespace System.Windows.Documents { // Undo unit for TextContainer.InsertText and InsertEmbeddedObject calls. internal class TextTreeInsertUndoUnit : TextTreeUndoUnit { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Create a new undo unit instance. // symbolOffset and symbolCount track the offset of the inserted content // and its symbol count, respectively. internal TextTreeInsertUndoUnit(TextContainer tree, int symbolOffset, int symbolCount) : base(tree, symbolOffset) { Invariant.Assert(symbolCount > 0, "Creating no-op insert undo unit!"); _symbolCount = symbolCount; } #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; VerifyTreeContentHashCode(); start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount, LogicalDirection.Forward); this.TextContainer.DeleteContentInternal(start, end); } #endregion Public Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // Count of symbols to remove. private readonly int _symbolCount; #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
- FontCacheUtil.cs
- SrgsItemList.cs
- HotSpotCollection.cs
- Win32PrintDialog.cs
- IIS7UserPrincipal.cs
- ViewgenContext.cs
- FileDialogPermission.cs
- RelationshipConverter.cs
- PtsHelper.cs
- NamespaceQuery.cs
- TextRunCache.cs
- InstanceHandleReference.cs
- CounterSampleCalculator.cs
- PlaceHolder.cs
- StoreItemCollection.cs
- FormsAuthenticationConfiguration.cs
- CodeBinaryOperatorExpression.cs
- _TransmitFileOverlappedAsyncResult.cs
- StringToken.cs
- PersonalizationDictionary.cs
- TypeBuilderInstantiation.cs
- DCSafeHandle.cs
- GeometryModel3D.cs
- OutputCacheSettings.cs
- TrimSurroundingWhitespaceAttribute.cs
- HeaderCollection.cs
- Itemizer.cs
- DataGridViewCellPaintingEventArgs.cs
- WebReferencesBuildProvider.cs
- ContentPosition.cs
- OdbcRowUpdatingEvent.cs
- DirectoryInfo.cs
- ExpressionLexer.cs
- StringCollection.cs
- NotificationContext.cs
- XsltFunctions.cs
- fixedPageContentExtractor.cs
- SerializableReadOnlyDictionary.cs
- UICuesEvent.cs
- TextSelection.cs
- CompoundFileStreamReference.cs
- GrammarBuilderWildcard.cs
- UseAttributeSetsAction.cs
- CopyAction.cs
- XmlSchemaObjectCollection.cs
- SymbolTable.cs
- CustomGrammar.cs
- CompoundFileIOPermission.cs
- AuthStoreRoleProvider.cs
- TreeNodeStyle.cs
- XmlSerializationReader.cs
- BinaryHeap.cs
- DataBoundControlDesigner.cs
- BitmapSizeOptions.cs
- DiscreteKeyFrames.cs
- Transform3D.cs
- Socket.cs
- CLSCompliantAttribute.cs
- RawStylusInput.cs
- XmlSchemaException.cs
- Rijndael.cs
- ClassValidator.cs
- WebPartRestoreVerb.cs
- LineUtil.cs
- TextDecorationLocationValidation.cs
- UserControl.cs
- SectionRecord.cs
- XmlBinaryReaderSession.cs
- EntityDescriptor.cs
- ReachDocumentPageSerializerAsync.cs
- filewebrequest.cs
- BasicBrowserDialog.cs
- WebPartZoneDesigner.cs
- DateTimeHelper.cs
- NodeFunctions.cs
- GcSettings.cs
- AsyncCompletedEventArgs.cs
- DateTime.cs
- MemoryMappedViewAccessor.cs
- SqlDataRecord.cs
- SubtreeProcessor.cs
- DocumentViewerConstants.cs
- Operand.cs
- SqlGatherConsumedAliases.cs
- OleDbSchemaGuid.cs
- StartUpEventArgs.cs
- PageEventArgs.cs
- BindingUtils.cs
- COAUTHINFO.cs
- CookieParameter.cs
- brushes.cs
- ArrangedElement.cs
- ResXResourceWriter.cs
- DateTimeOffsetConverter.cs
- XsdDateTime.cs
- EventLogPermissionEntry.cs
- LayoutSettings.cs
- RegionIterator.cs
- RegionIterator.cs
- RsaSecurityTokenAuthenticator.cs