Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RefType.cs
- FlowLayout.cs
- SatelliteContractVersionAttribute.cs
- OdbcCommand.cs
- StreamGeometryContext.cs
- TransformerInfo.cs
- TrustManager.cs
- UnsafeNativeMethods.cs
- SimpleTypeResolver.cs
- COM2ExtendedTypeConverter.cs
- InvalidMessageContractException.cs
- DropTarget.cs
- ListViewEditEventArgs.cs
- ExpressionBuilderContext.cs
- ScrollViewer.cs
- XmlDictionary.cs
- RelationshipEnd.cs
- DataControlFieldCell.cs
- Calendar.cs
- IdleTimeoutMonitor.cs
- TextDecorations.cs
- TypeConverterAttribute.cs
- KeyboardDevice.cs
- MarshalByRefObject.cs
- configsystem.cs
- FormViewAutoFormat.cs
- SqlTrackingWorkflowInstance.cs
- ToolStripScrollButton.cs
- Animatable.cs
- DiffuseMaterial.cs
- SolidColorBrush.cs
- BoundingRectTracker.cs
- GiveFeedbackEventArgs.cs
- TargetParameterCountException.cs
- InternalCache.cs
- ThemeDirectoryCompiler.cs
- ActivityBindForm.cs
- ConstructorNeedsTagAttribute.cs
- CodeCastExpression.cs
- TextElement.cs
- ConfigurationFileMap.cs
- SqlDataAdapter.cs
- MenuItemAutomationPeer.cs
- PropertyTabAttribute.cs
- DataGridViewRowsRemovedEventArgs.cs
- DataSourceSerializationException.cs
- EventListenerClientSide.cs
- CreateParams.cs
- NetNamedPipeSecurityMode.cs
- _Win32.cs
- XmlLoader.cs
- TagNameToTypeMapper.cs
- DesignerActionUIStateChangeEventArgs.cs
- AssemblyNameProxy.cs
- TemplateControlBuildProvider.cs
- PersonalizationStateQuery.cs
- BindingSource.cs
- PersonalizableTypeEntry.cs
- UpdateCommand.cs
- TypedReference.cs
- DbParameterHelper.cs
- VersionedStream.cs
- RootBrowserWindow.cs
- Pen.cs
- CollectionChangeEventArgs.cs
- EdmItemError.cs
- MenuItemBinding.cs
- Int64AnimationUsingKeyFrames.cs
- HMACSHA384.cs
- MulticastDelegate.cs
- OracleRowUpdatingEventArgs.cs
- WebPartCatalogAddVerb.cs
- QueryOptionExpression.cs
- ServicesUtilities.cs
- UriSectionData.cs
- DateTimeOffsetStorage.cs
- CacheMemory.cs
- StructuralObject.cs
- WindowsScrollBar.cs
- DataGridViewCellMouseEventArgs.cs
- BuildProvider.cs
- ProfileProvider.cs
- DesignerLoader.cs
- ImageCreator.cs
- TreeView.cs
- ScaleTransform.cs
- HistoryEventArgs.cs
- OleDbRowUpdatedEvent.cs
- DbCommandTree.cs
- XmlDocumentSerializer.cs
- ScrollBar.cs
- LinqDataSourceView.cs
- EncoderNLS.cs
- WebPartMinimizeVerb.cs
- ParameterEditorUserControl.cs
- SHA256Managed.cs
- CultureMapper.cs
- Symbol.cs
- BaseDataList.cs
- PropertyReferenceExtension.cs