PostSharpAPI ReferencePost­Sharp.​AspectsArguments
Open sandboxFocus

Arguments Class

Encapsulation of method arguments.

Implements
IList<System.Object>
System.Collections.Generic.ICollection<System.Object>
System.Collections.Generic.IEnumerable<System.Object>
IEnumerable
ICloneable
Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public class Arguments : Object
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 over 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

Empty list of Arguments.

Properties

Name Description
Count

Gets the number of arguments encapsulated by the current object.

Item[Int32]

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

Methods

Name Description
Clone()

Returns a shallow copy of the current object.

CopyFrom(Object[], Int32)

Copies all the argument values from the elements of Array.

CopyTo(Object[], Int32)

Copies all arguments values to the specified Array starting at the specified destination Array index.

Create(Object[])

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

Create<T>(T)

Creates a strongly-typed Arguments object representing 1 argument.

Create<T0, T1>(T0, T1)

Creates a strongly-typed Arguments object representing 2 arguments.

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

Creates a strongly-typed Arguments object representing 3 arguments.

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

Creates a strongly-typed Arguments object representing 4 arguments.

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

Creates a strongly-typed Arguments object representing 5 arguments.

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

Creates a strongly-typed Arguments object representing 6 arguments.

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

Creates a strongly-typed Arguments object representing 7 arguments.

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

Creates a strongly-typed Arguments object representing 8 arguments.

GetArgument(Int32)

Gets the value of the argument at a given index.

GetEnumerator()
SetArgument(Int32, 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 non-supported scenarios. See Remarks for details.

ToArray()

Converts the current argument list into an Array.