Class CallbackArguments
This class is a container for arguments received by a CallbackFunction
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class CallbackArguments
Constructors
CallbackArguments(IList<DynValue>, Boolean)
Initializes a new instance of the CallbackArguments class.
Declaration
public CallbackArguments(IList<DynValue> args, bool isMethodCall)
Parameters
IList<DynValue>
args
The arguments. |
System.Boolean
isMethodCall
if set to |
Properties
Count
Gets the count of arguments
Declaration
public int Count { get; }
Property Value
System.Int32
|
IsMethodCall
Gets or sets a value indicating whether this is a method call.
Declaration
public bool IsMethodCall { get; }
Property Value
System.Boolean
|
Item[Int32]
Gets the DynValue at the specified index, or Void if not found
Declaration
public DynValue this[int index] { get; }
Parameters
System.Int32
index
|
Property Value
DynValue
|
Methods
AsInt(Int32, String)
Gets the specified argument as an integer
Declaration
public int AsInt(int argNum, string funcName)
Parameters
System.Int32
argNum
The argument number. |
System.String
funcName
Name of the function. |
Returns
System.Int32
|
AsLong(Int32, String)
Gets the specified argument as a long integer
Declaration
public long AsLong(int argNum, string funcName)
Parameters
System.Int32
argNum
The argument number. |
System.String
funcName
Name of the function. |
Returns
System.Int64
|
AsStringUsingMeta(ScriptExecutionContext, Int32, String)
Gets the specified argument as a string, calling the __tostring metamethod if needed, in a NON yield-compatible way.
Declaration
public string AsStringUsingMeta(ScriptExecutionContext executionContext, int argNum, string funcName)
Parameters
ScriptExecutionContext
executionContext
The execution context. |
System.Int32
argNum
The argument number. |
System.String
funcName
Name of the function. |
Returns
System.String
|
Exceptions
ScriptRuntimeException
'tostring' must return a string to '{0}' |
AsType(Int32, String, DataType, Boolean)
Gets the specified argument as as an argument of the specified type. If not possible, an exception is raised.
Declaration
public DynValue AsType(int argNum, string funcName, DataType type, bool allowNil = false)
Parameters
System.Int32
argNum
The argument number. |
System.String
funcName
Name of the function. |
DataType
type
The type desired. |
System.Boolean
allowNil
if set to |
Returns
DynValue
|
AsUserData<T>(Int32, String, Boolean)
Gets the specified argument as as an argument of the specified user data type. If not possible, an exception is raised.
Declaration
public T AsUserData<T>(int argNum, string funcName, bool allowNil = false)
Parameters
System.Int32
argNum
The argument number. |
System.String
funcName
Name of the function. |
System.Boolean
allowNil
if set to |
Returns
T
|
Type Parameters
T
The desired userdata type |
GetArray(Int32)
Converts the arguments to an array
Declaration
public DynValue[] GetArray(int skip = 0)
Parameters
System.Int32
skip
The number of elements to skip (default= 0). |
Returns
DynValue[]
|
RawGet(Int32, Boolean)
Gets the DynValue at the specified index, or null.
Declaration
public DynValue RawGet(int index, bool translateVoids)
Parameters
System.Int32
index
The index. |
System.Boolean
translateVoids
if set to |
Returns
DynValue
|
SkipMethodCall()
Returns a copy of CallbackArguments where the first ("self") argument is skipped if this was a method call, otherwise returns itself.
Declaration
public CallbackArguments SkipMethodCall()
Returns
CallbackArguments
|