OrientedElementExtensions Class
Provides extension methods for the type IOrientedElement.
public static class OrientedElementExtensions
- Inheritance:
- Object Object
Remarks
Many of the methods refer to the terms 'extent' and 'ascent'. For elements with horizontal orientation, the extent is along the x-axis and the the ascent is along the y-axis. Conversely, for elements with vertical orientation, the ascent is along the x-axis and the the extent is along the y-axis.
Methods
CreateSize(IOrientedElement, Double, Double)
Creates a Size comprised of the specified extent and ascent.
public static Size CreateSize(this IOrientedElement element, double extent, double ascent)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
extent | Double | The extent. |
ascent | Double | The ascent. |
Returns
Remarks
For horizontal orientation, the width will be the extent and the height will be the ascent. For vertical orientation, the width will be the ascent and the height will be the extent.
GetLocationAscent(IOrientedElement, Point)
Returns the location ascent of the specified Point, based on the orientation of the element.
public static double GetLocationAscent(this IOrientedElement element, Point location)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
location | Point | The Point to examine. |
Returns
Remarks
For horizontal orientation, the ascent will be the Y
value.
For vertical orientation, the ascent will be the X
value.
GetLocationAscent(IOrientedElement, Rect)
Returns the location ascent of the specified Rect, based on the orientation of the element.
public static double GetLocationAscent(this IOrientedElement element, Rect bounds)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
bounds | Rect | The Rect to examine. |
Returns
Remarks
For horizontal orientation, the ascent will be the Y
value.
For vertical orientation, the ascent will be the X
value.
GetLocationExtent(IOrientedElement, Point)
Returns the location extent of the specified Point, based on the orientation of the element.
public static double GetLocationExtent(this IOrientedElement element, Point location)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
location | Point | The Point to examine. |
Returns
Remarks
For horizontal orientation, the extent will be the X
value.
For vertical orientation, the extent will be the Y
value.
GetLocationExtent(IOrientedElement, Rect)
Returns the location extent of the specified Rect, based on the orientation of the element.
public static double GetLocationExtent(this IOrientedElement element, Rect bounds)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
bounds | Rect | The Rect to examine. |
Returns
Remarks
For horizontal orientation, the extent will be the X
value.
For vertical orientation, the extent will be the Y
value.
GetSizeAscent(IOrientedElement, Rect)
Returns the size ascent of the specified Rect, based on the orientation of the element.
public static double GetSizeAscent(this IOrientedElement element, Rect bounds)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
bounds | Rect | The Rect to examine. |
Returns
Remarks
For horizontal orientation, the ascent will be the height. For vertical orientation, the ascent will be the width.
GetSizeAscent(IOrientedElement, Size)
Returns the size ascent of the specified Size, based on the orientation of the element.
public static double GetSizeAscent(this IOrientedElement element, Size size)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
size | Size | The Size to examine. |
Returns
Remarks
For horizontal orientation, the ascent will be the height. For vertical orientation, the ascent will be the width.
GetSizeExtent(IOrientedElement, Rect)
Returns the size extent of the specified Rect, based on the orientation of the element.
public static double GetSizeExtent(this IOrientedElement element, Rect bounds)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
bounds | Rect | The Rect to examine. |
Returns
Remarks
For horizontal orientation, the extent will be the width. For vertical orientation, the extent will be the height.
GetSizeExtent(IOrientedElement, Size)
Returns the size extent of the specified Size, based on the orientation of the element.
public static double GetSizeExtent(this IOrientedElement element, Size size)
Parameter | Type | Description |
---|---|---|
element | IOrientedElement | The element with orientation to examine. |
size | Size | The Size to examine. |
Returns
Remarks
For horizontal orientation, the extent will be the width. For vertical orientation, the extent will be the height.