C# Class Prolog.TypeUtils

Mostrar archivo Open project: ianhorswill/UnityProlog

Public Methods

Method Description
AddTypeSearchPath ( string namespacePrefix, string assembly ) : bool

Add a default namespace and assembly to search when looking for types

CreateGenericInstance ( this genericType, Type genericTypeParameters ) : object

Creates an instance of a generic type given its definition, type parameters, and constructor args.

FindType ( string name ) : Type

Makes a best effort to find the type object corresponding to the type with specified name.

GetPropertyOrField ( this value, string memberName ) : object

Returns the value of the object's specified field or property.

Private Methods

Method Description
CreateGenericInstance ( this genericType, Type genericTypeParameters, List constructorArguments ) : object
CreateInstance ( this type ) : object
CreateInstance ( this type, List constructorArguments ) : object
CreateInstanceWithInitializerKeywords ( this type, List constructorArguments ) : object
GenericTypeInstanceOf ( this t, Type genericTypeDefinition ) : Type
InvokeMethod ( this value, string methodName ) : object
SetPropertyOrField ( this obj, string mname, object value ) : void
TrySetPropertyOrField ( this objectToModify, string memberName, object value, bool errorOnMissing ) : bool

Method Details

AddTypeSearchPath() public static method

Add a default namespace and assembly to search when looking for types
public static AddTypeSearchPath ( string namespacePrefix, string assembly ) : bool
namespacePrefix string Namespace to search
assembly string Assembly to search
return bool

CreateGenericInstance() public static method

Creates an instance of a generic type given its definition, type parameters, and constructor args.
public static CreateGenericInstance ( this genericType, Type genericTypeParameters ) : object
genericType this
genericTypeParameters System.Type
return object

FindType() public static method

Makes a best effort to find the type object corresponding to the type with specified name.
public static FindType ( string name ) : Type
name string Name of the type
return System.Type

GetPropertyOrField() public static method

Returns the value of the object's specified field or property.
public static GetPropertyOrField ( this value, string memberName ) : object
value this
memberName string
return object