Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XmlIlGenerator.cs
- figurelength.cs
- CoreSwitches.cs
- ArcSegment.cs
- StorageComplexTypeMapping.cs
- __FastResourceComparer.cs
- LogSwitch.cs
- MultilineStringConverter.cs
- CachedFontFamily.cs
- RightsManagementEncryptedStream.cs
- StrongNameIdentityPermission.cs
- RangeValueProviderWrapper.cs
- StylusEventArgs.cs
- DataViewSettingCollection.cs
- _NativeSSPI.cs
- HttpResponse.cs
- WindowsFormsHelpers.cs
- SqlXml.cs
- TextViewBase.cs
- ListViewInsertEventArgs.cs
- WbmpConverter.cs
- XmlSchemaComplexContent.cs
- MessageBox.cs
- ToolStripDropDownItem.cs
- BridgeDataRecord.cs
- X509Logo.cs
- MultiTrigger.cs
- MultitargetUtil.cs
- ChildrenQuery.cs
- ListViewCancelEventArgs.cs
- EventEntry.cs
- ReversePositionQuery.cs
- ResXResourceSet.cs
- XmlFormatMapping.cs
- LinqDataSourceDisposeEventArgs.cs
- SecurityIdentifierElementCollection.cs
- DbProviderSpecificTypePropertyAttribute.cs
- _ProxyChain.cs
- AbstractExpressions.cs
- DynamicMethod.cs
- SymmetricAlgorithm.cs
- SqlDependency.cs
- newitemfactory.cs
- DecoderReplacementFallback.cs
- GenericParameterDataContract.cs
- ByteConverter.cs
- TextRangeProviderWrapper.cs
- AsyncMethodInvoker.cs
- ExtentJoinTreeNode.cs
- SchemaNotation.cs
- MasterPageBuildProvider.cs
- RubberbandSelector.cs
- FileDetails.cs
- AspNetCompatibilityRequirementsMode.cs
- ExternalException.cs
- WebPartExportVerb.cs
- DataGridViewHeaderCell.cs
- Transform.cs
- ReadOnlyObservableCollection.cs
- OleDbDataReader.cs
- PrintPreviewGraphics.cs
- CodeArrayIndexerExpression.cs
- mediapermission.cs
- XamlVector3DCollectionSerializer.cs
- BuildProviderCollection.cs
- SAPIEngineTypes.cs
- ResXResourceWriter.cs
- DataListItem.cs
- XmlCodeExporter.cs
- ResourceDescriptionAttribute.cs
- DiagnosticTraceRecords.cs
- DeleteMemberBinder.cs
- DataView.cs
- _ProxyRegBlob.cs
- PngBitmapEncoder.cs
- CallbackValidator.cs
- TypeInitializationException.cs
- StandardMenuStripVerb.cs
- Baml2006SchemaContext.cs
- Propagator.cs
- IPHostEntry.cs
- Rotation3DAnimationUsingKeyFrames.cs
- OleDbStruct.cs
- iisPickupDirectory.cs
- SQLInt32Storage.cs
- PerfCounterSection.cs
- ListControl.cs
- Internal.cs
- MimeMultiPart.cs
- DataGridViewButtonCell.cs
- EntityDataSourceWrapper.cs
- VisualTreeUtils.cs
- Vector3DKeyFrameCollection.cs
- XPathSelfQuery.cs
- WebContext.cs
- PageThemeParser.cs
- DynamicPropertyHolder.cs
- PointAnimationClockResource.cs
- ClientData.cs
- DataGridViewCellValueEventArgs.cs