Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Keywords.cs
- LayoutUtils.cs
- DSACryptoServiceProvider.cs
- ValidationPropertyAttribute.cs
- FileEnumerator.cs
- RayMeshGeometry3DHitTestResult.cs
- CompilerWrapper.cs
- RectangleConverter.cs
- MetabaseSettings.cs
- ToolStripItemGlyph.cs
- WebPartHelpVerb.cs
- TypeConverterHelper.cs
- Schedule.cs
- EntitySqlException.cs
- Operand.cs
- DeviceSpecificChoiceCollection.cs
- CorrelationManager.cs
- SqlDataSourceRefreshSchemaForm.cs
- XmlIterators.cs
- EasingKeyFrames.cs
- EventBuilder.cs
- HttpCachePolicy.cs
- SqlHelper.cs
- SpeechDetectedEventArgs.cs
- Panel.cs
- ComponentDispatcher.cs
- TextContainerHelper.cs
- FindSimilarActivitiesVerb.cs
- DocumentPage.cs
- WeakReferenceEnumerator.cs
- RpcResponse.cs
- View.cs
- StorageMappingItemCollection.cs
- MatrixTransform.cs
- EntityDataSourceViewSchema.cs
- TabControlCancelEvent.cs
- OpenFileDialog.cs
- ColumnResult.cs
- InternalControlCollection.cs
- GridView.cs
- FunctionQuery.cs
- FontStyle.cs
- HtmlControl.cs
- DbParameterCollectionHelper.cs
- SQLGuidStorage.cs
- Converter.cs
- StreamingContext.cs
- UIElementParaClient.cs
- SQLDecimal.cs
- SimpleModelProvider.cs
- _HeaderInfo.cs
- _CookieModule.cs
- FigureParagraph.cs
- EdmValidator.cs
- ISFClipboardData.cs
- SerialReceived.cs
- InvalidWorkflowException.cs
- MdiWindowListStrip.cs
- StandardRuntimeEnumValidatorAttribute.cs
- RawKeyboardInputReport.cs
- DelayedRegex.cs
- IdentitySection.cs
- TabletCollection.cs
- TreeNode.cs
- DesignerRegion.cs
- XmlDesigner.cs
- DataKeyArray.cs
- HMACSHA256.cs
- PageHandlerFactory.cs
- VersionedStream.cs
- NonParentingControl.cs
- UdpDiscoveryMessageFilter.cs
- StorageFunctionMapping.cs
- GACIdentityPermission.cs
- FlagPanel.cs
- webproxy.cs
- NameValueSectionHandler.cs
- IdentityReference.cs
- ToggleButton.cs
- ServiceReference.cs
- ViewPort3D.cs
- DocumentPageHost.cs
- LogicalTreeHelper.cs
- SspiSecurityTokenProvider.cs
- ValidatedControlConverter.cs
- ClientSession.cs
- TimeManager.cs
- Hex.cs
- ContentPlaceHolder.cs
- Matrix.cs
- PathData.cs
- SerializableTypeCodeDomSerializer.cs
- PointValueSerializer.cs
- LinkLabelLinkClickedEvent.cs
- BrowserCapabilitiesFactory.cs
- TiffBitmapEncoder.cs
- UnsafeNativeMethods.cs
- DeviceFilterEditorDialog.cs
- NumericExpr.cs
- MatrixTransform3D.cs