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
- FlowDocumentPaginator.cs
- TextParaLineResult.cs
- MasterPageCodeDomTreeGenerator.cs
- BitmapCodecInfo.cs
- ForceCopyBuildProvider.cs
- StylusPointDescription.cs
- WriteableBitmap.cs
- StringUtil.cs
- SecureEnvironment.cs
- SystemIPv4InterfaceProperties.cs
- TempEnvironment.cs
- sqlnorm.cs
- WorkflowFormatterBehavior.cs
- UrlMapping.cs
- Vector3DCollectionConverter.cs
- ToolStripItemImageRenderEventArgs.cs
- SoundPlayerAction.cs
- _PooledStream.cs
- ReferentialConstraintRoleElement.cs
- GridItemProviderWrapper.cs
- ActiveXSite.cs
- XmlUtil.cs
- GregorianCalendar.cs
- ColumnResizeAdorner.cs
- PeerMaintainer.cs
- BufferModeSettings.cs
- ShimAsPublicXamlType.cs
- AffineTransform3D.cs
- ExternalCalls.cs
- ReadOnlyHierarchicalDataSource.cs
- SpotLight.cs
- StringFormat.cs
- WebConvert.cs
- ProcessHostServerConfig.cs
- IisTraceListener.cs
- ArgIterator.cs
- FontInfo.cs
- LeafCellTreeNode.cs
- DoubleAnimationUsingKeyFrames.cs
- Int64AnimationBase.cs
- HyperlinkAutomationPeer.cs
- MatrixAnimationUsingKeyFrames.cs
- QueryAccessibilityHelpEvent.cs
- TreeNode.cs
- ConfigViewGenerator.cs
- CompilerError.cs
- OperationContext.cs
- WindowsFormsHost.cs
- SqlDataSourceCommandEventArgs.cs
- StringWriter.cs
- QuaternionRotation3D.cs
- DeploymentExceptionMapper.cs
- xml.cs
- TextSpanModifier.cs
- ContentFilePart.cs
- Config.cs
- MachineKeyConverter.cs
- FlowDocumentFormatter.cs
- StringValueSerializer.cs
- DrawingServices.cs
- XmlSchemaImport.cs
- Logging.cs
- WebPartVerb.cs
- GlyphInfoList.cs
- WebCodeGenerator.cs
- MenuRendererStandards.cs
- VoiceChangeEventArgs.cs
- ApplicationCommands.cs
- KeyTimeConverter.cs
- SecurityElement.cs
- ACE.cs
- TextElement.cs
- DataGridViewCheckBoxCell.cs
- RetrieveVirtualItemEventArgs.cs
- TypeExtension.cs
- ToolStripItemClickedEventArgs.cs
- UpdatePanel.cs
- PrePostDescendentsWalker.cs
- ArgumentException.cs
- StrongName.cs
- FastEncoderStatics.cs
- SqlRewriteScalarSubqueries.cs
- DataTemplateKey.cs
- TransactionContextManager.cs
- WindowsAuthenticationEventArgs.cs
- DataGridViewLinkColumn.cs
- CounterSampleCalculator.cs
- DataGridViewCellConverter.cs
- StretchValidation.cs
- Size3DValueSerializer.cs
- FixedSOMLineRanges.cs
- Misc.cs
- HealthMonitoringSectionHelper.cs
- LazyTextWriterCreator.cs
- DataObjectAttribute.cs
- DataGridColumnHeaderCollection.cs
- Base64Encoder.cs
- TileBrush.cs
- ToolboxItemCollection.cs
- SecureUICommand.cs