mscorlib(4.0.0.0) API with additions
System.Reflection.ParameterInfo Class Reference

Discovers the attributes of a parameter and provides access to parameter metadata. More...

Inheritance diagram for System.Reflection.ParameterInfo:
[legend]
Collaboration diagram for System.Reflection.ParameterInfo:
[legend]

Public Member Functions

virtual Type [] GetRequiredCustomModifiers ()
 Gets the required custom modifiers of the parameter. More...
 
virtual Type [] GetOptionalCustomModifiers ()
 Gets the optional custom modifiers of the parameter. More...
 
override string ToString ()
 Gets the parameter type and name represented as a string. More...
 
virtual object [] GetCustomAttributes (bool inherit)
 Gets all the custom attributes defined on this parameter. More...
 
virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
 Gets the custom attributes of the specified type or its derived types that are applied to this parameter. More...
 
virtual bool IsDefined (Type attributeType, bool inherit)
 Determines whether the custom attribute of the specified type or its derived types is applied to this parameter. More...
 
virtual IList< CustomAttributeDataGetCustomAttributesData ()
 Returns a list of T:System.Reflection.CustomAttributeData objects for the current parameter, which can be used in the reflection-only context. More...
 
object GetRealObject (StreamingContext context)
 Returns the real object that should be deserialized instead of the object that the serialized stream specifies. More...
 

Public Attributes

virtual int MetadataToken => (this as RuntimeParameterInfo)?.MetadataToken ?? 134217728
 Gets a value that identifies this parameter in metadata. More...
 

Protected Member Functions

 ParameterInfo ()
 Initializes a new instance of the ParameterInfo class. More...
 

Protected Attributes

string NameImpl
 The name of the parameter. More...
 
Type ClassImpl
 The Type of the parameter. More...
 
int PositionImpl
 The zero-based position of the parameter in the parameter list. More...
 
ParameterAttributes AttrsImpl
 The attributes of the parameter. More...
 
object DefaultValueImpl
 The default value of the parameter. More...
 
MemberInfo MemberImpl
 The member in which the field is implemented. More...
 

Properties

virtual Type ParameterType [get]
 Gets the Type of this parameter. More...
 
virtual string Name [get]
 Gets the name of the parameter. More...
 
virtual bool HasDefaultValue [get]
 Gets a value that indicates whether this parameter has a default value. More...
 
virtual object DefaultValue [get]
 Gets a value indicating the default value if the parameter has a default value. More...
 
virtual object RawDefaultValue [get]
 Gets a value indicating the default value if the parameter has a default value. More...
 
virtual int Position [get]
 Gets the zero-based position of the parameter in the formal parameter list. More...
 
virtual ParameterAttributes Attributes [get]
 Gets the attributes for this parameter. More...
 
virtual MemberInfo Member [get]
 Gets a value indicating the member in which the parameter is implemented. More...
 
bool IsIn [get]
 Gets a value indicating whether this is an input parameter. More...
 
bool IsOut [get]
 Gets a value indicating whether this is an output parameter. More...
 
bool IsLcid [get]
 Gets a value indicating whether this parameter is a locale identifier (lcid). More...
 
bool IsRetval [get]
 Gets a value indicating whether this is a Retval parameter. More...
 
bool IsOptional [get]
 Gets a value indicating whether this parameter is optional. More...
 
virtual IEnumerable< CustomAttributeDataCustomAttributes [get]
 Gets a collection that contains this parameter's custom attributes. More...
 

Detailed Description

Discovers the attributes of a parameter and provides access to parameter metadata.

Definition at line 14 of file ParameterInfo.cs.

Constructor & Destructor Documentation

◆ ParameterInfo()

System.Reflection.ParameterInfo.ParameterInfo ( )
protected

Initializes a new instance of the ParameterInfo class.

Definition at line 220 of file ParameterInfo.cs.

Member Function Documentation

◆ GetCustomAttributes() [1/2]

virtual object [] System.Reflection.ParameterInfo.GetCustomAttributes ( bool  inherit)
virtual

Gets all the custom attributes defined on this parameter.

Parameters
inheritThis argument is ignored for objects of this type. See Remarks.
Returns
An array that contains all the custom attributes applied to this parameter.
Exceptions
T:System.TypeLoadExceptionA custom attribute type could not be loaded.

Implements System.Reflection.ICustomAttributeProvider.

Definition at line 261 of file ParameterInfo.cs.

◆ GetCustomAttributes() [2/2]

virtual object [] System.Reflection.ParameterInfo.GetCustomAttributes ( Type  attributeType,
bool  inherit 
)
virtual

Gets the custom attributes of the specified type or its derived types that are applied to this parameter.

Parameters
attributeTypeThe custom attributes identified by type.
inheritThis argument is ignored for objects of this type. See Remarks.
Returns
An array that contains the custom attributes of the specified type or its derived types.
Exceptions
T:System.ArgumentExceptionThe type must be a type provided by the underlying runtime system.
T:System.ArgumentNullExceptionattributeType is null.
T:System.TypeLoadExceptionA custom attribute type could not be loaded.

Implements System.Reflection.ICustomAttributeProvider.

Definition at line 275 of file ParameterInfo.cs.

◆ GetCustomAttributesData()

virtual IList<CustomAttributeData> System.Reflection.ParameterInfo.GetCustomAttributesData ( )
virtual

Returns a list of T:System.Reflection.CustomAttributeData objects for the current parameter, which can be used in the reflection-only context.

Returns
A generic list of T:System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the current parameter.

Definition at line 305 of file ParameterInfo.cs.

◆ GetOptionalCustomModifiers()

virtual Type [] System.Reflection.ParameterInfo.GetOptionalCustomModifiers ( )
virtual

Gets the optional custom modifiers of the parameter.

Returns
An array of T:System.Type objects that identify the optional custom modifiers of the current parameter, such as T:System.Runtime.CompilerServices.IsConst or T:System.Runtime.CompilerServices.IsImplicitlyDereferenced.

Definition at line 243 of file ParameterInfo.cs.

◆ GetRealObject()

object System.Reflection.ParameterInfo.GetRealObject ( StreamingContext  context)

Returns the real object that should be deserialized instead of the object that the serialized stream specifies.

Parameters
contextThe serialized stream from which the current object is deserialized.
Returns
The actual object that is put into the graph.
Exceptions
T:System.Runtime.Serialization.SerializationExceptionThe parameter's position in the parameter list of its associated member is not valid for that member's type.

Implements System.Runtime.Serialization.IObjectReference.

Definition at line 360 of file ParameterInfo.cs.

◆ GetRequiredCustomModifiers()

virtual Type [] System.Reflection.ParameterInfo.GetRequiredCustomModifiers ( )
virtual

Gets the required custom modifiers of the parameter.

Returns
An array of T:System.Type objects that identify the required custom modifiers of the current parameter, such as T:System.Runtime.CompilerServices.IsConst or T:System.Runtime.CompilerServices.IsImplicitlyDereferenced.

Definition at line 236 of file ParameterInfo.cs.

◆ IsDefined()

virtual bool System.Reflection.ParameterInfo.IsDefined ( Type  attributeType,
bool  inherit 
)
virtual

Determines whether the custom attribute of the specified type or its derived types is applied to this parameter.

Parameters
attributeTypeThe Type object to search for.
inheritThis argument is ignored for objects of this type. See Remarks.
Returns
true if one or more instances of attributeType or its derived types are applied to this parameter; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionattributeType is null.
T:System.ArgumentExceptionattributeType is not a T:System.Type object supplied by the common language runtime.

Implements System.Reflection.ICustomAttributeProvider.

Definition at line 294 of file ParameterInfo.cs.

◆ ToString()

override string System.Reflection.ParameterInfo.ToString ( )

Gets the parameter type and name represented as a string.

Returns
A string containing the type and the name of the parameter.

Definition at line 251 of file ParameterInfo.cs.

Member Data Documentation

◆ AttrsImpl

ParameterAttributes System.Reflection.ParameterInfo.AttrsImpl
protected

The attributes of the parameter.

Definition at line 26 of file ParameterInfo.cs.

◆ ClassImpl

Type System.Reflection.ParameterInfo.ClassImpl
protected

The Type of the parameter.

Definition at line 20 of file ParameterInfo.cs.

◆ DefaultValueImpl

object System.Reflection.ParameterInfo.DefaultValueImpl
protected

The default value of the parameter.

Definition at line 29 of file ParameterInfo.cs.

◆ MemberImpl

MemberInfo System.Reflection.ParameterInfo.MemberImpl
protected

The member in which the field is implemented.

Definition at line 32 of file ParameterInfo.cs.

◆ MetadataToken

virtual int System.Reflection.ParameterInfo.MetadataToken => (this as RuntimeParameterInfo)?.MetadataToken ?? 134217728

Gets a value that identifies this parameter in metadata.

Returns
A value which, in combination with the module, uniquely identifies this parameter in metadata.

Definition at line 205 of file ParameterInfo.cs.

◆ NameImpl

string System.Reflection.ParameterInfo.NameImpl
protected

The name of the parameter.

Definition at line 17 of file ParameterInfo.cs.

◆ PositionImpl

int System.Reflection.ParameterInfo.PositionImpl
protected

The zero-based position of the parameter in the parameter list.

Definition at line 23 of file ParameterInfo.cs.

Property Documentation

◆ Attributes

virtual ParameterAttributes System.Reflection.ParameterInfo.Attributes
get

Gets the attributes for this parameter.

Returns
A ParameterAttributes object representing the attributes for this parameter.

Definition at line 118 of file ParameterInfo.cs.

◆ CustomAttributes

virtual IEnumerable<CustomAttributeData> System.Reflection.ParameterInfo.CustomAttributes
get

Gets a collection that contains this parameter's custom attributes.

Returns
A collection that contains this parameter's custom attributes.

Definition at line 211 of file ParameterInfo.cs.

◆ DefaultValue

virtual object System.Reflection.ParameterInfo.DefaultValue
get

Gets a value indicating the default value if the parameter has a default value.

Returns
The default value of the parameter, or F:System.DBNull.Value if the parameter has no default value.

Definition at line 84 of file ParameterInfo.cs.

◆ HasDefaultValue

virtual bool System.Reflection.ParameterInfo.HasDefaultValue
get

Gets a value that indicates whether this parameter has a default value.

Returns
true if this parameter has a default value; otherwise, false.

Definition at line 72 of file ParameterInfo.cs.

◆ IsIn

bool System.Reflection.ParameterInfo.IsIn
get

Gets a value indicating whether this is an input parameter.

Returns
true if the parameter is an input parameter; otherwise, false.

Definition at line 143 of file ParameterInfo.cs.

◆ IsLcid

bool System.Reflection.ParameterInfo.IsLcid
get

Gets a value indicating whether this parameter is a locale identifier (lcid).

Returns
true if the parameter is a locale identifier; otherwise, false.

Definition at line 169 of file ParameterInfo.cs.

◆ IsOptional

bool System.Reflection.ParameterInfo.IsOptional
get

Gets a value indicating whether this parameter is optional.

Returns
true if the parameter is optional; otherwise, false.

Definition at line 195 of file ParameterInfo.cs.

◆ IsOut

bool System.Reflection.ParameterInfo.IsOut
get

Gets a value indicating whether this is an output parameter.

Returns
true if the parameter is an output parameter; otherwise, false.

Definition at line 156 of file ParameterInfo.cs.

◆ IsRetval

bool System.Reflection.ParameterInfo.IsRetval
get

Gets a value indicating whether this is a Retval parameter.

Returns
true if the parameter is a Retval; otherwise, false.

Definition at line 182 of file ParameterInfo.cs.

◆ Member

virtual MemberInfo System.Reflection.ParameterInfo.Member
get

Gets a value indicating the member in which the parameter is implemented.

Returns
The member which implanted the parameter represented by this T:System.Reflection.ParameterInfo.

Definition at line 130 of file ParameterInfo.cs.

◆ Name

virtual string System.Reflection.ParameterInfo.Name
get

Gets the name of the parameter.

Returns
The simple name of this parameter.

Definition at line 59 of file ParameterInfo.cs.

◆ ParameterType

virtual Type System.Reflection.ParameterInfo.ParameterType
get

Gets the Type of this parameter.

Returns
The Type object that represents the Type of this parameter.

Definition at line 47 of file ParameterInfo.cs.

◆ Position

virtual int System.Reflection.ParameterInfo.Position
get

Gets the zero-based position of the parameter in the formal parameter list.

Returns
An integer representing the position this parameter occupies in the parameter list.

Definition at line 106 of file ParameterInfo.cs.

◆ RawDefaultValue

virtual object System.Reflection.ParameterInfo.RawDefaultValue
get

Gets a value indicating the default value if the parameter has a default value.

Returns
The default value of the parameter, or F:System.DBNull.Value if the parameter has no default value.

Definition at line 95 of file ParameterInfo.cs.


The documentation for this class was generated from the following file: