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
- DesignTimeTemplateParser.cs
- MainMenu.cs
- SecuritySessionFilter.cs
- PageClientProxyGenerator.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- DataGridViewUtilities.cs
- CheckableControlBaseAdapter.cs
- InlineCollection.cs
- DayRenderEvent.cs
- KeyValueSerializer.cs
- ImageClickEventArgs.cs
- DesignTimeParseData.cs
- StringExpressionSet.cs
- MultiTargetingUtil.cs
- RectAnimationClockResource.cs
- VisualStyleRenderer.cs
- FloaterBaseParaClient.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CopyOfAction.cs
- StorageTypeMapping.cs
- AQNBuilder.cs
- InheritedPropertyChangedEventArgs.cs
- SchemaTypeEmitter.cs
- InternalBufferOverflowException.cs
- ServicePerformanceCounters.cs
- TextElementCollectionHelper.cs
- TabRenderer.cs
- ELinqQueryState.cs
- MaterialGroup.cs
- List.cs
- keycontainerpermission.cs
- StateManagedCollection.cs
- MethodBuilderInstantiation.cs
- AutoCompleteStringCollection.cs
- SdlChannelSink.cs
- DiffuseMaterial.cs
- StandardToolWindows.cs
- HttpServerVarsCollection.cs
- GlobalizationSection.cs
- TabRenderer.cs
- OptimizerPatterns.cs
- X509CertificateChain.cs
- GlyphCache.cs
- StaticContext.cs
- ResourceIDHelper.cs
- ProcessHostServerConfig.cs
- BaseAsyncResult.cs
- WebServiceMethodData.cs
- TdsEnums.cs
- VirtualizingPanel.cs
- DbConnectionInternal.cs
- UriTemplateVariablePathSegment.cs
- PolicyImporterElementCollection.cs
- mactripleDES.cs
- VisualTreeUtils.cs
- ElementProxy.cs
- OrderedDictionaryStateHelper.cs
- ToolStrip.cs
- ButtonField.cs
- SerializationException.cs
- SiteMapNodeItem.cs
- MsmqTransportSecurity.cs
- CapabilitiesSection.cs
- ResourcePermissionBase.cs
- CodeChecksumPragma.cs
- WebPartConnectionsDisconnectVerb.cs
- CodeParameterDeclarationExpressionCollection.cs
- GridToolTip.cs
- LambdaExpression.cs
- DataControlLinkButton.cs
- OdbcReferenceCollection.cs
- WebPartExportVerb.cs
- MemberDescriptor.cs
- SerializationAttributes.cs
- DbConnectionStringBuilder.cs
- StructuralComparisons.cs
- SetUserPreferenceRequest.cs
- Adorner.cs
- ViewGenerator.cs
- BookmarkResumptionRecord.cs
- SaveWorkflowAsyncResult.cs
- Int64Storage.cs
- XslException.cs
- Accessible.cs
- KeyValueInternalCollection.cs
- StackBuilderSink.cs
- PropertyGridView.cs
- ChainOfResponsibility.cs
- CqlLexerHelpers.cs
- RawStylusInputCustomDataList.cs
- LookupBindingPropertiesAttribute.cs
- EmbeddedMailObjectsCollection.cs
- ArglessEventHandlerProxy.cs
- FactoryGenerator.cs
- XmlMtomWriter.cs
- ConstraintEnumerator.cs
- PropertyMappingExceptionEventArgs.cs
- CapiSymmetricAlgorithm.cs
- ProxyHelper.cs
- AsyncSerializedWorker.cs