Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TextTreeInsertUndoUnit.cs / 1305600 / 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. //---------------------------------------------------------------------------- // // 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
- EventEntry.cs
- CaseCqlBlock.cs
- TimeSpanOrInfiniteConverter.cs
- XomlDesignerLoader.cs
- DesignerDataStoredProcedure.cs
- RegistryKey.cs
- XmlLinkedNode.cs
- XmlCharCheckingWriter.cs
- Timer.cs
- FloaterParagraph.cs
- embossbitmapeffect.cs
- PropertyToken.cs
- NumberAction.cs
- MostlySingletonList.cs
- XmlTextReaderImpl.cs
- ComplexObject.cs
- PickDesigner.xaml.cs
- MembershipPasswordException.cs
- Evidence.cs
- EmptyQuery.cs
- MonthChangedEventArgs.cs
- TwoPhaseCommitProxy.cs
- MessagePropertyAttribute.cs
- ControlCollection.cs
- GlobalizationSection.cs
- OleDbFactory.cs
- Processor.cs
- DateTimeFormatInfoScanner.cs
- GridViewColumnCollectionChangedEventArgs.cs
- SourceFileInfo.cs
- ThreadTrace.cs
- smtppermission.cs
- GeometryCollection.cs
- XmlAttribute.cs
- GeometryHitTestParameters.cs
- CriticalExceptions.cs
- FragmentQuery.cs
- PolicyUtility.cs
- DocumentEventArgs.cs
- SqlDataSourceQueryEditorForm.cs
- ModelServiceImpl.cs
- ListViewSortEventArgs.cs
- BindingExpressionUncommonField.cs
- OutOfProcStateClientManager.cs
- RewritingSimplifier.cs
- SourceSwitch.cs
- DispatcherExceptionFilterEventArgs.cs
- TdsParser.cs
- UserValidatedEventArgs.cs
- UpDownBase.cs
- SaveFileDialog.cs
- ProtectedConfiguration.cs
- MaskedTextBoxTextEditorDropDown.cs
- WindowsHyperlink.cs
- ObjectDataProvider.cs
- OleDbFactory.cs
- OperandQuery.cs
- ImageInfo.cs
- odbcmetadatacollectionnames.cs
- RedistVersionInfo.cs
- AttributeProviderAttribute.cs
- WmlFormAdapter.cs
- GridItemPattern.cs
- VisualTreeHelper.cs
- ErrorStyle.cs
- EdmRelationshipRoleAttribute.cs
- DbInsertCommandTree.cs
- RpcCryptoContext.cs
- Polyline.cs
- RequestCachingSection.cs
- GeometryModel3D.cs
- TerminateWorkflow.cs
- RotationValidation.cs
- XmlSchemaRedefine.cs
- AssociationTypeEmitter.cs
- TabControlAutomationPeer.cs
- TextTreeRootNode.cs
- DbMetaDataFactory.cs
- Pointer.cs
- InheritablePropertyChangeInfo.cs
- EncoderFallback.cs
- cookieexception.cs
- WindowsScrollBar.cs
- CryptographicAttribute.cs
- DataGridViewColumn.cs
- LookupBindingPropertiesAttribute.cs
- WebPartDisplayMode.cs
- SecurityHeaderLayout.cs
- MatrixTransform.cs
- TimeSpanConverter.cs
- Funcletizer.cs
- ReceiveActivityValidator.cs
- ValidationError.cs
- ExcCanonicalXml.cs
- SecUtil.cs
- CalloutQueueItem.cs
- HtmlContainerControl.cs
- CellCreator.cs
- PluralizationService.cs
- ReceiveMessageRecord.cs