API ReferenceFacepunch.ActionGraphs

ITypeLoaderclass

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

objectITypeLoader
Namespace
Facepunch.ActionGraphs
Assembly
Facepunch.ActionGraphs
Declaration
public abstract interface Facepunch.ActionGraphs.ITypeLoader

Methods13

Showing 13 methods

public virtual System.Collections.Generic.IReadOnlyList`1<System.Reflection.ConstructorInfo> GetConstructors(System.Type declaringType)PUBLICVIRTUAL

Gets all constructors declared on the given type.

ParameterTypeDescription
declaringTypeTypeDeclaring type that contains the constructors.
Returns:IReadOnlyList<ConstructorInfo>

public virtual System.Reflection.FieldInfo GetField(System.Type declaringType, string name)PUBLICVIRTUAL

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.

ParameterTypeDescription
declaringTypeTypeDeclaring type that contains the field.
namestringField name.
Returns:FieldInfo

public virtual System.Collections.Generic.IReadOnlyList`1<System.Reflection.MethodInfo> GetMethods(System.Type declaringType, string name)PUBLICVIRTUAL

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

ParameterTypeDescription
declaringTypeTypeDeclaring type that contains the methods.
namestringMethod name.
Returns:IReadOnlyList<MethodInfo>

public virtual System.Type GetNestedType(System.Type declaringType, string name)PUBLICVIRTUAL

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.

ParameterTypeDescription
declaringTypeTypeDeclaring type that contains the nested type.
namestringShort name of the nested type, not the fully qualified name.
Returns:Type

public virtual System.Reflection.PropertyInfo GetProperty(System.Type declaringType, string name)PUBLICVIRTUAL

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.

ParameterTypeDescription
declaringTypeTypeDeclaring type that contains the property.
namestringProperty name.
Returns:PropertyInfo

public virtual System.Type MakeArrayType(System.Type elementType, System.Nullable`1<int> rank)PUBLICVIRTUAL

ParameterTypeDescription
elementTypeType
rankNullable<int>
Returns:Type

public virtual System.Type MakeGenericType(System.Type genericTypeDefinition, System.Type[] genericArguments)PUBLICVIRTUAL

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.

ParameterTypeDescription
genericTypeDefinitionTypeGeneric type definition with one or more open type parameters.
genericArgumentsType[]Type arguments to use when creating the generic instance type.
Returns:Type

public virtual System.Type TypeFromIdentifier(string value)PUBLICVIRTUAL

Load a type from an identifier, as produced by `Facepunch.ActionGraphs.ITypeLoader.TypeToIdentifier(System.Type)`.

ParameterTypeDescription
valuestring
Returns:Type

public virtual string TypeToIdentifier(System.Type type)PUBLICVIRTUAL

Gets an identifier string that can later be used by `Facepunch.ActionGraphs.ITypeLoader.TypeFromIdentifier(System.String)` to deserialize a type instance.

ParameterTypeDescription
typeType
Returns:string

On this page