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
- KeyBinding.cs
- ApplicationHost.cs
- ClientSettingsProvider.cs
- MarshalByValueComponent.cs
- MulticastDelegate.cs
- PeerNameRecord.cs
- VerticalAlignConverter.cs
- NumberFormatInfo.cs
- OleDbPermission.cs
- RelationshipEntry.cs
- OutputCacheModule.cs
- _TimerThread.cs
- DllNotFoundException.cs
- FileUpload.cs
- ModelTreeManager.cs
- SerializationException.cs
- TextTrailingCharacterEllipsis.cs
- EntityCollection.cs
- HandoffBehavior.cs
- StreamResourceInfo.cs
- Error.cs
- AdRotator.cs
- DataControlButton.cs
- WindowsAuthenticationModule.cs
- PagedDataSource.cs
- MaterialGroup.cs
- XmlDataSourceView.cs
- rsa.cs
- DataExpression.cs
- RightsDocument.cs
- ControlIdConverter.cs
- BuildProvidersCompiler.cs
- OutgoingWebRequestContext.cs
- ContentPropertyAttribute.cs
- AppSettingsSection.cs
- uribuilder.cs
- XmlnsDefinitionAttribute.cs
- OnOperation.cs
- IndexingContentUnit.cs
- DataSysAttribute.cs
- FormViewUpdatedEventArgs.cs
- NullableLongSumAggregationOperator.cs
- DependencyPropertyAttribute.cs
- XamlVector3DCollectionSerializer.cs
- InfoCardRSACryptoProvider.cs
- SafeBitVector32.cs
- GreenMethods.cs
- SafeNativeMethodsOther.cs
- PropertyPanel.cs
- ResXDataNode.cs
- ConfigurationManagerInternalFactory.cs
- SystemDiagnosticsSection.cs
- SelectionItemProviderWrapper.cs
- TextFormattingConverter.cs
- OleDbConnectionInternal.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Material.cs
- CompilerWrapper.cs
- TabletDevice.cs
- TypeUnloadedException.cs
- Transform.cs
- IdleTimeoutMonitor.cs
- Pair.cs
- Monitor.cs
- WmlLinkAdapter.cs
- X509ClientCertificateAuthenticationElement.cs
- InfoCardRSACryptoProvider.cs
- FastPropertyAccessor.cs
- SimplePropertyEntry.cs
- WebPartsPersonalizationAuthorization.cs
- HtmlInputRadioButton.cs
- MetadataItemEmitter.cs
- EarlyBoundInfo.cs
- BamlLocalizabilityResolver.cs
- _SSPISessionCache.cs
- ToolTip.cs
- ProviderConnectionPointCollection.cs
- XhtmlTextWriter.cs
- COAUTHIDENTITY.cs
- versioninfo.cs
- OdbcEnvironment.cs
- LinqDataSourceView.cs
- ItemCollection.cs
- FocusChangedEventArgs.cs
- AssertSection.cs
- WindowsBrush.cs
- MarkupCompilePass1.cs
- ClientTarget.cs
- CacheAxisQuery.cs
- XmlNodeList.cs
- SiteMapProvider.cs
- Stack.cs
- HtmlInputFile.cs
- BrowserTree.cs
- PropertyInfo.cs
- TypeLibConverter.cs
- DataServiceQueryProvider.cs
- XMLSyntaxException.cs
- ConditionalAttribute.cs
- OutputScope.cs