C# Class SourceGrid.Range

ファイルを表示 Open project: zhuangyy/Motion Class Usage Examples

Public Properties

Property Type Description
Empty Range

Public Methods

Method Description
Contains ( Position p_Position ) : bool

Returns true if the specified cell position is present in the current range.

Contains ( Range p_Range ) : bool

Returns true if the specified range is present in the current range.

ContainsColumn ( int p_Col ) : bool

Returns true if the specified column is present in the current range.

ContainsRow ( int p_Row ) : bool

Returns true if the specified row is present in the current range.

Equals ( Range p_Range ) : bool

Equals ( object obj ) : bool

Exclude ( Range range ) : RangeRegion

Return all the cells that don't intersect with the specified cells. (Remove the specified cells from the current cells ad returns the remaining cells)

GetBounds ( Range p_Range1, Range p_Range2 ) : Range

Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.

GetCellsPositions ( ) : PositionCollection

GetHashCode ( ) : int

Intersect ( Range p_Range ) : Range

Returns the intersection between the 2 Range. If one of the range is empty then the return is empty.

Intersect ( Range p_Range1, Range p_Range2 ) : Range

Returns the intersection between the 2 Range. If one of the range is empty then the return is empty.

IntersectsWith ( Range p_Range ) : bool

Returns true if the specified range intersects (one or more cells) with the current range. If one of the range is empty then the return is false.

IntersectsWith ( Range p_Range1, Range p_Range2 ) : bool

Returns true if the specified range intersects (one or more cells) with the current range. If one of the range is empty then the return is false.

IsEmpty ( ) : bool

Determines if the current range is empty

MoveTo ( Position p_StartPosition ) : void

Move the current range to the specified position, leaving the current ColumnsCount and RowsCount

Range ( Position p_SinglePosition ) : System

Construct a Range of a single cell

Range ( Position p_Start, Position p_End ) : System

Constructor

Range ( int p_StartRow, int p_StartCol, int p_EndRow, int p_EndCol ) : System

Constructor

ToString ( ) : string

Union ( Range p_Range1, Range p_Range2 ) : RangeRegion

Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.

operator ( ) : bool

Private Methods

Method Description
Normalize ( ) : void

Check and fix the range to always have Start smaller than End

Range ( ) : System
Range ( Position p_Start, Position p_End, bool p_bCheck ) : System

Method Details

Contains() public method

Returns true if the specified cell position is present in the current range.
public Contains ( Position p_Position ) : bool
p_Position Position
return bool

Contains() public method

Returns true if the specified range is present in the current range.
public Contains ( Range p_Range ) : bool
p_Range Range
return bool

ContainsColumn() public method

Returns true if the specified column is present in the current range.
public ContainsColumn ( int p_Col ) : bool
p_Col int
return bool

ContainsRow() public method

Returns true if the specified row is present in the current range.
public ContainsRow ( int p_Row ) : bool
p_Row int
return bool

Equals() public method

public Equals ( Range p_Range ) : bool
p_Range Range
return bool

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

Exclude() public method

Return all the cells that don't intersect with the specified cells. (Remove the specified cells from the current cells ad returns the remaining cells)
public Exclude ( Range range ) : RangeRegion
range Range
return RangeRegion

GetBounds() public static method

Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.
public static GetBounds ( Range p_Range1, Range p_Range2 ) : Range
p_Range1 Range
p_Range2 Range
return Range

GetCellsPositions() public method

public GetCellsPositions ( ) : PositionCollection
return PositionCollection

GetHashCode() public method

public GetHashCode ( ) : int
return int

Intersect() public method

Returns the intersection between the 2 Range. If one of the range is empty then the return is empty.
public Intersect ( Range p_Range ) : Range
p_Range Range
return Range

Intersect() public static method

Returns the intersection between the 2 Range. If one of the range is empty then the return is empty.
public static Intersect ( Range p_Range1, Range p_Range2 ) : Range
p_Range1 Range
p_Range2 Range
return Range

IntersectsWith() public method

Returns true if the specified range intersects (one or more cells) with the current range. If one of the range is empty then the return is false.
public IntersectsWith ( Range p_Range ) : bool
p_Range Range
return bool

IntersectsWith() public static method

Returns true if the specified range intersects (one or more cells) with the current range. If one of the range is empty then the return is false.
public static IntersectsWith ( Range p_Range1, Range p_Range2 ) : bool
p_Range1 Range
p_Range2 Range
return bool

IsEmpty() public method

Determines if the current range is empty
public IsEmpty ( ) : bool
return bool

MoveTo() public method

Move the current range to the specified position, leaving the current ColumnsCount and RowsCount
public MoveTo ( Position p_StartPosition ) : void
p_StartPosition Position
return void

Range() public method

Construct a Range of a single cell
public Range ( Position p_SinglePosition ) : System
p_SinglePosition Position
return System

Range() public method

Constructor
public Range ( Position p_Start, Position p_End ) : System
p_Start Position
p_End Position
return System

Range() public method

Constructor
public Range ( int p_StartRow, int p_StartCol, int p_EndRow, int p_EndCol ) : System
p_StartRow int
p_StartCol int
p_EndRow int
p_EndCol int
return System

ToString() public method

public ToString ( ) : string
return string

Union() public static method

Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.
public static Union ( Range p_Range1, Range p_Range2 ) : RangeRegion
p_Range1 Range
p_Range2 Range
return RangeRegion

operator() public static method

public static operator ( ) : bool
return bool

Property Details

Empty public_oe static_oe property

Represents an empty range
public static Range,SourceGrid Empty
return Range