CSharpExtensionsΒΆ

CSharpExtensions Class Reference

Various C# extensions used by the Leap C# classes. More...

Static Public Member Functions

static void Dispatch< T > (this EventHandler< T > handler, object sender, T eventArgs)
 Convenience function to consolidate event dispatching boilerplate code. More...
 
static void DispatchOnContext< T > (this EventHandler< T > handler, object sender, System.Threading.SynchronizationContext context, T eventArgs)
 Convenience function to consolidate event dispatching boilerplate code. More...
 
static bool HasMethod (this object objectToCheck, string methodName)
 Reports whether this object has the specified method. More...
 
static int indexOf (this Enum enumItem)
 Returns the ordinal index of this enumeration item. More...
 
static T itemFor< T > (this int ordinal)
 Gets the item at the ordinal position in this enumeration. More...
 
static bool NearlyEquals (this float a, float b, float epsilon=Constants.EPSILON)
 Compares whether two floating point numbers are within an epsilon value of each other. More...
 

Detailed Description

Various C# extensions used by the Leap C# classes.

Since
3.0

Member Function Documentation

static void Dispatch< T > ( this EventHandler< T >  handler,
object  sender,
eventArgs 
)
static

Convenience function to consolidate event dispatching boilerplate code.

Since
3.0
Type Constraints
T :EventArgs 
static void DispatchOnContext< T > ( this EventHandler< T >  handler,
object  sender,
System.Threading.SynchronizationContext  context,
eventArgs 
)
static

Convenience function to consolidate event dispatching boilerplate code.

Events are dispatched on the message queue of a threads' synchronization context, if possible.

Since
3.0
Type Constraints
T :EventArgs 
static bool HasMethod ( this object  objectToCheck,
string  methodName 
)
static

Reports whether this object has the specified method.

Since
3.0
static int indexOf ( this Enum  enumItem)
static

Returns the ordinal index of this enumeration item.

Since
3.0
static T itemFor< T > ( this int  ordinal)
static

Gets the item at the ordinal position in this enumeration.

Since
3.0
static bool NearlyEquals ( this float  a,
float  b,
float  epsilon = Constants.EPSILON 
)
static

Compares whether two floating point numbers are within an epsilon value of each other.

Since
3.0