Open sandboxFocus

Class Arguments

Encapsulation of method arguments.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public class Arguments : IList<object>, ICollection<object>, IEnumerable<object>, IEnumerable, ICloneable
Remarks

note

As a result of optimizations, an Arguments object may be shared between different advices. If an advice implementation needs to access an Arguments object after it has given up control, it should take a reference to a clone instead of the initial object itself.

note

Implementations of this type should be considered an implementation detail and should not be accessed by user code.

Fields

Name Description
Empty

An empty list of Arguments.

Properties

Name Description
Count

Gets the number of arguments encapsulated by the current object.

this[int]

Gets or sets the value of an argument. Setting the value is supported only in specific situations. See SetArgument(int, object) for details.

Methods

Name Description
Clone()

Returns a shallow copy of the current object.

CopyFrom(object[], int)

Copies all the argument values from the elements of an Array.

CopyTo(object[], int)

Copies all argument values to the specified Array, starting at the specified index of the destination Array.

Create(params object[])

Creates a weakly-typed Arguments object that represents any number of arguments.

Create<T>(T)

Creates a strongly-typed Arguments object that represents one argument.

Create<T0, T1>(T0, T1)

Creates a strongly-typed Arguments object that represents two arguments.

Create<T0, T1, T2>(T0, T1, T2)

Creates a strongly-typed Arguments object that represents three arguments.

Create<T0, T1, T2, T3>(T0, T1, T2, T3)

Creates a strongly-typed Arguments object that represents four arguments.

Create<T0, T1, T2, T3, T4>(T0, T1, T2, T3, T4)

Creates a strongly-typed Arguments object that represents five arguments.

Create<T0, T1, T2, T3, T4, T5>(T0, T1, T2, T3, T4, T5)

Creates a strongly-typed Arguments object that represents six arguments.

Create<T0, T1, T2, T3, T4, T5, T6>(T0, T1, T2, T3, T4, T5, T6)

Creates a strongly-typed Arguments object that represents seven arguments.

Create<T0, T1, T2, T3, T4, T5, T6, T7>(T0, T1, T2, T3, T4, T5, T6, T7)

Creates a strongly-typed Arguments object that represents eight arguments.

GetArgument(int)

Gets the value of the argument at a given index.

GetEnumerator()
SetArgument(int, object)

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 unsupported scenarios. See Remarks for details.

ToArray()

Converts the current argument list into an Array.