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
- Keyboard.cs
- SafeReadContext.cs
- XPathNavigator.cs
- System.Data.OracleClient_BID.cs
- GridViewDeleteEventArgs.cs
- AsymmetricKeyExchangeDeformatter.cs
- PnrpPermission.cs
- WindowsRebar.cs
- StylusEventArgs.cs
- ResourceManagerWrapper.cs
- ParserHooks.cs
- HtmlInputFile.cs
- TiffBitmapDecoder.cs
- ClientTargetCollection.cs
- SystemBrushes.cs
- DataGridViewAccessibleObject.cs
- MultipleCopiesCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- CancellationHandler.cs
- Expr.cs
- KeyedHashAlgorithm.cs
- CodeCompiler.cs
- PreservationFileReader.cs
- ProviderUtil.cs
- SignedPkcs7.cs
- ListQueryResults.cs
- XhtmlConformanceSection.cs
- SoapFault.cs
- ReaderWriterLockWrapper.cs
- RadioButtonRenderer.cs
- GradientStop.cs
- StatusBar.cs
- BoundingRectTracker.cs
- DictionarySectionHandler.cs
- XmlReaderDelegator.cs
- EffectiveValueEntry.cs
- XmlChildEnumerator.cs
- _NegoStream.cs
- RequestCachePolicyConverter.cs
- CustomAssemblyResolver.cs
- PlatformCulture.cs
- BamlBinaryReader.cs
- DocumentXmlWriter.cs
- DataServiceHost.cs
- TimeZone.cs
- FlowDocumentFormatter.cs
- ChildChangedEventArgs.cs
- EmptyTextWriter.cs
- TransformConverter.cs
- SerializationInfo.cs
- MonthChangedEventArgs.cs
- DesignerProperties.cs
- SqlCachedBuffer.cs
- TrackingStringDictionary.cs
- AssociationTypeEmitter.cs
- WebPartsSection.cs
- RefExpr.cs
- WebBrowserNavigatedEventHandler.cs
- TakeOrSkipQueryOperator.cs
- WindowsFormsLinkLabel.cs
- NativeMethodsCLR.cs
- ClientSession.cs
- DataGridViewAdvancedBorderStyle.cs
- CommentAction.cs
- HttpHandlerAction.cs
- COM2PictureConverter.cs
- x509utils.cs
- InkCanvasSelection.cs
- QueryOutputWriter.cs
- ActivityMarkupSerializationProvider.cs
- Int64Animation.cs
- DesignSurface.cs
- TraceSwitch.cs
- DefaultTextStore.cs
- CodeEntryPointMethod.cs
- ELinqQueryState.cs
- PropertyChange.cs
- SqlProviderServices.cs
- EdmFunction.cs
- FormViewInsertedEventArgs.cs
- HttpValueCollection.cs
- Label.cs
- GPPOINTF.cs
- TemplatePropertyEntry.cs
- HttpHandlerAction.cs
- ClientScriptManager.cs
- GeneralTransform3D.cs
- ResourceKey.cs
- IssuedTokenParametersEndpointAddressElement.cs
- QuaternionRotation3D.cs
- SystemEvents.cs
- Listbox.cs
- HandlerWithFactory.cs
- Accessors.cs
- StreamResourceInfo.cs
- Utils.cs
- BigInt.cs
- RuntimeUtils.cs
- SqlCacheDependency.cs
- RuntimeHandles.cs