ParamArrayAttribute Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited.


Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

[AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
public sealed class ParamArrayAttribute : Attribute

The ParamArrayAttribute type exposes the following members.

Public methodParamArrayAttributeInitializes a new instance of the ParamArrayAttribute class with default properties.

Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

The ParamArrayAttribute indicates that a method parameter is a parameter array. A parameter array allows the specification of an unknown number of arguments. A parameter array must be the last parameter in a formal parameter list, and it must be a single-dimension array. When the method is called, a parameter array permits arguments to a method to be specified in either of two ways:

  • As a single expression of a type that is implicitly convertible to the parameter array type. The parameter array functions as a value parameter.

  • As zero or more arguments, where each argument is an expression of a type that is implictly convertible to the type of the parameter array element.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.