C# Class Open.Core.Common.EnumExtensions

Datei anzeigen Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
ConvertTo ( this sourceUnit, FileSizeUnit targetUnit, double value ) : double

Converts a file-size in the give unit to a different unit.

IsHorizontal ( this direction ) : bool

Gets whether the direction is horizontal.

IsVertical ( this direction ) : bool

Gets whether the direction is vertical.

ToBytes ( this unit, double value ) : double

Converts the given value to types.

ToString ( this unit, bool abbreviate ) : string

Converts the unit to it's display name.

ToString ( this unit, double value ) : string

Converts the unit to it's pluralized display name (the display name is long form, not abbreviated).

ToThickness ( this edges, int thickness = 1 ) : System.Windows.Thickness

Converts the given collection of edges to a thickness.

ToVisibility ( this isVisible ) : Visibility

Converts a boolean into a corresponding Visible or Collapsed value.

Method Details

ConvertTo() public static method

Converts a file-size in the give unit to a different unit.
public static ConvertTo ( this sourceUnit, FileSizeUnit targetUnit, double value ) : double
sourceUnit this The source unit the 'value' is currently in.
targetUnit FileSizeUnit The unit to convert to.
value double The file-size value to convert.
return double

IsHorizontal() public static method

Gets whether the direction is horizontal.
public static IsHorizontal ( this direction ) : bool
direction this The value to examine.
return bool

IsVertical() public static method

Gets whether the direction is vertical.
public static IsVertical ( this direction ) : bool
direction this The value to examine.
return bool

ToBytes() public static method

Converts the given value to types.
public static ToBytes ( this unit, double value ) : double
unit this The unit the value is currently in.
value double The value to convert.
return double

ToString() public static method

Converts the unit to it's display name.
public static ToString ( this unit, bool abbreviate ) : string
unit this The unit to convert.
abbreviate bool Flag indicating if the name should be abbreivated (eg. "KB") or not (eg. "Kilobyte").
return string

ToString() public static method

Converts the unit to it's pluralized display name (the display name is long form, not abbreviated).
public static ToString ( this unit, double value ) : string
unit this The unit to convert.
value double The file size value.
return string

ToThickness() public static method

Converts the given collection of edges to a thickness.
public static ToThickness ( this edges, int thickness = 1 ) : System.Windows.Thickness
edges this The collection of edges to include in the return Thickness.
thickness int The pixel width/height of the edges.
return System.Windows.Thickness

ToVisibility() public static method

Converts a boolean into a corresponding Visible or Collapsed value.
public static ToVisibility ( this isVisible ) : Visibility
isVisible this The boolean to convert.
return Visibility