ParameterInfo Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Discovers the attributes of a parameter and provides access to parameter metadata.
Assembly: mscorlib (in mscorlib.dll)
The ParameterInfo type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Attributes | Gets the attributes for this parameter. |
![]() | CustomAttributes | Gets a collection that contains this parameter's custom attributes. |
![]() | DefaultValue | Gets the default value, if the parameter has a default value. |
![]() | HasDefaultValue | Gets a value that indicates whether this parameter has a default value. |
![]() | IsIn | Gets a value indicating whether this is an input parameter. |
![]() | IsOptional | Gets a value indicating whether this parameter is optional. |
![]() | IsOut | Gets a value indicating whether this is an output parameter. |
![]() | IsRetval | Gets a value indicating whether this is a Retval parameter. |
![]() | Member | Gets the member in which the parameter is defined. |
![]() | MetadataToken | Gets a value that identifies this parameter in metadata. |
![]() | Name | Gets the name of the parameter. |
![]() | ParameterType | Gets the type of this parameter. |
![]() | Position | Gets the zero-based position of the parameter in the formal parameter list. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetCustomAttributes(Boolean) | Gets all the custom attributes defined on this parameter. |
![]() | GetCustomAttributes(Type, Boolean) | Gets the custom attributes of the specified type or its derived types that are applied to this parameter. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IsDefined | Determines whether the custom attribute of the specified type or its derived types is applied to this parameter. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Gets the parameter type and name represented as a string. (Overrides Object::ToString().) |
| Name | Description | |
|---|---|---|
![]() | GetCustomAttribute(Type) | Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttribute(Type, Boolean) | Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified parameter, and optionally inspects the ancestors of that parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttribute<T>() | Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttribute<T>(Boolean) | Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified parameter, and optionally inspects the ancestors of that parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttributes() | Overloaded. Retrieves a collection of custom attributes that are applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttributes(Type) | Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttributes<T>() | Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
![]() | GetCustomAttributes<T>(Boolean) | Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter, and optionally inspects the ancestors of that parameter. (Defined by CustomAttributeExtensions.) |
![]() | IsDefined | Indicates whether custom attributes of a specified type are applied to a specified parameter. (Defined by CustomAttributeExtensions.) |
Use an instance of ParameterInfo to obtain information about the parameter's data type, default value, and so on.
MethodBase::GetParameters returns an array of ParameterInfo objects representing the parameters of a method, in order.
The following example defines a method with four parameters and uses the ParameterInfo::Attributes property to display the attributes of the parameters.
Note: |
|---|
To run this example, see Building examples that have static TextBlock controls for Windows Phone 8. |




Note: