Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- MatcherBuilder.cs
- Slider.cs
- TypeDescriptionProvider.cs
- ExpandableObjectConverter.cs
- DataObject.cs
- XmlDataCollection.cs
- CompatibleComparer.cs
- DependencyPropertyKind.cs
- HttpModuleCollection.cs
- MembershipPasswordException.cs
- AutoGeneratedField.cs
- UpdatePanel.cs
- WindowCollection.cs
- EventMemberCodeDomSerializer.cs
- QueryExpression.cs
- StateItem.cs
- PasswordRecovery.cs
- HwndMouseInputProvider.cs
- SelectionItemPattern.cs
- FormatterConverter.cs
- FixedSchema.cs
- odbcmetadatafactory.cs
- TimeStampChecker.cs
- SessionChannels.cs
- AsymmetricSignatureFormatter.cs
- XmlArrayItemAttribute.cs
- DateTimePicker.cs
- TextCompositionManager.cs
- EventLogTraceListener.cs
- ColorAnimation.cs
- SqlConnection.cs
- Marshal.cs
- ContentHostHelper.cs
- TreeViewCancelEvent.cs
- XmlnsPrefixAttribute.cs
- FlowDocumentReader.cs
- BuildProvider.cs
- MediaCommands.cs
- URLMembershipCondition.cs
- FormViewUpdatedEventArgs.cs
- HttpListenerResponse.cs
- ScopedKnownTypes.cs
- Decoder.cs
- ListViewItem.cs
- Point3DCollectionValueSerializer.cs
- DocumentEventArgs.cs
- SevenBitStream.cs
- SystemIPv4InterfaceProperties.cs
- XmlComment.cs
- X509SecurityTokenProvider.cs
- TreeNodeStyle.cs
- AddingNewEventArgs.cs
- HttpServerVarsCollection.cs
- EventListener.cs
- WebResponse.cs
- ContentElementAutomationPeer.cs
- PresentationAppDomainManager.cs
- NameSpaceEvent.cs
- MappingModelBuildProvider.cs
- WsdlBuildProvider.cs
- X509UI.cs
- BezierSegment.cs
- HttpPostLocalhostServerProtocol.cs
- CultureTableRecord.cs
- TypographyProperties.cs
- TextEffect.cs
- ColorAnimation.cs
- URLMembershipCondition.cs
- SqlResolver.cs
- StylusPointProperties.cs
- SerializationAttributes.cs
- UIElement3D.cs
- XamlDesignerSerializationManager.cs
- AutomationPatternInfo.cs
- CultureInfoConverter.cs
- SaveFileDialog.cs
- OverlappedContext.cs
- GlyphCache.cs
- InputScope.cs
- ValidationErrorCollection.cs
- ResourceIDHelper.cs
- TextPointerBase.cs
- ExtensionSimplifierMarkupObject.cs
- StaticExtension.cs
- StrokeNode.cs
- JavascriptCallbackResponseProperty.cs
- MD5CryptoServiceProvider.cs
- TemplateComponentConnector.cs
- ServiceInfoCollection.cs
- TransformerConfigurationWizardBase.cs
- DataGridViewRowsAddedEventArgs.cs
- Gdiplus.cs
- Vector3DAnimationBase.cs
- TextBoxAutomationPeer.cs
- ObjectQueryExecutionPlan.cs
- Misc.cs
- OleDbMetaDataFactory.cs
- FlowLayout.cs
- FontCollection.cs
- SspiSafeHandles.cs