Struct EventArguments
- Namespace
- CsCom.Runtime
- Assembly
- CsCom.Runtime.dll
The arguments of an invocation of IDispatch::Invoke (DISPPARAMS) and its result.
public readonly ref struct EventArguments
- Inherited Members
Remarks
The arguments are identified by their positions in the declaration of the member: the positional arguments, which
DISPPARAMS stores in reverse order, and the named arguments, whose dispatch identifiers are their positions.
Missing and omitted arguments read as null or the default value.
Constructors
EventArguments(DispParams*, ComVariant*)
Initializes a new instance of the EventArguments structure.
public EventArguments(DispParams* parameters, ComVariant* result)
Parameters
parametersDispParams*The arguments; can be null.
resultComVariant*The variable that receives the result; null if the caller expects none. It must be initialized, since SetResult<T>(T) clears its value; InvokeHandler(IDispatchEventHandler, int, DispParams*, ComVariant*, ExcepInfo*) initializes the variable of the caller of
IDispatch::Invoke, which may not be.
Properties
Count
Gets the number of arguments.
public int Count { get; }
Property Value
Methods
GetArray2D<T>(int)
Gets a two-dimensional array argument converted to a zero-based array of T.
public T[,]? GetArray2D<T>(int index)
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T[,]
Type Parameters
T
GetArray3D<T>(int)
Gets a three-dimensional array argument converted to a zero-based array of T.
public T[,,]? GetArray3D<T>(int index)
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T[,,]
Type Parameters
T
GetArray<T>(int)
Gets an array argument converted to an array of T.
public T[]? GetArray<T>(int index)
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T[]
Type Parameters
T
GetUniqueWrapper<T>(int)
Gets an object argument converted to a late-bound wrapper of a unique object, like a pointer that is marshalled with UniqueDispatchWrapperMarshaller<T>, see GetUnique<T>(int).
public T? GetUniqueWrapper<T>(int index) where T : class, IDispatchWrapper<T>
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T
Type Parameters
T
GetUnique<T>(int)
Gets an object argument converted to a unique object of T, which is not shared with other
references to the COM object and belongs to the caller, like an interface pointer that is marshalled with
UniqueComObjectMarshaller<T>: Release(object?) releases it at once. An argument
that holds no object, e.g. an omitted one, is converted like Get<T>(int).
public T? GetUnique<T>(int index) where T : class
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T
Type Parameters
T
Exceptions
- NotSupportedException
Tis an interface that is not a source-generated COM interface, also for an argument that holds no object.
GetValue(int)
Gets an argument converted to a managed object, as VariantMarshaller converts it.
public object? GetValue(int index)
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
GetWrapper<T>(int)
Gets an argument converted to a late-bound wrapper.
public T? GetWrapper<T>(int index) where T : class, IDispatchWrapper<T>
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T
Type Parameters
T
Get<T>(int)
Gets an argument converted to T.
public T Get<T>(int index)
Parameters
indexintThe position of the argument in the declaration of the member.
Returns
- T
Type Parameters
T
SetResult<T>(T)
Sets the result of the invocation, if the caller expects one.
public void SetResult<T>(T value)
Parameters
valueTThe result.
Type Parameters
T
Set<T>(int, T)
Returns a new value through an argument passed by reference, converted to the type of the argument. Nothing happens if the argument is missing or was passed by value.
public void Set<T>(int index, T value)
Parameters
indexintThe position of the argument in the declaration of the member.
valueTThe new value.
Type Parameters
T