ParameterInfo.IsOut Property tells whether this is an output parameter. : ParameterInfo « Reflection « VB.Net






ParameterInfo.IsOut Property tells whether this is an output parameter.

 

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Class parminfo

    Public Shared Sub mymethod(int1m As Integer, ByRef str2m As String, _
    ByRef str3m As String)
        str2m = "in mymethod"
    End Sub

    Public Shared Function Main() As Integer
        Dim Mytype As Type = Type.GetType("parminfo")
        Dim Mymethodbase As MethodBase = Mytype.GetMethod("mymethod")
        Console.Write(Mymethodbase.ToString())

        Dim Myarray As ParameterInfo() = Mymethodbase.GetParameters()

        Dim Myparam As ParameterInfo
        For Each Myparam In  Myarray
            Console.Write("For parameter # " + Myparam.Position.ToString() _
               + ", the IsOut is - " + Myparam.IsOut.ToString())
        Next Myparam
        Return 0
    End Function
End Class

   
  








Related examples in the same category

1.ParameterInfo.Attributes gets the attributes for this parameter.
2.ParameterInfo.GetCustomAttributes gets all the custom attributes defined on this parameter.
3.ParameterInfo.IsDefined
4.ParameterInfo.Name Property returns the name of the parameter.
5.ParameterInfo.ParameterType Property gets the Type of this parameter.