Color legend plain property method
A small read-only struct with one value per side. It converts implicitly from an int and from tuples, so you rarely write new Margin(...):
A struct. The base element page shows it in context.
Names are colored by what they are: a property, a method or an event; values and fields keep the plain color.
Properties
Zero 🠆
Margin · Static, read-only. A margin of 0 on every side.
Fields
Bottom 🠆
int · Read-only field. The bottom margin.
Left 🠆
int · Read-only field. The left margin.
Right 🠆
int · Read-only field. The right margin.
Top 🠆
int · Read-only field. The top margin.
Methods
Margin() 🠆
Margin() · A margin of 0 on every side.
Margin(int all) · The same margin on every side.
| Parameter | Type | Description |
|---|---|---|
all |
int |
The value of every side, in units. |
Margin(int left = 0, int top = 0, int right = 0, int bottom = 0) · A margin per side; the sides left out are 0.
| Parameter | Type | Description |
|---|---|---|
left |
int |
The left side, in units. Default: 0. |
top |
int |
The top side, in units. Default: 0. |
right |
int |
The right side, in units. Default: 0. |
bottom |
int |
The bottom side, in units. Default: 0. |
implicit operator Margin(int all) · element.Margin = 5 sets 5 on every side.
| Parameter | Type | Description |
|---|---|---|
all |
int |
The value of every side. |
implicit operator Margin((int left, int top) tuple) · Left and top; right and bottom are 0.
| Parameter | Type | Description |
|---|---|---|
tuple |
(int left, int top) |
The sides it names, in order; the ones it leaves out are 0. |
implicit operator Margin((int left, int top, int right) tuple) · Left, top and right; bottom is 0.
| Parameter | Type | Description |
|---|---|---|
tuple |
(int left, int top, int right) |
The sides it names, in order; the ones it leaves out are 0. |
implicit operator Margin((int left, int top, int right, int bottom) tuple) · All four sides.
| Parameter | Type | Description |
|---|---|---|
tuple |
(int left, int top, int right, int bottom) |
The sides it names, in order; the ones it leaves out are 0. |
+() 🠆
operator +(Margin margin1, Margin margin2) · Adds the margins side by side.
| Parameter | Type | Description |
|---|---|---|
margin1 |
Margin |
The first margin. |
margin2 |
Margin |
The margin added to it, side by side. |
-() 🠆
operator -(Margin margin) · The margin with every side negated.
| Parameter | Type | Description |
|---|---|---|
margin |
Margin |
The margin to negate. |
operator -(Margin margin1, Margin margin2) · Subtracts the second margin from the first, side by side.
| Parameter | Type | Description |
|---|---|---|
margin1 |
Margin |
The margin to subtract from. |
margin2 |
Margin |
The margin subtracted, side by side. |
==() 🠆
operator ==(Margin margin1, Margin margin2) · True when all four sides are equal. != is the opposite.
| Parameter | Type | Description |
|---|---|---|
margin1 |
Margin |
The first margin. |
margin2 |
Margin |
The second margin. |
Equals() 🠆
Equals(Margin other) · True when all four sides are equal (Equals(object) as well, for another Margin).
| Parameter | Type | Description |
|---|---|---|
other |
Margin |
The margin to compare with. |
GetHashCode() 🠆
GetHashCode() · A hash of the four sides.
ToString() 🠆
ToString() · The sides as text, for example L: 10 R: 30 T: 20 B: 40.