C# Class Microsoft.Languages.Core.Text.TextRange

Inheritance: IExpandableTextRange, ICloneable
Show file Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
AreEqual ( ITextRange left, ITextRange right ) : bool

Determines if ranges are equal. Ranges are equal when they are either both null or both are not null and their coordinates are equal.

Clone ( ) : object

Creates copy of the text range object via memberwise cloning

Contains ( ITextRange range ) : bool

Determines if text range fully contains another range

Contains ( ITextRange range, ITextRange other ) : bool

Determines if range contains another range

Contains ( ITextRange range, ITextRange other, bool inclusiveEnd ) : bool

Determines if range contains another range

Contains ( ITextRange range, int position ) : bool

Determines if range contains given position

Contains ( int position ) : bool

Determines if range contains given position

Contains ( int rangeStart, int rangeLength, int position ) : bool

Determines if range contains given position

ContainsInclusiveEnd ( ITextRange range, ITextRange other ) : bool

Determines if range contains another range or it contains start point of the other range and their end points are the same.

ContainsUsingInclusion ( int position ) : bool

Determines if range contains given position

Expand ( int startOffset, int endOffset ) : void
Intersect ( ITextRange range ) : bool

Finds out of range intersects another range

Intersect ( ITextRange range1, ITextRange range2 ) : bool

Finds out if range intersects another range

Intersect ( ITextRange range1, int rangeStart2, int rangeLength2 ) : bool

Finds out if range intersects another range

Intersect ( int start, int length ) : bool

Finds out of range intersects another range

Intersect ( int rangeStart1, int rangeLength1, int rangeStart2, int rangeLength2 ) : bool

Finds out if range intersects another range

Intersection ( ITextRange range1, ITextRange range2 ) : ITextRange

Calculates range that is an intersection of the supplied ranges.

Intersection ( ITextRange range1, int rangeStart, int rangeLength ) : ITextRange

Calculates range that is an intersection of the supplied ranges.

IsValid ( ) : bool

Finds out if range represents valid text range (it's length is greater than zero)

IsValid ( ITextRange range ) : bool

Finds out if range represents valid text range (when range is not null and it's length is greater than zero)

TextRange ( ITextRange range ) : System

Creates text range based on another text range

TextRange ( int position ) : System

Creates text range starting at given position and length of zero.

Union ( ITextRange range1, ITextRange range2 ) : ITextRange

Calculates range that includes both supplied ranges.

Union ( ITextRange range1, int rangeStart, int rangeLength ) : ITextRange

Calculates range that includes both supplied ranges.

Private Methods

Method Description
Empty ( ) : void
FromBounds ( int start, int end ) : TextRange
Shift ( int offset ) : void
TextRange ( ) : System
TextRange ( int start, int length ) : System
ToString ( ) : string

Method Details

AreEqual() public static method

Determines if ranges are equal. Ranges are equal when they are either both null or both are not null and their coordinates are equal.
public static AreEqual ( ITextRange left, ITextRange right ) : bool
left ITextRange First range
right ITextRange Second range
return bool

Clone() public method

Creates copy of the text range object via memberwise cloning
public Clone ( ) : object
return object

Contains() public method

Determines if text range fully contains another range
public Contains ( ITextRange range ) : bool
range ITextRange
return bool

Contains() public static method

Determines if range contains another range
public static Contains ( ITextRange range, ITextRange other ) : bool
range ITextRange
other ITextRange
return bool

Contains() public static method

Determines if range contains another range
public static Contains ( ITextRange range, ITextRange other, bool inclusiveEnd ) : bool
range ITextRange
other ITextRange
inclusiveEnd bool
return bool

Contains() public static method

Determines if range contains given position
public static Contains ( ITextRange range, int position ) : bool
range ITextRange Text range
position int Position
return bool

Contains() public method

Determines if range contains given position
public Contains ( int position ) : bool
position int
return bool

Contains() public static method

Determines if range contains given position
public static Contains ( int rangeStart, int rangeLength, int position ) : bool
rangeStart int Start of the text range
rangeLength int Length of the text range
position int Position
return bool

ContainsInclusiveEnd() public static method

Determines if range contains another range or it contains start point of the other range and their end points are the same.
public static ContainsInclusiveEnd ( ITextRange range, ITextRange other ) : bool
range ITextRange
other ITextRange
return bool

ContainsUsingInclusion() public method

Determines if range contains given position
public ContainsUsingInclusion ( int position ) : bool
position int
return bool

Expand() public method

public Expand ( int startOffset, int endOffset ) : void
startOffset int
endOffset int
return void

Intersect() public method

Finds out of range intersects another range
public Intersect ( ITextRange range ) : bool
range ITextRange
return bool

Intersect() public static method

Finds out if range intersects another range
public static Intersect ( ITextRange range1, ITextRange range2 ) : bool
range1 ITextRange First text range
range2 ITextRange Second text range
return bool

Intersect() public static method

Finds out if range intersects another range
public static Intersect ( ITextRange range1, int rangeStart2, int rangeLength2 ) : bool
range1 ITextRange
rangeStart2 int Start of the second range
rangeLength2 int Length of the second range
return bool

Intersect() public method

Finds out of range intersects another range
public Intersect ( int start, int length ) : bool
start int Start of another range
length int Length of another range
return bool

Intersect() public static method

Finds out if range intersects another range
public static Intersect ( int rangeStart1, int rangeLength1, int rangeStart2, int rangeLength2 ) : bool
rangeStart1 int Start of the first range
rangeLength1 int Length of the first range
rangeStart2 int Start of the second range
rangeLength2 int Length of the second range
return bool

Intersection() public static method

Calculates range that is an intersection of the supplied ranges.
public static Intersection ( ITextRange range1, ITextRange range2 ) : ITextRange
range1 ITextRange
range2 ITextRange
return ITextRange

Intersection() public static method

Calculates range that is an intersection of the supplied ranges.
public static Intersection ( ITextRange range1, int rangeStart, int rangeLength ) : ITextRange
range1 ITextRange
rangeStart int
rangeLength int
return ITextRange

IsValid() public method

Finds out if range represents valid text range (it's length is greater than zero)
public IsValid ( ) : bool
return bool

IsValid() public static method

Finds out if range represents valid text range (when range is not null and it's length is greater than zero)
public static IsValid ( ITextRange range ) : bool
range ITextRange
return bool

TextRange() public method

Creates text range based on another text range
public TextRange ( ITextRange range ) : System
range ITextRange Text range to use as position source
return System

TextRange() public method

Creates text range starting at given position and length of zero.
public TextRange ( int position ) : System
position int Start position
return System

Union() public static method

Calculates range that includes both supplied ranges.
public static Union ( ITextRange range1, ITextRange range2 ) : ITextRange
range1 ITextRange
range2 ITextRange
return ITextRange

Union() public static method

Calculates range that includes both supplied ranges.
public static Union ( ITextRange range1, int rangeStart, int rangeLength ) : ITextRange
range1 ITextRange
rangeStart int
rangeLength int
return ITextRange