Class WindowBounds
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Immutable window bounds information
public sealed record WindowBounds : IEquatable<WindowBounds>
- Inheritance
-
WindowBounds
- Implements
- Inherited Members
Constructors
WindowBounds(int, int, int, int)
Immutable window bounds information
public WindowBounds(int X, int Y, int Width, int Height)
Parameters
Properties
Bottom
Gets the bottom coordinate
public int Bottom { get; }
Property Value
Center
Gets the center point
public Point Center { get; }
Property Value
Height
The height
public int Height { get; init; }
Property Value
Left
Gets the left coordinate
public int Left { get; }
Property Value
Location
Gets the location
public Point Location { get; }
Property Value
Right
Gets the right coordinate
public int Right { get; }
Property Value
Size
Gets the size
public Size Size { get; }
Property Value
Top
Gets the top coordinate
public int Top { get; }
Property Value
Width
The width
public int Width { get; init; }
Property Value
X
The X coordinate
public int X { get; init; }
Property Value
Y
The Y coordinate
public int Y { get; init; }
Property Value
Methods
Contains(int, int)
Determines if this bounds contains the specified point
public bool Contains(int x, int y)
Parameters
Returns
- bool
True if the point is within these bounds
FromRectangle(Rectangle)
Creates a WindowBounds from a Rectangle
public static WindowBounds FromRectangle(Rectangle rectangle)
Parameters
rectangleRectangleThe rectangle
Returns
- WindowBounds
A WindowBounds instance
IntersectsWith(WindowBounds)
Determines if this bounds intersects with another bounds
public bool IntersectsWith(WindowBounds other)
Parameters
otherWindowBoundsThe other bounds
Returns
- bool
True if the bounds intersect
Offset(int, int)
Creates a new WindowBounds offset by the specified amount
public WindowBounds Offset(int deltaX, int deltaY)
Parameters
Returns
- WindowBounds
A new WindowBounds instance
ToRectangle()
Converts to a Rectangle
public Rectangle ToRectangle()
Returns
- Rectangle
A Rectangle representation
WithPosition(int, int)
Creates a new WindowBounds with the specified position
public WindowBounds WithPosition(int x, int y)
Parameters
Returns
- WindowBounds
A new WindowBounds instance
WithSize(int, int)
Creates a new WindowBounds with the specified size
public WindowBounds WithSize(int width, int height)
Parameters
Returns
- WindowBounds
A new WindowBounds instance