Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / MS / Internal / PtsHost / DirtyTextRange.cs / 1 / DirtyTextRange.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: DirtyTextRange.cs // // Description: Dirty text range describes change in the TextContainer. // // History: // 06/06/2003 : grzegorz - created. // //--------------------------------------------------------------------------- using System; using System.Windows.Controls; using System.Windows.Documents; namespace MS.Internal.PtsHost { // --------------------------------------------------------------------- // Dirty text range describes change in the TextContainer. // --------------------------------------------------------------------- internal struct DirtyTextRange { // ------------------------------------------------------------------ // Constructor // // startIndex - Index of the starting position of the change. // positionsAdded - Number of characters added. // positionsRemoved - Number of characters removed. // ----------------------------------------------------------------- internal DirtyTextRange(int startIndex, int positionsAdded, int positionsRemoved) : this(startIndex, positionsAdded, positionsRemoved, false /* affectsRenderOnly */) { } // ------------------------------------------------------------------ // Constructor // // startIndex - Index of the starting position of the change. // positionsAdded - Number of characters added. // positionsRemoved - Number of characters removed. // affectsRenderOnly - true if change does not affect measure (highlight change) // ------------------------------------------------------------------ internal DirtyTextRange(int startIndex, int positionsAdded, int positionsRemoved, bool affectsRenderOnly) { StartIndex = startIndex; PositionsAdded = positionsAdded; PositionsRemoved = positionsRemoved; AffectsRenderOnly = affectsRenderOnly; } // ----------------------------------------------------------------- // Constructor // // change - TextContainer change data. // ------------------------------------------------------------------ internal DirtyTextRange(TextContainerChangeEventArgs change) { StartIndex = change.ITextPosition.Offset; PositionsAdded = 0; PositionsRemoved = 0; switch (change.TextChange) { case TextChangeType.ContentAdded: PositionsAdded = change.Count; break; case TextChangeType.ContentRemoved: PositionsRemoved = change.Count; break; case TextChangeType.PropertyModified: PositionsAdded = change.Count; PositionsRemoved = change.Count; break; } AffectsRenderOnly = false; } // ----------------------------------------------------------------- // Index of the starting position of the change. // ----------------------------------------------------------------- internal int StartIndex; // ----------------------------------------------------------------- // Number of characters added. // ------------------------------------------------------------------ internal int PositionsAdded; // ----------------------------------------------------------------- // Number of characters removed. // ------------------------------------------------------------------ internal int PositionsRemoved; // ------------------------------------------------------------------ // true if the change affects render only (ie, a highlight change). // ----------------------------------------------------------------- internal bool AffectsRenderOnly; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: DirtyTextRange.cs // // Description: Dirty text range describes change in the TextContainer. // // History: // 06/06/2003 : grzegorz - created. // //--------------------------------------------------------------------------- using System; using System.Windows.Controls; using System.Windows.Documents; namespace MS.Internal.PtsHost { // --------------------------------------------------------------------- // Dirty text range describes change in the TextContainer. // --------------------------------------------------------------------- internal struct DirtyTextRange { // ------------------------------------------------------------------ // Constructor // // startIndex - Index of the starting position of the change. // positionsAdded - Number of characters added. // positionsRemoved - Number of characters removed. // ----------------------------------------------------------------- internal DirtyTextRange(int startIndex, int positionsAdded, int positionsRemoved) : this(startIndex, positionsAdded, positionsRemoved, false /* affectsRenderOnly */) { } // ------------------------------------------------------------------ // Constructor // // startIndex - Index of the starting position of the change. // positionsAdded - Number of characters added. // positionsRemoved - Number of characters removed. // affectsRenderOnly - true if change does not affect measure (highlight change) // ------------------------------------------------------------------ internal DirtyTextRange(int startIndex, int positionsAdded, int positionsRemoved, bool affectsRenderOnly) { StartIndex = startIndex; PositionsAdded = positionsAdded; PositionsRemoved = positionsRemoved; AffectsRenderOnly = affectsRenderOnly; } // ----------------------------------------------------------------- // Constructor // // change - TextContainer change data. // ------------------------------------------------------------------ internal DirtyTextRange(TextContainerChangeEventArgs change) { StartIndex = change.ITextPosition.Offset; PositionsAdded = 0; PositionsRemoved = 0; switch (change.TextChange) { case TextChangeType.ContentAdded: PositionsAdded = change.Count; break; case TextChangeType.ContentRemoved: PositionsRemoved = change.Count; break; case TextChangeType.PropertyModified: PositionsAdded = change.Count; PositionsRemoved = change.Count; break; } AffectsRenderOnly = false; } // ----------------------------------------------------------------- // Index of the starting position of the change. // ----------------------------------------------------------------- internal int StartIndex; // ----------------------------------------------------------------- // Number of characters added. // ------------------------------------------------------------------ internal int PositionsAdded; // ----------------------------------------------------------------- // Number of characters removed. // ------------------------------------------------------------------ internal int PositionsRemoved; // ------------------------------------------------------------------ // true if the change affects render only (ie, a highlight change). // ----------------------------------------------------------------- internal bool AffectsRenderOnly; } } // 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
- SelectionPattern.cs
- OpenTypeCommon.cs
- xml.cs
- versioninfo.cs
- RouteCollection.cs
- ColorMap.cs
- BitmapSizeOptions.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- RtfToXamlReader.cs
- WebBaseEventKeyComparer.cs
- SafeFileHandle.cs
- Site.cs
- WebRequest.cs
- QueryMath.cs
- SystemTcpConnection.cs
- SignedPkcs7.cs
- CTreeGenerator.cs
- FormatterServices.cs
- DataObjectMethodAttribute.cs
- NullRuntimeConfig.cs
- ParameterExpression.cs
- _StreamFramer.cs
- Cloud.cs
- ListViewUpdateEventArgs.cs
- OleDbErrorCollection.cs
- XPathAncestorIterator.cs
- odbcmetadatafactory.cs
- ErrorEventArgs.cs
- loginstatus.cs
- Assembly.cs
- MatrixTransform3D.cs
- DocumentOutline.cs
- TextPointer.cs
- CredentialCache.cs
- BaseTemplateBuildProvider.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ProfileEventArgs.cs
- TimeSpanValidatorAttribute.cs
- Win32KeyboardDevice.cs
- BinaryParser.cs
- CompareValidator.cs
- StateMachineWorkflow.cs
- PropVariant.cs
- ExtentCqlBlock.cs
- XmlEncodedRawTextWriter.cs
- StorageInfo.cs
- ArrayConverter.cs
- categoryentry.cs
- CodeGroup.cs
- RenderData.cs
- _Events.cs
- GraphicsState.cs
- DesignerView.cs
- ToolStripRendererSwitcher.cs
- TypeBuilderInstantiation.cs
- X509Chain.cs
- TypeInformation.cs
- SHA1.cs
- KernelTypeValidation.cs
- MenuItemStyleCollectionEditor.cs
- ClientTargetCollection.cs
- PropertyToken.cs
- RegistrySecurity.cs
- CodeTypeParameter.cs
- ListBoxItemAutomationPeer.cs
- ImageButton.cs
- StringAnimationBase.cs
- XmlSchemaSimpleContentExtension.cs
- StreamResourceInfo.cs
- Task.cs
- DbDataSourceEnumerator.cs
- Message.cs
- SqlError.cs
- oledbmetadatacollectionnames.cs
- Button.cs
- SerializationException.cs
- ButtonBaseAdapter.cs
- TableParagraph.cs
- FaultContext.cs
- XmlSchemaCollection.cs
- SystemNetworkInterface.cs
- HyperLinkField.cs
- CompositionTarget.cs
- TextEditorLists.cs
- Int32CAMarshaler.cs
- Stacktrace.cs
- AnnotationMap.cs
- mda.cs
- SettingsPropertyValue.cs
- HostingPreferredMapPath.cs
- DataBinder.cs
- RegexTree.cs
- SID.cs
- IsolatedStorageFileStream.cs
- DataBinding.cs
- RecognizedWordUnit.cs
- safesecurityhelperavalon.cs
- KeyInstance.cs
- SecurityUtils.cs
- DataServiceRequestOfT.cs