C# Client Library
A C# Client Library for the AnalyzeRe REST API
AnalyzeRe.Utilities.TypeExtensionMethods Class Reference

Utilities used to format types and properties in a manner suitable to output in error messages, to excel, etc. More...

Static Public Member Functions

static bool AlmostEquals (this double d1, double d2, double tolerance=1E-14)
 Determines whether two doubles are equivalent within the specified tolerance. More...
 
static bool AlmostEquals (this DateTime dt1, DateTime dt2, TimeSpan?tolerance=null)
 Determines whether two dates are equal within the supported precision. More...
 
static bool IsIntegerType (this Type t)
 Determines whether a property is an integer type. More...
 
static bool IsNumeric (this Type t)
 Determines whether a property is numeric. More...
 
static string NiceTypeName (this Type t)
 Produces a human readable string representation of the provided type name, with special consideration for generics. (Source: http://stackoverflow.com/a/2448918/529618 ) More...
 

Detailed Description

Utilities used to format types and properties in a manner suitable to output in error messages, to excel, etc.

Definition at line 8 of file TypeExtensionMethods.cs.

Member Function Documentation

static bool AnalyzeRe.Utilities.TypeExtensionMethods.AlmostEquals ( this double  d1,
double  d2,
double  tolerance = 1E-14 
)
inlinestatic

Determines whether two doubles are equivalent within the specified tolerance.

Parameters
d1The expected value of 'actual'
d2The value to compare to 'expected'
tolerance(Default 1E-14) The relative (ratio) tolerance for the equivalency test. Essentially the number of significant digits that should be equal between the two doubles.

Definition at line 65 of file TypeExtensionMethods.cs.

static bool AnalyzeRe.Utilities.TypeExtensionMethods.AlmostEquals ( this DateTime  dt1,
DateTime  dt2,
TimeSpan?  tolerance = null 
)
inlinestatic

Determines whether two dates are equal within the supported precision.

Analyze Re only supports a precision of up to 3 millisecond decimal places, so this is the default tolerance.

Parameters
dt1The first DateTime.
dt2The second DateTime.
toleranceThe allowed difference before the dates are considered not equal. (Default 0.001 milliseconds)
Returns
True if the dates are equivalent within the tolerated duration.

Definition at line 80 of file TypeExtensionMethods.cs.

static bool AnalyzeRe.Utilities.TypeExtensionMethods.IsIntegerType ( this Type  t)
inlinestatic

Determines whether a property is an integer type.

Parameters
tThe type to check.
Returns
True if this property is an integer type.

Definition at line 38 of file TypeExtensionMethods.cs.

static bool AnalyzeRe.Utilities.TypeExtensionMethods.IsNumeric ( this Type  t)
inlinestatic

Determines whether a property is numeric.

Parameters
tThe type to check.
Returns
True if this property is numeric.

Definition at line 54 of file TypeExtensionMethods.cs.

static string AnalyzeRe.Utilities.TypeExtensionMethods.NiceTypeName ( this Type  t)
inlinestatic

Produces a human readable string representation of the provided type name, with special consideration for generics. (Source: http://stackoverflow.com/a/2448918/529618 )

Definition at line 11 of file TypeExtensionMethods.cs.


The documentation for this class was generated from the following file: