Share via


EditSpan Class

Describes an edit operation.

This API is not CLS-compliant. 

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.Package.EditSpan

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Class EditSpan
[CLSCompliantAttribute(false)]
public class EditSpan
[CLSCompliantAttribute(false)]
public ref class EditSpan
[<CLSCompliantAttribute(false)>]
type EditSpan =  class end
public class EditSpan

The EditSpan type exposes the following members.

Constructors

  Name Description
Public method EditSpan Initializes a new instance of the EditSpan class.

Top

Properties

  Name Description
Public property LengthOfLastLine Returns the length of the last line in the replacement text.
Public property LineCount Returns the number of lines in the replacement text.
Public property Span Determines the span to be replaced.
Public property Text Determines the replacement text.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

This class is used with the EditArray class to manage and apply edit operations. This class describes either a replacement or insertion operation, using a span and the new text. A deletion operation is a special case of a replacement where the replacement string is empty.

Replace Text

Set up a span that describes the text to replace and specify the text to replace with. When the edit operation is applied, the span is completely replaced by the new text.

Insert Text

Set up a span that describes the point of insertion but has no length; that is, the end point is the same as the start point. When the edit operation is applied, the new text is inserted at the specified point.

Delete Text

The delete operation is a special case of the replace operation. Set up a span that describes the text to delete and specify an empty string for the replacement text. When the edit operation is applied, the span is completely replaced by the new text, which in this case is an empty string. Since a span can describe multiple lines, whole lines can be deleted this way.

Notes to Implementers

This class contains all the functionality needed to describe an edit operation. There is no need to derive from this class.

Notes to Callers

Instantiate this class with a TextSpan object and a string to describe a single edit operation.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Package Namespace