Api Facepunch ActionGraphs ITypeLoader
interface

ITypeLoader

public interface ITypeLoader

An implementation of this interface will wrap reflection calls, allowing custom access control. See DefaultTypeLoader for a default implementation with no access control.

Methods

virtual String TypeToIdentifier(Type type)

Gets an identifier string that can later be used by String) to deserialize a type instance.

virtual Type TypeFromIdentifier(String value)

Load a type from an identifier, as produced by Type).

virtual PropertyInfo GetProperty(Type declaringType, String name)

Gets a named property declared on the given type. Should return null if the property isn't found, or if it isn't allowed to be accessed.

declaringType — Declaring type that contains the property.
name — Property name.
virtual FieldInfo GetField(Type declaringType, String name)

Gets a named field declared on the given type. Should return null if the field isn't found, or if it isn't allowed to be accessed.

declaringType — Declaring type that contains the field.
name — Field name.
virtual Boolean CanRead(PropertyInfo property)

Returns true if ActionGraph is allowed to read from this property. Basic checks, like if a get method exists, will have already been performed.

virtual Boolean CanWrite(PropertyInfo property)

Returns true if ActionGraph is allowed to write to this property. Basic checks, like if a set method exists, will have already been performed.

virtual Boolean CanRead(FieldInfo field)

Returns true if ActionGraph is allowed to read from this field.

virtual Boolean CanWrite(FieldInfo field)

Returns true if ActionGraph is allowed to read from this field. Basic checks, like if it is marked IsInitOnly, will have already been performed.

virtual IReadOnlyList<ConstructorInfo> GetConstructors(Type declaringType)

Gets all constructors declared on the given type.

declaringType — Declaring type that contains the constructors.
virtual IReadOnlyList<MethodInfo> GetMethods(Type declaringType, String name)

Gets all methods with the given name declared on the given type.

declaringType — Declaring type that contains the methods.
name — Method name.
virtual Type GetNestedType(Type declaringType, String name)

Gets a nested type from its name and the containing type. Should return null if the type isn't found, or if it isn't allowed to be accessed.

declaringType — Declaring type that contains the nested type.
name — Short name of the nested type, not the fully qualified name.
virtual Type MakeArrayType(Type elementType, Int32? rank)
virtual Type MakeGenericType(Type genericTypeDefinition, Type[] genericArguments)

Makes a generic instance type from the given generic type definition and type arguments. Should throw an exception if the arguments aren't valid for the generic type definition, or if creating such a type is forbidden.

genericTypeDefinition — Generic type definition with one or more open type parameters.
genericArguments — Type arguments to use when creating the generic instance type.
Assembly: Facepunch.ActionGraphs Namespace: Facepunch.ActionGraphs Full Name: Facepunch.ActionGraphs.ITypeLoader