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
- ListViewGroup.cs
- Attribute.cs
- Soap.cs
- MDIControlStrip.cs
- MasterPageParser.cs
- DragDropManager.cs
- PageCodeDomTreeGenerator.cs
- DesignerVerb.cs
- HandlerFactoryWrapper.cs
- DynamicILGenerator.cs
- ProfileService.cs
- oledbconnectionstring.cs
- BaseAsyncResult.cs
- DataRowCollection.cs
- Vector3D.cs
- dataobject.cs
- DragEvent.cs
- Calendar.cs
- BooleanAnimationUsingKeyFrames.cs
- XmlValidatingReaderImpl.cs
- InputGestureCollection.cs
- DoubleAnimationBase.cs
- sqlnorm.cs
- BinaryReader.cs
- HttpWebRequest.cs
- StylusShape.cs
- TagPrefixInfo.cs
- StrokeFIndices.cs
- DiscoveryOperationContextExtension.cs
- _ChunkParse.cs
- Util.cs
- PickDesigner.xaml.cs
- DefaultEventAttribute.cs
- ComponentDispatcher.cs
- ComPersistableTypeElement.cs
- NotifyInputEventArgs.cs
- SqlDependencyListener.cs
- TraceUtility.cs
- ObsoleteAttribute.cs
- DbConnectionHelper.cs
- ChannelSinkStacks.cs
- JavaScriptString.cs
- SerializationException.cs
- XmlNamespaceDeclarationsAttribute.cs
- InfoCardKeyedHashAlgorithm.cs
- ListSortDescription.cs
- PageContent.cs
- TemplateEditingVerb.cs
- ConfigXmlCDataSection.cs
- SmtpDigestAuthenticationModule.cs
- AmbientValueAttribute.cs
- OverflowException.cs
- XamlTemplateSerializer.cs
- HWStack.cs
- MouseGestureValueSerializer.cs
- EmptyEnumerable.cs
- CodeCatchClauseCollection.cs
- TableCell.cs
- StreamSecurityUpgradeAcceptor.cs
- UpdatePanel.cs
- Utils.cs
- NullExtension.cs
- CryptoHandle.cs
- ToolStripOverflowButton.cs
- PathParser.cs
- XhtmlBasicCommandAdapter.cs
- FrameworkElementFactory.cs
- MeshGeometry3D.cs
- RegistrationServices.cs
- VariableQuery.cs
- DiscoveryClientReferences.cs
- RoutedEventValueSerializer.cs
- DSACryptoServiceProvider.cs
- PermissionListSet.cs
- RelatedEnd.cs
- DataServiceRequestException.cs
- GlobalProxySelection.cs
- CodeDomSerializerBase.cs
- XamlStream.cs
- WorkflowViewService.cs
- ServicePoint.cs
- PrinterSettings.cs
- TimeIntervalCollection.cs
- IconConverter.cs
- mactripleDES.cs
- HtmlHead.cs
- MediaPlayer.cs
- FocusManager.cs
- RepeaterItemEventArgs.cs
- LogSwitch.cs
- Size.cs
- OracleCommand.cs
- WSSecurityTokenSerializer.cs
- StylusCollection.cs
- ComponentDispatcher.cs
- PowerEase.cs
- CryptoKeySecurity.cs
- CodePageUtils.cs
- CollectionView.cs
- CultureTable.cs