PostSharp6.3/API Reference/Post­Sharp.​Aspects Namespace/Arguments Class/Arguments Methods/Arguments.​Set­Argument Method

Arguments.SetArgument Method

Sets the value of the ref or out argument at a given index. Replacing an argument value is supported only in some advices and is silently ignored in non-supported scenarios. See Remarks for details.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.3.11.0 (6.3.11.0)
Syntax
C#
public virtual void SetArgument(
	int index,
	Object value
)

Parameters

index
Type: System.Int32
Argument index.
value
Type: System.Object
New value of the ref or out argument at position index.
Exceptions
ExceptionCondition
InvalidCastExceptionvalue is not assignable to parameter at position index.
ArgumentOutOfRangeExceptionindex is lower than zero or greater or equal than Count.
Remarks

Replacing a parameter value is supported in the following scenarios:

Setting the value in a different situation is unsupported and has unspecified behavior.

See Also