Open sandboxFocus

Method WithObject

WithObject(IExpression?)

Gets an IEventInvoker for the same event but with a different object, specified as a compile-time IExpression object.

Declaration
IEventInvoker WithObject(IExpression? obj)
Parameters
Type Name Description
IExpression obj

The run-time expression that represents the object on which the field or property is accessed, or null it is static.

Returns
Type Description
IEventInvoker

WithObject(dynamic?)

Gets an IEventInvoker for the same event but with a different object, specified as a run-time C# expression.

Declaration
IEventInvoker WithObject(dynamic? obj)
Parameters
Type Name Description
dynamic obj

The run-time expression that represents the object on which the field or property is accessed, or null it is static. If the compile-time type of the expression is dynamic, it must be explicitly cast to IExpression.

Returns
Type Description
IEventInvoker