C# Class VizInt.TypeUtils

显示文件 Open project: BlueMountainCapital/VizInt

Public Methods

Method Description
FindType ( string typeName ) : Type

Similar to Type.GetType() but also searchs the current AppDomain.

GetTypeName ( Type t ) : string

Given a CLR Type, returns a C#-like type name, without namespaces, converting generic types and system types appropriately. Useful for debugging and logging purposes.

IsNumeric ( object o ) : bool
ToString ( object obj ) : string

Like object.ToString() but for collections it returns the length of the collection, and for Types, returns the C# type name.

Private Methods

Method Description
AppendGenericName ( Type t, StringBuilder sb ) : void
AppendTypeString ( Type t, StringBuilder sb ) : void
TypeUtils ( ) : System

Method Details

FindType() public static method

Similar to Type.GetType() but also searchs the current AppDomain.
public static FindType ( string typeName ) : Type
typeName string
return System.Type

GetTypeName() public static method

Given a CLR Type, returns a C#-like type name, without namespaces, converting generic types and system types appropriately. Useful for debugging and logging purposes.
public static GetTypeName ( Type t ) : string
t System.Type Type to obtain string on
return string

IsNumeric() public static method

public static IsNumeric ( object o ) : bool
o object
return bool

ToString() public static method

Like object.ToString() but for collections it returns the length of the collection, and for Types, returns the C# type name.
public static ToString ( object obj ) : string
obj object
return string