O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ParameterInfo

Synopsis

This class allows the inspection of the type and behavior of a method parameter. Because parameters can have custom attributes on them, the class implements ICustomAttributeProvider. Attributes returns the attributes defined on this parameter. If the parameter has a default, it is stored in DefaultValue. Retrieve the name, type, and member the parameter is from by inspecting Name, ParameterType, and Member. Position returns the ordinal position of this parameter. IsOptional returns true if the parameter is optional, and IsLcid indicates when the parameter is a locale identifier.

A parameter is passed by reference if the IsByRef property of its ParameterType property is true and the IsOut property is false (out parameters have IsByRef and IsOut set to true). A parameter that has been marked as [In] has IsOut set to false and IsIn set to true.

public class ParameterInfo : ICustomAttributeProvider {
// Protected Constructors
   protected method ParameterInfo();  
// Protected Instance Fields
   protected field ParameterAttributes AttrsImpl;  
   protected field Type ClassImpl;  
   protected field object DefaultValueImpl;  
   protected field MemberInfo MemberImpl;  
   protected field string NameImpl;  
   protected field int PositionImpl;  
// Public Instance Properties
   public virtual field ParameterAttributes Attributes{get; } 
   public virtual field object DefaultValue{get; } 
   public field bool IsIn{get; } 
   public field bool IsLcid{get; } 
   public field bool IsOptional{get; } public field bool ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required