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
- FixedSOMPage.cs
- DateRangeEvent.cs
- DataTemplateSelector.cs
- CustomErrorsSectionWrapper.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- TreeViewDesigner.cs
- ToolStripPanelRenderEventArgs.cs
- Scene3D.cs
- Section.cs
- MediaElement.cs
- ProjectionCamera.cs
- WebSysDisplayNameAttribute.cs
- HtmlCalendarAdapter.cs
- SystemBrushes.cs
- TreeNodeBindingCollection.cs
- DistinctQueryOperator.cs
- HttpDictionary.cs
- ClrPerspective.cs
- OdbcFactory.cs
- PrintController.cs
- handlecollector.cs
- SqlTriggerAttribute.cs
- DataServiceQueryException.cs
- EntityClientCacheEntry.cs
- ExpressionBuilder.cs
- RawStylusActions.cs
- HandlerFactoryWrapper.cs
- BinaryConverter.cs
- ToolBarButton.cs
- SuppressedPackageProperties.cs
- SetUserLanguageRequest.cs
- ParameterModifier.cs
- TextDecorationCollectionConverter.cs
- GrammarBuilderRuleRef.cs
- StartUpEventArgs.cs
- ConfigPathUtility.cs
- PopupEventArgs.cs
- DefaultBindingPropertyAttribute.cs
- SerializationSectionGroup.cs
- ApplicationServiceHelper.cs
- WebPartAuthorizationEventArgs.cs
- UnicastIPAddressInformationCollection.cs
- Stack.cs
- ReflectPropertyDescriptor.cs
- DefaultHttpHandler.cs
- Fx.cs
- ObjectTag.cs
- ellipse.cs
- StringUtil.cs
- DocumentPaginator.cs
- CellTreeNodeVisitors.cs
- UInt32Storage.cs
- WebBaseEventKeyComparer.cs
- TypefaceMap.cs
- WebEventTraceProvider.cs
- XmlElementCollection.cs
- DocumentGrid.cs
- TypeUtil.cs
- RegistryConfigurationProvider.cs
- SQLBinaryStorage.cs
- DataGridViewLayoutData.cs
- DesignerDataRelationship.cs
- SynchronizedDispatch.cs
- ExternalException.cs
- SpotLight.cs
- KeyedHashAlgorithm.cs
- ImageAutomationPeer.cs
- QuaternionAnimationBase.cs
- __Error.cs
- DefaultWorkflowTransactionService.cs
- DependencyPropertyAttribute.cs
- LinkTarget.cs
- StylusPointPropertyInfoDefaults.cs
- ProviderConnectionPoint.cs
- StopStoryboard.cs
- PermissionSetEnumerator.cs
- Int32KeyFrameCollection.cs
- FormatterServices.cs
- TypeSystemProvider.cs
- AppSettingsExpressionBuilder.cs
- TextEmbeddedObject.cs
- TabControlDesigner.cs
- CacheOutputQuery.cs
- DesignerLoader.cs
- ProviderConnectionPointCollection.cs
- WebEvents.cs
- _NetworkingPerfCounters.cs
- Figure.cs
- HttpRequestCacheValidator.cs
- RootDesignerSerializerAttribute.cs
- XmlCharacterData.cs
- GetLedgerRequest.cs
- X509SecurityToken.cs
- MultipartContentParser.cs
- _SecureChannel.cs
- ZipIOExtraFieldZip64Element.cs
- SecureStringHasher.cs
- ModelTreeEnumerator.cs
- Viewport3DVisual.cs
- RuleAttributes.cs