Api Sandbox MethodDescription
class

MethodDescription

public sealed class MethodDescription : MemberDescription

Describes a method. We use this class to wrap and return MethodInfo's that are safe to interact with. Returned by TypeLibrary and TypeDescription.

Properties

Name Type Description
IsMethod virtual Boolean Returns true - because this is a method
IsSpecialName Boolean
IsVirtual Boolean
ReturnType Type Gets the return type of this method.
Parameters InAttribute) Gets a list of parameters expected by this method

Methods

Object Invoke(Object targetObject, Object[] parameters = null)

Invokes this method.

targetObject — Should be null if this is static, otherwise should be the object this is a member of.
parameters — An array of parameters to pass. Should be the same length as Parameters
T InvokeWithReturn(Object targetObject, Object[] parameters = null)

Invokes this method and returns a value.

targetObject — Should be null if this is static, otherwise should be the object this is a member of.
parameters — An array of parameters to pass. Should be the same length as Parameters
T CreateDelegate()

Creates a delegate bound to this method.

T CreateDelegate(Object target)

Creates a delegate bound to this method.

target — Value for the first parameter / target object
Delegate CreateDelegate(Type delegateType)

Creates a delegate bound to this method.

delegateType — Delegate type to create
Delegate CreateDelegate(Type delegateType, Object target)

Creates a delegate bound to this method.

delegateType — Delegate type to create
target — Value for the first parameter / target object
Assembly: Sandbox.Reflection Namespace: Sandbox Full Name: Sandbox.MethodDescription