SnapshotPoint Structure

An immutable text position in a particular text snapshot.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

声明
Public Structure SnapshotPoint _
    Implements IComparable(Of SnapshotPoint)
public struct SnapshotPoint : IComparable<SnapshotPoint>
public value class SnapshotPoint : IComparable<SnapshotPoint>
[<Sealed>]
type SnapshotPoint =  
    struct
        interface IComparable<SnapshotPoint>
    end
JScript supports the use of structures, but not the declaration of new ones.

The SnapshotPoint type exposes the following members.

Constructors

  Name Description
Public method SnapshotPoint Initializes a new instance of a SnapshotPoint with respect to a particular snapshot and position.

Top

Properties

  Name Description
Public property Position Gets the position of the point.
Public property Snapshot Gets the ITextSnapshot to which this snapshot point refers.

Top

Methods

  Name Description
Public method Add Creates a new snapshot point at the specified offset from this point.
Public method CompareTo Determines whether this snapshot is the same as a second snapshot point.
Public method Difference Calculates the offset between this snapshot point and another snapshot point.
Public method Equals Determines whether this snapshot point is the same as a second snapshot point. (Overrides ValueType.Equals(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 GetChar Gets the character at the position of this snapshot point.
Public method GetContainingLine Gets the ITextSnapshotLine containing this snapshot point.
Public method GetHashCode Serves as a hash function for this type. (Overrides ValueType.GetHashCode().)
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 Subtract Creates a new snapshot point at the specified negative offset from this point.
Public method ToString Converts this snapshot point to a string. (Overrides ValueType.ToString().)
Public method TranslateTo Translates this snapshot point to a different snapshot of the same ITextBuffer.

Top

Operators

  Name Description
Public operatorStatic member Addition Increments the position of a snapshot point.
Public operatorStatic member Equality Determines whether this snapshot point is the same as a second snapshot point.
Public operatorStatic member GreaterThan Determines whether the position of one snapshot point is greater than the position of a second snapshot point.
Public operatorStatic member Implicit(SnapshotPoint to Int32) Implicitly converts the snapshot point to an integer equal to the position of the snapshot point in the snapshot.
Public operatorStatic member Inequality Determines whether this snapshot point is different from a second snapshot point.
Public operatorStatic member LessThan Determines whether the position of the left point is less than the position of the right point.
Public operatorStatic member Subtraction(SnapshotPoint, SnapshotPoint) Calculates the offset between two SnapshotPoint objects.
Public operatorStatic member Subtraction(SnapshotPoint, Int32) Decrements the position of a snapshot point.

Top

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.Text Namespace