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.IsOut

Retrieves whether this is an output parameter.

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

Property Value

Read-only.

Retrieves whether Out is set for this parameter.

true if the parameter is an Output; otherwise, TBD.

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.Out 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 output parameter, the IsOut 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 IsOut of each parameter
      foreach (ParameterInfo Myparam in Myarray)
      {
         Console.Write ("\nFor parameter # "   + Myparam.Position 
+ ", the IsOut is - " +  Myparam.IsOut );
      }
      return 0;
   }
}
Produces
the following output
Reflection.Parameterinfo
 
Mymethodbase = Void mymethod (Int32, System.String ByRef, System.String ByRef)
For parameter # 0, the IsOut is - False
For parameter # 1, the IsOut is - True
For parameter # 2, the IsOut is - False

See Also

ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace