Struct Margin
Margin struct
Namespace
Syntax
public struct Margin
Constructors
Margin(int, int, int, int, int, int)
Makes a new margin instance
Declaration
public Margin(int left, int top, int right, int bottom, int width, int height)
Parameters
| Name | Type | Description |
|---|---|---|
| left | int | A left margin |
| top | int | A top margin |
| right | int | A right margin |
| bottom | int | A bottom margin |
| width | int | Width to subtract from to get margins |
| height | int | Height to subtract from to get margins |
Margin(HorizontalPad, VerticalPad, int, int)
Makes a new margin instance
Declaration
public Margin(HorizontalPad horizontalMargin, VerticalPad verticalMargin, int width, int height)
Parameters
| Name | Type | Description |
|---|---|---|
| horizontalMargin | HorizontalPad | Horizontal margin |
| verticalMargin | VerticalPad | Vertical margin |
| width | int | Width to subtract from to get margins |
| height | int | Height to subtract from to get margins |
Margin(Padding, int, int)
Makes a new margin instance
Declaration
public Margin(Padding margins, int width, int height)
Parameters
| Name | Type | Description |
|---|---|---|
| margins | Padding | Margins |
| width | int | Width to subtract from to get margins |
| height | int | Height to subtract from to get margins |
Properties
Height
Gets the final height with margins applied
Property Value
int
Declaration
public readonly int Height { get; }
Margins
Gets the margin values
Width
Gets the final width with margins applied
Property Value
int
Declaration
public readonly int Width { get; }
Methods
Equals(object?)
Returns
bool
Declaration
public override bool Equals(object? obj)
Parameters
| Name | Type | Description |
|---|---|---|
| obj | object |
Overrides
System.ValueType.Equals(object)
Equals(Margin)
Returns
bool
Declaration
public bool Equals(Margin other)
Parameters
| Name | Type | Description |
|---|---|---|
| other | Margin |
GetHashCode()
Returns
int
Declaration
public override int GetHashCode()
Overrides
System.ValueType.GetHashCode()
ToString()
Generates a string containing margin values
Returns
string
Margin values in a string
Declaration
public override string ToString()
Overrides
System.ValueType.ToString()
Operators
operator ==(Margin, Margin)
Returns
bool
Declaration
public static bool operator ==(Margin left, Margin right)
Parameters
| Name | Type | Description |
|---|---|---|
| left | Margin | |
| right | Margin |