C# Class LSharp.ClrGlue

Utilities for interoperating with the Common Language Runtime
Datei anzeigen Open project: RobBlackwell/LSharp Class Usage Examples

Public Methods

Method Description
CallMethod ( string method, object o ) : object

Calls the given method on the given object with given arguments

CallStaticMethod ( string methodName, Type type ) : object
EnvironmentVersion ( ) : string
Fields ( Object o ) : string

Reflects over all the fields of an object

FindType ( string typeName ) : Type

Searches the currently loaded assemblies for a type with the given name

FindType ( string typeName, List namespaces ) : Type

Searches the list of namespaces for the specified type

FindUnambiguousMember ( string methodName, Type type, int argN ) : MemberInfo

Looks for a given member on a type. If it can be identified unambiguously return it, otherwise return null. N.B. LSharp is a dynamic language, so we don know the types of the arguments at rntime - just how many there are.

LSharpVersion ( ) : string
LoadAssembly ( string name ) : Assembly

Loads the assembly with the given name

MakeInstance ( Type type, object arguments ) : object
TypeInfo ( Type type ) : string

Reflects over a type object to create a textual description of its declaration

Private Methods

Method Description
GetConstructor ( Type type, Type types, object values ) : ConstructorInfo

Method Details

CallMethod() public static method

Calls the given method on the given object with given arguments
public static CallMethod ( string method, object o ) : object
method string
o object
return object

CallStaticMethod() public static method

public static CallStaticMethod ( string methodName, Type type ) : object
methodName string
type System.Type
return object

EnvironmentVersion() public static method

public static EnvironmentVersion ( ) : string
return string

Fields() public static method

Reflects over all the fields of an object
public static Fields ( Object o ) : string
o Object
return string

FindType() public static method

Searches the currently loaded assemblies for a type with the given name
public static FindType ( string typeName ) : Type
typeName string
return System.Type

FindType() public static method

Searches the list of namespaces for the specified type
public static FindType ( string typeName, List namespaces ) : Type
typeName string
namespaces List
return System.Type

FindUnambiguousMember() public static method

Looks for a given member on a type. If it can be identified unambiguously return it, otherwise return null. N.B. LSharp is a dynamic language, so we don know the types of the arguments at rntime - just how many there are.
public static FindUnambiguousMember ( string methodName, Type type, int argN ) : MemberInfo
methodName string
type System.Type
argN int
return System.Reflection.MemberInfo

LSharpVersion() public static method

public static LSharpVersion ( ) : string
return string

LoadAssembly() public static method

Loads the assembly with the given name
public static LoadAssembly ( string name ) : Assembly
name string
return System.Reflection.Assembly

MakeInstance() public static method

public static MakeInstance ( Type type, object arguments ) : object
type System.Type
arguments object
return object

TypeInfo() public static method

Reflects over a type object to create a textual description of its declaration
public static TypeInfo ( Type type ) : string
type System.Type
return string