Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / 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 : benwest - 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 : benwest - 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
- FixedSOMContainer.cs
- TypeDefinition.cs
- GridViewPageEventArgs.cs
- MediaSystem.cs
- InputReferenceExpression.cs
- AsyncStreamReader.cs
- FileClassifier.cs
- DataTemplateSelector.cs
- UrlAuthFailedErrorFormatter.cs
- FixedTextSelectionProcessor.cs
- XmlComment.cs
- _OSSOCK.cs
- CodeExpressionCollection.cs
- WindowsStreamSecurityUpgradeProvider.cs
- WebPartManagerDesigner.cs
- Tablet.cs
- GrammarBuilderPhrase.cs
- SelectorItemAutomationPeer.cs
- QueryPageSettingsEventArgs.cs
- SafeEventHandle.cs
- NavigationProgressEventArgs.cs
- PanelDesigner.cs
- OutputCacheProfileCollection.cs
- PointCollectionConverter.cs
- MarkupCompiler.cs
- ObservableCollectionDefaultValueFactory.cs
- VectorAnimationBase.cs
- XmlIlVisitor.cs
- ReadingWritingEntityEventArgs.cs
- SystemIPGlobalProperties.cs
- TemplateBindingExpressionConverter.cs
- IProducerConsumerCollection.cs
- FixedSOMLineRanges.cs
- RoutedEventArgs.cs
- DeadCharTextComposition.cs
- EntryIndex.cs
- TouchEventArgs.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- SoapSchemaMember.cs
- DataGridViewLayoutData.cs
- TripleDESCryptoServiceProvider.cs
- IndexingContentUnit.cs
- InlinedAggregationOperator.cs
- TableItemPatternIdentifiers.cs
- DataQuery.cs
- _NetworkingPerfCounters.cs
- SelectManyQueryOperator.cs
- Oid.cs
- altserialization.cs
- Size3DConverter.cs
- LayoutTableCell.cs
- StateWorkerRequest.cs
- CodeAttributeDeclaration.cs
- EntityDataSourceContainerNameItem.cs
- SqlDataSourceSummaryPanel.cs
- DSASignatureDeformatter.cs
- EventListener.cs
- SecurityUtils.cs
- UnaryNode.cs
- ConfigurationSettings.cs
- ConditionCollection.cs
- DataGridViewCellStateChangedEventArgs.cs
- XmlStrings.cs
- DockingAttribute.cs
- CopyAction.cs
- __ComObject.cs
- DescendentsWalkerBase.cs
- Exceptions.cs
- InvalidOleVariantTypeException.cs
- UpdatePanelControlTrigger.cs
- SoapEnumAttribute.cs
- SiteMapNode.cs
- MailWebEventProvider.cs
- ColorContextHelper.cs
- XmlElement.cs
- PackUriHelper.cs
- SecurityContextKeyIdentifierClause.cs
- columnmapfactory.cs
- QueryStringParameter.cs
- ElementHost.cs
- LineServices.cs
- HybridCollection.cs
- List.cs
- WebPartConnectVerb.cs
- errorpatternmatcher.cs
- InvokeCompletedEventArgs.cs
- CompileLiteralTextParser.cs
- TraceContext.cs
- Cursors.cs
- WebBrowserContainer.cs
- BufferBuilder.cs
- WebPartUtil.cs
- ControlEvent.cs
- ResourceExpressionBuilder.cs
- XomlDesignerLoader.cs
- Focus.cs
- ObjectViewEntityCollectionData.cs
- Dispatcher.cs
- CodeParameterDeclarationExpression.cs
- SmtpNetworkElement.cs