Class Margin
Describes the space around a control.
Inheritance
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class Margin : ValueType, IEquatable<Margin>, IFormattable
Constructors
Margin(Single)
Initializes a new instance of the Margin struct.
Declaration
public Margin(float value)
Parameters
System.Single
value
The value. |
Margin(Single, Single, Single, Single)
Initializes a new instance of the Margin struct.
Declaration
public Margin(float left, float right, float top, float bottom)
Parameters
System.Single
left
The left. |
System.Single
right
The right. |
System.Single
top
The top. |
System.Single
bottom
The bottom. |
Fields
Bottom
Holds the margin to the bottom.
Declaration
[EditorOrder(3)]
public float Bottom
Field Value
System.Single
|
Left
Holds the margin to the left.
Declaration
[EditorOrder(0)]
public float Left
Field Value
System.Single
|
Right
Holds the margin to the right.
Declaration
[EditorOrder(1)]
public float Right
Field Value
System.Single
|
SizeInBytes
The size of the Margin type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.Int32
|
Top
Holds the margin to the top.
Declaration
[EditorOrder(2)]
public float Top
Field Value
System.Single
|
Zero
A Margin with all of its components set to zero.
Declaration
public static readonly Margin Zero
Field Value
Margin
|
Properties
Height
Gets the height (top + bottom).
Declaration
public float Height { get; }
Property Value
System.Single
|
IsZero
Gets a value indicting whether this margin is zero.
Declaration
public bool IsZero { get; }
Property Value
System.Boolean
|
Location
Gets the margin's location (Left, Top).
Declaration
public Float2 Location { get; }
Property Value
Float2
|
Size
Gets the margin's total size. Cumulative margin size (Left + Right, Top + Bottom).
Declaration
public Float2 Size { get; }
Property Value
Float2
|
Width
Gets the width (left + right).
Declaration
public float Width { get; }
Property Value
System.Single
|
Methods
Equals(Margin)
Determines whether the specified Margin is equal to this instance.
Declaration
public bool Equals(Margin other)
Parameters
Margin
other
The Margin to compare with this instance. |
Returns
System.Boolean
|
Equals(ref Margin)
Determines whether the specified Margin is equal to this instance.
Declaration
public bool Equals(ref Margin other)
Parameters
Margin
other
The Margin to compare with this instance. |
Returns
System.Boolean
|
Equals(ref Margin, ref Margin)
Determines whether the specified Margin are equal.
Declaration
public static bool Equals(ref Margin a, ref Margin b)
Parameters
Margin
a
|
Margin
b
|
Returns
System.Boolean
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
System.Object
value
The System.Object to compare with this instance. |
Returns
System.Boolean
|
ExpandRectangle(ref Rectangle)
Expands the rectangle by this margin.
Declaration
public void ExpandRectangle(ref Rectangle rect)
Parameters
Rectangle
rect
The rectangle. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
ShrinkRectangle(ref Rectangle)
Shrinks the rectangle by this margin.
Declaration
public void ShrinkRectangle(ref Rectangle rect)
Parameters
Rectangle
rect
The rectangle. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
System.String
A System.String that represents this instance. |
ToString(IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
System.String
format
The format. |
Returns
System.String
A System.String that represents this instance. |
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System.String
format
The format. |
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
Operators
Addition(Margin, Margin)
Adds two margins.
Declaration
public static Margin operator +(Margin left, Margin right)
Parameters
Margin
left
The first margins to add. |
Margin
right
The second margins to add. |
Returns
Margin
The sum of the two margins. |
Equality(Margin, Margin)
Tests for equality between two objects.
Declaration
public static bool operator ==(Margin left, Margin right)
Parameters
Margin
left
The first value to compare. |
Margin
right
The second value to compare. |
Returns
System.Boolean
|
Inequality(Margin, Margin)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Margin left, Margin right)
Parameters
Margin
left
The first value to compare. |
Margin
right
The second value to compare. |
Returns
System.Boolean
|
Subtraction(Margin, Margin)
Subtracts two margins.
Declaration
public static Margin operator -(Margin left, Margin right)
Parameters
Margin
left
The first margins to subtract from. |
Margin
right
The second margins to subtract. |
Returns
Margin
The result of subtraction of the two margins. |