NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ParameterInfo.IsIn

Retrieves whether this is an input parameter.

[Visual Basic]
Public ReadOnly Property IsIn As Boolean
[C#]
public bool IsIn {get;}
[C++]
public: __property bool get_IsIn();
[JScript]
public function get IsIn() : Boolean;

Property Value

Read-only.

Retrieves whether In is set for this parameter.

true if the parameter is an Input; otherwise, false.

Remarks

This method depends on an optional metadata flag. This flag may be inserted by compilers, but the compilers are not obligated to do so.

This method utilizes the ParameterAttributes.In method.

To get the ParameterInfo array, first get the method. From the method, get the Type. From the Type, get the ParameterInfo array.

If the parameter is an input parameter, the IsIn is True. Otherwise it is False.

Example [C#]

[C#]

class
parminfo
{
   public static void mymethod (
      [in] int int1m, out string str2m, ref string str3m)
   {
      str2m = "in mymethod";
   }
 
   public static int Main(string[] args)
   {
      Console.WriteLine("\nReflection.Parameterinfo");
      
      //Get the ParameterInfo parameter of a function.
 
      //Get the type
      Type Mytype = Type.GetType("parminfo");
 
      //Get and display the method
      MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
      Console.Write("\nMymethodbase = " + Mymethodbase);
 
      //Get the ParameterInfo array
      ParameterInfo[] Myarray = Mymethodbase.GetParameters();
      
      //Get and display the IsIn of each parameter
      foreach (ParameterInfo Myparam in Myarray)
      {
         Console.Write ("\nFor parameter # "   + Myparam.Position 
+ ", the IsIn is - " +  Myparam.IsIn );
      }
      return 0;
   }
}
Produces
the following output
Reflection.Parameterinfo
 
Mymethodbase = Void mymethod (Int32, System.String ByRef, System.String ByRef)
For parameter # 0, the IsIn is - True
For parameter # 1, the IsIn is - False
For parameter # 2, the IsIn is - False

See Also

ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace