Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CustomValidator.cs
- QueryCacheEntry.cs
- XmlException.cs
- ToolStripMenuItemDesigner.cs
- WaitHandleCannotBeOpenedException.cs
- XmlDeclaration.cs
- Stack.cs
- BamlTreeMap.cs
- EntityCommand.cs
- DispatcherObject.cs
- ListViewCommandEventArgs.cs
- Subset.cs
- DataGridTablesFactory.cs
- Fonts.cs
- ConfigXmlReader.cs
- rsa.cs
- MetadataItemEmitter.cs
- InputScopeAttribute.cs
- XmlSchemaException.cs
- ResourceReader.cs
- SQLByteStorage.cs
- PromptEventArgs.cs
- DesignerActionMethodItem.cs
- ObjectListComponentEditor.cs
- WebPartDisplayModeEventArgs.cs
- RichTextBoxContextMenu.cs
- SspiWrapper.cs
- regiisutil.cs
- Schedule.cs
- EncoderNLS.cs
- SelectedDatesCollection.cs
- Highlights.cs
- Point4D.cs
- Clock.cs
- EditorZone.cs
- PersonalizationProviderCollection.cs
- BufferedOutputStream.cs
- HttpPostProtocolReflector.cs
- BinaryObjectInfo.cs
- ToolStripOverflow.cs
- PeerNearMe.cs
- MobileControlsSectionHelper.cs
- XmlNotation.cs
- initElementDictionary.cs
- MsmqDiagnostics.cs
- LinkClickEvent.cs
- Automation.cs
- SecondaryViewProvider.cs
- WindowClosedEventArgs.cs
- CompositeFontParser.cs
- PartialTrustVisibleAssemblyCollection.cs
- GuidTagList.cs
- ExtensibleClassFactory.cs
- PassportAuthenticationEventArgs.cs
- HttpBindingExtension.cs
- HtmlInputRadioButton.cs
- CaseStatement.cs
- WebPartConnectionsCancelVerb.cs
- _SSPISessionCache.cs
- DummyDataSource.cs
- ScrollEvent.cs
- OleDbErrorCollection.cs
- AdapterUtil.cs
- NullReferenceException.cs
- NonBatchDirectoryCompiler.cs
- CodeSnippetCompileUnit.cs
- SqlInfoMessageEvent.cs
- TcpSocketManager.cs
- OuterProxyWrapper.cs
- ListViewItemMouseHoverEvent.cs
- MenuItem.cs
- CompressEmulationStream.cs
- SqlDataSourceFilteringEventArgs.cs
- CellConstantDomain.cs
- Splitter.cs
- ToolStripScrollButton.cs
- hebrewshape.cs
- SystemThemeKey.cs
- Facet.cs
- QueryFunctions.cs
- AppDomainResourcePerfCounters.cs
- LocationUpdates.cs
- loginstatus.cs
- Parser.cs
- FlowDocumentPageViewerAutomationPeer.cs
- nulltextnavigator.cs
- DrawItemEvent.cs
- ApplicationContext.cs
- CryptoStream.cs
- TextOptionsInternal.cs
- TreeNodeSelectionProcessor.cs
- VSDExceptions.cs
- ListSourceHelper.cs
- OutOfMemoryException.cs
- EntityViewContainer.cs
- MetabaseSettingsIis7.cs
- FormView.cs
- TakeQueryOptionExpression.cs
- ContainsRowNumberChecker.cs
- HttpModulesSection.cs