C# Class CSE.Exps.TypeExp

Used to parse type expressions
Show file Open project: kcherr1/CSharp-Eval Class Usage Examples

Public Methods

Method Description
CacheCommonTypes ( ) : void

Caches common types for fast lookup

GetType ( string typeData ) : Type

Converts string parameter containing type into an actual type

GetTypeObj ( object typeData ) : Type

Gets type information from object. If object is already a type, object is casted as a type and returned, if not, GetType is called.

TypeAssignMatch ( Type type, dynamic value ) : bool

Heuristic attempt to ensure value given can be coerced into type given. Useful for temporary variable assignments.

Doesn't work for most cases. Needs more work

Method Details

CacheCommonTypes() public static method

Caches common types for fast lookup
public static CacheCommonTypes ( ) : void
return void

GetType() public static method

Converts string parameter containing type into an actual type
public static GetType ( string typeData ) : Type
typeData string String containing type
return System.Type

GetTypeObj() public static method

Gets type information from object. If object is already a type, object is casted as a type and returned, if not, GetType is called.
public static GetTypeObj ( object typeData ) : Type
typeData object Object to get the type of
return System.Type

TypeAssignMatch() public static method

Heuristic attempt to ensure value given can be coerced into type given. Useful for temporary variable assignments.
Doesn't work for most cases. Needs more work
public static TypeAssignMatch ( Type type, dynamic value ) : bool
type System.Type Type to attempt to coerce value to
value dynamic Value to coerce
return bool