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
- ColorPalette.cs
- WorkflowDefinitionDispenser.cs
- HideDisabledControlAdapter.cs
- EntityContainerAssociationSet.cs
- StringSource.cs
- LineInfo.cs
- RequestQueue.cs
- TextServicesCompartmentEventSink.cs
- MediaScriptCommandRoutedEventArgs.cs
- NotSupportedException.cs
- AdornerLayer.cs
- XpsColorContext.cs
- TreeNode.cs
- ObjectContextServiceProvider.cs
- RegexReplacement.cs
- WpfMemberInvoker.cs
- EntityDataSourceSelectedEventArgs.cs
- SafeViewOfFileHandle.cs
- StringFunctions.cs
- QueryInterceptorAttribute.cs
- XmlLanguage.cs
- BindingContext.cs
- QueryOperator.cs
- _AcceptOverlappedAsyncResult.cs
- DataRelationCollection.cs
- HttpRequestTraceRecord.cs
- SamlAttribute.cs
- FixedSOMPageElement.cs
- Activator.cs
- BamlRecordReader.cs
- TextBoxLine.cs
- ChangeToolStripParentVerb.cs
- StyleXamlTreeBuilder.cs
- ToolStripDropTargetManager.cs
- ArgumentException.cs
- Trace.cs
- BamlTreeUpdater.cs
- ParameterBuilder.cs
- InternalConfigRoot.cs
- PackageDigitalSignature.cs
- DateTimeUtil.cs
- TextCompositionManager.cs
- ZeroOpNode.cs
- PatternMatcher.cs
- xmlglyphRunInfo.cs
- Italic.cs
- Stylesheet.cs
- AutomationElementCollection.cs
- SessionEndingCancelEventArgs.cs
- DocumentDesigner.cs
- DataServiceRequestException.cs
- SafeFileMappingHandle.cs
- CommonRemoteMemoryBlock.cs
- HatchBrush.cs
- ActivationService.cs
- DataMemberAttribute.cs
- TagNameToTypeMapper.cs
- LogExtent.cs
- CollectionDataContract.cs
- RawStylusInputReport.cs
- StorageComplexPropertyMapping.cs
- HMACSHA384.cs
- ContentDesigner.cs
- EmbeddedMailObject.cs
- MemoryMappedFile.cs
- Method.cs
- UnauthorizedAccessException.cs
- DataGridCell.cs
- Update.cs
- Nullable.cs
- SQLUtility.cs
- StrokeCollectionDefaultValueFactory.cs
- BamlTreeNode.cs
- _DomainName.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- Funcletizer.cs
- WindowsIdentity.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- DataGridViewSortCompareEventArgs.cs
- Enlistment.cs
- HMACSHA512.cs
- MessageDescription.cs
- LayoutTableCell.cs
- FastEncoder.cs
- _NestedMultipleAsyncResult.cs
- TypeSystem.cs
- SQLResource.cs
- StateInitializationDesigner.cs
- SourceSwitch.cs
- ZipIOExtraFieldPaddingElement.cs
- CodeComment.cs
- FunctionQuery.cs
- SqlDataSourceCommandEventArgs.cs
- FontFamily.cs
- PnrpPeerResolver.cs
- Publisher.cs
- CustomValidator.cs
- DNS.cs
- InstanceNormalEvent.cs
- QuaternionConverter.cs