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
- Ppl.cs
- LockRecursionException.cs
- TreeBuilderXamlTranslator.cs
- XmlTextReaderImpl.cs
- RemotingSurrogateSelector.cs
- SslStreamSecurityUpgradeProvider.cs
- WebPartDeleteVerb.cs
- FullTrustAssembliesSection.cs
- Guid.cs
- AncillaryOps.cs
- DesignerDataConnection.cs
- InstanceLockException.cs
- UpdateRecord.cs
- MouseGestureValueSerializer.cs
- RadioButtonFlatAdapter.cs
- DataGridViewCellValidatingEventArgs.cs
- __Error.cs
- AutomationPropertyInfo.cs
- EntityDataSourceChangedEventArgs.cs
- MSAAEventDispatcher.cs
- RegionInfo.cs
- PriorityItem.cs
- Point4DValueSerializer.cs
- ToolStripPanelRow.cs
- GridLengthConverter.cs
- ClientCredentialsSecurityTokenManager.cs
- GrammarBuilder.cs
- QueryContinueDragEventArgs.cs
- ClientBuildManager.cs
- Zone.cs
- ToggleButton.cs
- NamedElement.cs
- DES.cs
- TreeViewDesigner.cs
- Overlapped.cs
- ContainerParagraph.cs
- PeerResolver.cs
- PersonalizationDictionary.cs
- UnitySerializationHolder.cs
- BitmapMetadataEnumerator.cs
- SrgsRule.cs
- ClientSideQueueItem.cs
- SafeNativeMethods.cs
- ObjectResult.cs
- XmlNotation.cs
- BroadcastEventHelper.cs
- MultiViewDesigner.cs
- Effect.cs
- ApplicationActivator.cs
- CodeAssignStatement.cs
- Base64Decoder.cs
- ButtonBase.cs
- Int64AnimationBase.cs
- HtmlHead.cs
- Keywords.cs
- SqlDataSourceCommandEventArgs.cs
- ConfigDefinitionUpdates.cs
- SwitchElementsCollection.cs
- BaseDataList.cs
- ReverseInheritProperty.cs
- DelegateSerializationHolder.cs
- PrePrepareMethodAttribute.cs
- RecordsAffectedEventArgs.cs
- StorageScalarPropertyMapping.cs
- TextEffectCollection.cs
- XamlValidatingReader.cs
- BypassElement.cs
- PolicyStatement.cs
- Size.cs
- DiscoveryDocumentSerializer.cs
- TypedElement.cs
- HostingEnvironmentException.cs
- CqlQuery.cs
- KeyboardNavigation.cs
- COM2Enum.cs
- Polyline.cs
- AuthenticationConfig.cs
- Set.cs
- AssertFilter.cs
- DataGridViewSelectedRowCollection.cs
- StringOutput.cs
- Listbox.cs
- ToolTipService.cs
- AutoFocusStyle.xaml.cs
- SmtpNegotiateAuthenticationModule.cs
- StackOverflowException.cs
- DesignerListAdapter.cs
- _HeaderInfoTable.cs
- DtdParser.cs
- TextStore.cs
- _LoggingObject.cs
- BackStopAuthenticationModule.cs
- ContentType.cs
- FormViewAutoFormat.cs
- NativeCompoundFileAPIs.cs
- IDictionary.cs
- CrossSiteScriptingValidation.cs
- HttpValueCollection.cs
- DragCompletedEventArgs.cs
- UIElement.cs