public class Sandbox.Internal.TypeLibrary
Methods
Showing 49 methods
public T GetAttribute(System.Type t)
Get single attribute of type, from type
public Sandbox.EnumDescription GetEnumDescription(System.Type enumType)
Get a class describing the values of an enum
public System.Type[] GetGenericArguments(System.Type genericType)
Performs `System.Type.GetGenericArguments` with access control checks. Will throw if any arguments aren't in the whitelist.
Parameters
genericType: Constructed generic type to get the arguments of
public System.Collections.Generic.IReadOnlyList`1<Sandbox.TypeDescription> GetGenericTypes(System.Type type, System.Type[] types)
Get a list of types that implement this generic type
public Sandbox.MemberDescription GetMemberByIdent(int ident)
Find a `Sandbox.MemberDescription` by its `Sandbox.MemberDescription.Identity`
public System.Collections.Generic.IReadOnlyList`1<System.ValueTuple`2<Sandbox.MethodDescription,T>> GetMethodsWithAttribute(bool onlyStatic = True)
Find all methods with given attribute, optionally non static
Parameters
onlyStatic: Default: True
public Sandbox.PropertyDescription[] GetPropertyDescriptions(object obj, bool onlyOwn = False)
Get a list of properties on the target object. To do this we'll just call GetDescription( obj.GetType() ) and return .Properties. Will return an empty array if we can't access these properties.
Parameters
onlyOwn: Default: False
public object GetPropertyValue(object target, string name)
Try to get a value from a property on an object
public Sandbox.TypeDescription GetTypeByIdent(int ident)
Find a TypeDescription by name
public int GetTypeIdent(System.Type type)
Get hash of a type.
public bool HasAttribute(System.Type type)
Return true if this type contains this attribute
public bool SetProperty(object target, string name, object value)
Set a named property on given object. Will perform extra magic for string inputs and try to convert to target property type.
Parameters
target: The target object to set a named property on.name: Name of the property to set.value: Value for the property.
Returns
Whether the property was set or not.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Internal |
| Type | class |
| Assembly | Sandbox.Reflection |
| Doc ID | T:Sandbox.Internal.TypeLibrary |