C# Class RoomEditorApp.Util

Show file Open project: jeremytammik/RoomEditorApp

Public Properties

Property Type Description
SvgFlip bool

Public Methods

Method Description
AngleString ( double angle ) : string

Return a string representation in degrees for an angle given in radians.

BoundingBoxString ( BoundingBoxUV b ) : string

Return a string for a 2D bounding box formatted to two decimal places.

BoundingBoxString ( BoundingBoxXYZ b ) : string

Return a string for a 3D bounding box formatted to two decimal places.

BrowseDirectory ( string &path, bool allowCreate ) : bool
ConvertDegreesToRadians ( int d ) : double
ConvertFeetToMillimetres ( double d ) : int
ConvertMillimetresToFeet ( int d ) : double
ConvertRadiansToDegrees ( double d ) : int
CurveEndpointString ( Curve c ) : string

Return a string displaying the two XYZ endpoints of a geometry curve element.

CurveEndpointString2d ( Curve c ) : string

Return a string displaying only the XY values of the two XYZ endpoints of a geometry curve element.

DotOrColon ( int n ) : string

Return a dot (full stop) for zero or a colon for more than zero.

ElementDescription ( Element e ) : string

Return a string describing the given element: .NET type name, category name, family and symbol name for a family instance, element id and element name.

ErrorMsg ( string msg ) : void

Display an error message.

GetElementProperties ( Element e ) : string>.Dictionary

Return a dictionary of all the given element parameter names and values.

InfoMsg ( string msg ) : void

Display a short big message.

InfoMsg2 ( string instruction, string msg, bool prompt = true ) : void

Display a longer message in smaller font.

IsEqual ( double a, double b ) : bool
IsModifiable ( Parameter p ) : bool

Return a dictionary of all the given element parameter names and values.

IsSameOrSubclassOf ( Type a, Type b ) : bool

Return true if the type b is either a subclass of OR equal to the base class itself. IsSubclassOf returns false if the two types are the same. It only returns true for true non-equal subclasses.

IsZero ( double a ) : bool
IsZero ( double a, double tolerance ) : bool
Log ( string msg ) : void

Print a debug log message with a time stamp to the Visual Studio debug output window.

OutlineString ( Outline o ) : string

Return a string for an Outline formatted to two decimal places.

PluralString ( int n, string thing ) : string

Return an English pluralised string for the given thing or things. If the thing ends with 'y', the plural is assumes to end with 'ies', e.g. (2, 'chair') -- '2 chairs' (2, 'property') -- '2 properties' (2, 'furniture item') -- '2 furniture items' If in doubt, appending 'item' or 'entry' to the thing description is normally a pretty safe bet. Replaces calls to PluralSuffix and PluralSuffixY.

PluralSuffix ( int n ) : string

Return an English plural suffix for the given number of items, i.e. 's' for zero or more than one, and nothing for exactly one.

PluralSuffixY ( int n ) : string

Return an English plural suffix 'ies' or 'y' for the given number of items.

PointString ( UV p ) : string

Return a string for a UV point or vector with its coordinates formatted to two decimal places.

PointString ( XYZ p ) : string

Return a string for an XYZ point or vector with its coordinates formatted to two decimal places.

PointString2d ( XYZ p ) : string

Return a string for the XY values of an XYZ point or vector with its coordinates formatted to two decimal places.

RealString ( double a ) : string

Return a string for a real number formatted to two decimal places.

SheetDescription ( Element e ) : string

Return a string describing the given sheet: sheet number and name.

SvgFlipY ( int y ) : int

Flip Y coordinate for SVG export.

Uncapitalise ( string s ) : string

Uncapitalise string, i.e. lowercase its first character.

Method Details

AngleString() public static method

Return a string representation in degrees for an angle given in radians.
public static AngleString ( double angle ) : string
angle double
return string

BoundingBoxString() public static method

Return a string for a 2D bounding box formatted to two decimal places.
public static BoundingBoxString ( BoundingBoxUV b ) : string
b BoundingBoxUV
return string

BoundingBoxString() public static method

Return a string for a 3D bounding box formatted to two decimal places.
public static BoundingBoxString ( BoundingBoxXYZ b ) : string
b BoundingBoxXYZ
return string

BrowseDirectory() public static method

public static BrowseDirectory ( string &path, bool allowCreate ) : bool
path string
allowCreate bool
return bool

ConvertDegreesToRadians() public static method

public static ConvertDegreesToRadians ( int d ) : double
d int
return double

ConvertFeetToMillimetres() public static method

public static ConvertFeetToMillimetres ( double d ) : int
d double
return int

ConvertMillimetresToFeet() public static method

public static ConvertMillimetresToFeet ( int d ) : double
d int
return double

ConvertRadiansToDegrees() public static method

public static ConvertRadiansToDegrees ( double d ) : int
d double
return int

CurveEndpointString() public static method

Return a string displaying the two XYZ endpoints of a geometry curve element.
public static CurveEndpointString ( Curve c ) : string
c Curve
return string

CurveEndpointString2d() public static method

Return a string displaying only the XY values of the two XYZ endpoints of a geometry curve element.
public static CurveEndpointString2d ( Curve c ) : string
c Curve
return string

DotOrColon() public static method

Return a dot (full stop) for zero or a colon for more than zero.
public static DotOrColon ( int n ) : string
n int
return string

ElementDescription() public static method

Return a string describing the given element: .NET type name, category name, family and symbol name for a family instance, element id and element name.
public static ElementDescription ( Element e ) : string
e Element
return string

ErrorMsg() public static method

Display an error message.
public static ErrorMsg ( string msg ) : void
msg string
return void

GetElementProperties() public static method

Return a dictionary of all the given element parameter names and values.
public static GetElementProperties ( Element e ) : string>.Dictionary
e Element
return string>.Dictionary

InfoMsg() public static method

Display a short big message.
public static InfoMsg ( string msg ) : void
msg string
return void

InfoMsg2() public static method

Display a longer message in smaller font.
public static InfoMsg2 ( string instruction, string msg, bool prompt = true ) : void
instruction string
msg string
prompt bool
return void

IsEqual() public static method

public static IsEqual ( double a, double b ) : bool
a double
b double
return bool

IsModifiable() public static method

Return a dictionary of all the given element parameter names and values.
public static IsModifiable ( Parameter p ) : bool
p Parameter
return bool

IsSameOrSubclassOf() public static method

Return true if the type b is either a subclass of OR equal to the base class itself. IsSubclassOf returns false if the two types are the same. It only returns true for true non-equal subclasses.
public static IsSameOrSubclassOf ( Type a, Type b ) : bool
a System.Type
b System.Type
return bool

IsZero() public static method

public static IsZero ( double a ) : bool
a double
return bool

IsZero() public static method

public static IsZero ( double a, double tolerance ) : bool
a double
tolerance double
return bool

Log() public static method

Print a debug log message with a time stamp to the Visual Studio debug output window.
public static Log ( string msg ) : void
msg string
return void

OutlineString() public static method

Return a string for an Outline formatted to two decimal places.
public static OutlineString ( Outline o ) : string
o Outline
return string

PluralString() public static method

Return an English pluralised string for the given thing or things. If the thing ends with 'y', the plural is assumes to end with 'ies', e.g. (2, 'chair') -- '2 chairs' (2, 'property') -- '2 properties' (2, 'furniture item') -- '2 furniture items' If in doubt, appending 'item' or 'entry' to the thing description is normally a pretty safe bet. Replaces calls to PluralSuffix and PluralSuffixY.
public static PluralString ( int n, string thing ) : string
n int
thing string
return string

PluralSuffix() public static method

Return an English plural suffix for the given number of items, i.e. 's' for zero or more than one, and nothing for exactly one.
public static PluralSuffix ( int n ) : string
n int
return string

PluralSuffixY() public static method

Return an English plural suffix 'ies' or 'y' for the given number of items.
public static PluralSuffixY ( int n ) : string
n int
return string

PointString() public static method

Return a string for a UV point or vector with its coordinates formatted to two decimal places.
public static PointString ( UV p ) : string
p UV
return string

PointString() public static method

Return a string for an XYZ point or vector with its coordinates formatted to two decimal places.
public static PointString ( XYZ p ) : string
p XYZ
return string

PointString2d() public static method

Return a string for the XY values of an XYZ point or vector with its coordinates formatted to two decimal places.
public static PointString2d ( XYZ p ) : string
p XYZ
return string

RealString() public static method

Return a string for a real number formatted to two decimal places.
public static RealString ( double a ) : string
a double
return string

SheetDescription() public static method

Return a string describing the given sheet: sheet number and name.
public static SheetDescription ( Element e ) : string
e Element
return string

SvgFlipY() public static method

Flip Y coordinate for SVG export.
public static SvgFlipY ( int y ) : int
y int
return int

Uncapitalise() public static method

Uncapitalise string, i.e. lowercase its first character.
public static Uncapitalise ( string s ) : string
s string
return string

Property Details

SvgFlip public static property

public static bool SvgFlip
return bool