C# Класс Jurassic.Compiler.ReflectionHelpers

Used by the code generator. Not intended for user code (the class needs to be public because when using Reflection Emit, all calls into Jurassic.dll are cross-assembly and thus must be public).
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetConstructor ( Type type ) : ConstructorInfo

Gets the ConstructorInfo for a constructor. Throws an exception if the search fails.

GetField ( Type type, string name ) : FieldInfo

Gets the FieldInfo for a field. Throws an exception if the search fails.

GetInstanceMethod ( Type type, string name ) : MethodInfo

Gets the MethodInfo for an instance method. Throws an exception if the search fails.

GetStaticMethod ( Type type, string name ) : MethodInfo

Gets the MethodInfo for a static method. Throws an exception if the search fails.

SetObjectLiteralGetter ( ObjectInstance obj, object key, Jurassic.Library.UserDefinedFunction getter ) : void

Sets the value of a object literal property to a getter. If the value already has a setter then it will be retained.

SetObjectLiteralSetter ( ObjectInstance obj, object key, Jurassic.Library.UserDefinedFunction setter ) : void

Sets the value of a object literal property to a setter. If the value already has a getter then it will be retained.

SetObjectLiteralValue ( ObjectInstance obj, object key, object value ) : void

Sets the value of a object literal property to a value.

Приватные методы

Метод Описание
GetGenericInstanceMethod ( Type type, string name ) : MethodInfo

Gets the MethodInfo for a generic instance method. Throws an exception if the search fails.

GetMembers ( ) : IEnumerable

Gets an enumerable list of all the MemberInfos that are statically known to be used by this DLL.

ReflectionHelpers ( ) : System

Initializes static members of this class.

Описание методов

GetConstructor() публичный статический Метод

Gets the ConstructorInfo for a constructor. Throws an exception if the search fails.
public static GetConstructor ( Type type ) : ConstructorInfo
type System.Type The type to search.
Результат System.Reflection.ConstructorInfo

GetField() публичный статический Метод

Gets the FieldInfo for a field. Throws an exception if the search fails.
public static GetField ( Type type, string name ) : FieldInfo
type System.Type The type to search.
name string The name of the field.
Результат System.Reflection.FieldInfo

GetInstanceMethod() публичный статический Метод

Gets the MethodInfo for an instance method. Throws an exception if the search fails.
public static GetInstanceMethod ( Type type, string name ) : MethodInfo
type System.Type The type to search.
name string The name of the method to search for.
Результат System.Reflection.MethodInfo

GetStaticMethod() публичный статический Метод

Gets the MethodInfo for a static method. Throws an exception if the search fails.
public static GetStaticMethod ( Type type, string name ) : MethodInfo
type System.Type The type to search.
name string The name of the method to search for.
Результат System.Reflection.MethodInfo

SetObjectLiteralGetter() публичный статический Метод

Sets the value of a object literal property to a getter. If the value already has a setter then it will be retained.
public static SetObjectLiteralGetter ( ObjectInstance obj, object key, Jurassic.Library.UserDefinedFunction getter ) : void
obj Jurassic.Library.ObjectInstance The object to set the property on.
key object The property key (can be a string or a symbol).
getter Jurassic.Library.UserDefinedFunction The getter function.
Результат void

SetObjectLiteralSetter() публичный статический Метод

Sets the value of a object literal property to a setter. If the value already has a getter then it will be retained.
public static SetObjectLiteralSetter ( ObjectInstance obj, object key, Jurassic.Library.UserDefinedFunction setter ) : void
obj Jurassic.Library.ObjectInstance The object to set the property on.
key object The property key (can be a string or a symbol).
setter Jurassic.Library.UserDefinedFunction The setter function.
Результат void

SetObjectLiteralValue() публичный статический Метод

Sets the value of a object literal property to a value.
public static SetObjectLiteralValue ( ObjectInstance obj, object key, object value ) : void
obj Jurassic.Library.ObjectInstance The object to set the property on.
key object The property key (can be a string or a symbol).
value object The value to set.
Результат void