Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- AsymmetricKeyExchangeDeformatter.cs
- MessageDescription.cs
- BaseProcessor.cs
- NotifyIcon.cs
- CompilerErrorCollection.cs
- TextHidden.cs
- HtmlForm.cs
- SmiConnection.cs
- TableLayoutPanelCellPosition.cs
- SourceFileBuildProvider.cs
- HTMLTagNameToTypeMapper.cs
- CngProperty.cs
- GifBitmapDecoder.cs
- BuiltInPermissionSets.cs
- CompiledAction.cs
- XmlQualifiedNameTest.cs
- DiscoveryClientChannelBase.cs
- EntityDataSourceStatementEditorForm.cs
- BindingManagerDataErrorEventArgs.cs
- CheckBoxList.cs
- PageStatePersister.cs
- MetadataUtil.cs
- LineServicesCallbacks.cs
- SetIndexBinder.cs
- ServiceProviders.cs
- WebPartEditorApplyVerb.cs
- Identifier.cs
- PaperSource.cs
- LazyTextWriterCreator.cs
- listitem.cs
- EncoderNLS.cs
- RequestStatusBarUpdateEventArgs.cs
- ConfigXmlComment.cs
- Enum.cs
- ForeignKeyFactory.cs
- PageCodeDomTreeGenerator.cs
- TableRowCollection.cs
- CertificateManager.cs
- PointConverter.cs
- XmlQuerySequence.cs
- BindingValueChangedEventArgs.cs
- ChameleonKey.cs
- InputProcessorProfiles.cs
- CharUnicodeInfo.cs
- VarRemapper.cs
- RequestQueue.cs
- ContentControl.cs
- TableLayoutSettingsTypeConverter.cs
- X509DefaultServiceCertificateElement.cs
- QueryCacheKey.cs
- Transform3DGroup.cs
- ApplicationContext.cs
- Pair.cs
- WinFormsSpinner.cs
- TextTreeFixupNode.cs
- LinkTarget.cs
- DocumentXmlWriter.cs
- WebPartDeleteVerb.cs
- MemoryMappedView.cs
- CustomError.cs
- ToolStripControlHost.cs
- FillBehavior.cs
- XmlIlTypeHelper.cs
- StdValidatorsAndConverters.cs
- DetailsViewModeEventArgs.cs
- DataReaderContainer.cs
- DetailsViewDeletedEventArgs.cs
- UserControl.cs
- _ProxyChain.cs
- Int32Storage.cs
- SiteOfOriginContainer.cs
- DataIdProcessor.cs
- ConsumerConnectionPoint.cs
- X509Certificate.cs
- Stroke2.cs
- SiblingIterators.cs
- FileReservationCollection.cs
- SQLDouble.cs
- DocobjHost.cs
- EventProxy.cs
- PackageStore.cs
- TextTreeRootTextBlock.cs
- BamlWriter.cs
- Int32KeyFrameCollection.cs
- RealizationContext.cs
- EventMappingSettingsCollection.cs
- TemplateControlParser.cs
- XmlDictionaryWriter.cs
- XmlDictionaryReader.cs
- UpDownEvent.cs
- EntityViewGenerator.cs
- FileSystemEventArgs.cs
- ContainerFilterService.cs
- DesignerVerbToolStripMenuItem.cs
- RuntimeEnvironment.cs
- TriggerActionCollection.cs
- WindowsAuthenticationModule.cs
- XsdDuration.cs
- OrderedDictionary.cs
- SettingsPropertyWrongTypeException.cs