Class EzrMethodWrapper
Class to automatically wrap C# methods so that they can be used in ezr².
public class EzrMethodWrapper : EzrMethodBaseWrapper<MethodInfo>, IEzrObject
- Inheritance
-
objectEzrWrapper<MethodInfo>EzrMethodBaseWrapper<MethodInfo>EzrMethodWrapper
- Implements
- Inherited Members
Constructors
EzrMethodWrapper(Delegate, Context, Position, Position, bool)
Creates a new EzrMethodWrapper from a delegate.
public EzrMethodWrapper(Delegate sharpFunction, Context parentContext, Position startPosition, Position endPosition, bool skipValidation = false)
Parameters
sharpFunctionDelegateThe method to wrap.
parentContextContextThe context in which this object was created.
startPositionPositionThe starting position of the object.
endPositionPositionThe ending position of the object.
skipValidationboolSkip method signature validation?
EzrMethodWrapper(MethodInfo, object?, Context, Position, Position, bool)
Class to automatically wrap C# methods so that they can be used in ezr².
public EzrMethodWrapper(MethodInfo sharpFunction, object? instance, Context parentContext, Position startPosition, Position endPosition, bool skipValidation = false)
Parameters
sharpFunctionMethodInfoThe method to wrap.
instanceobjectThe object which contains the method, null if static.
parentContextContextThe context in which this object was created.
startPositionPositionThe starting position of the object.
endPositionPositionThe ending position of the object.
skipValidationboolSkip method signature validation?
Properties
Tag
The tag of the type of this object, similar to C# namespace naming conventions.
public override string Tag { get; protected internal set; }
Property Value
- string
TypeName
The name of the type of this object, in plain text, all lowercase. Spaces are allowed.
public override string TypeName { get; protected internal set; }
Property Value
- string
Methods
Execute(Reference[], Interpreter, RuntimeResult)
Executes the current object, like a function.
public override void Execute(Reference[] arguments, Interpreter interpreter, RuntimeResult result)
Parameters
argumentsReference[]The arguments of the execution.
interpreterInterpreterThe interpreter to be used in execution.
resultRuntimeResultRuntime result for carrying the result and any errors.
ToString(RuntimeResult)
Evaluates the current object as a string value.
public override string ToString(RuntimeResult result)
Parameters
resultRuntimeResultRuntime result for carrying any errors.
Returns
- string
The evaluated value.