Dumping the methods and their parameters for a class. : ParameterInfo « Reflection « C# / C Sharp





Dumping the methods and their parameters for a class.

    


using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections;

class MainClass {
    public static void DumpParameters(ParameterInfo[] pars) {
        foreach (ParameterInfo pi in pars) {
            Console.WriteLine("\n  Parameter Name: {0}",pi.Name);
            Console.WriteLine("  Parameter Type: {0}",pi.ParameterType);
            Console.WriteLine("  Is In? {0}",pi.IsIn);
            Console.WriteLine("  Is Out? {0}",pi.IsOut);
        }
    }



}

   
    
    
  










Related examples in the same category

1.ParameterInfo: GetParameters
2.Dumps the properties names and current values from an object type (used for static classes)
3.Dumps the properties names and current values from an object
4.Gets the attributes for this parameter.
5.Gets all the custom attributes defined on this parameter.
6.If attribute of the type or its derived types is applied
7.Gets a value indicating whether this is an output parameter.
8.Gets the name of the parameter.
9.Gets the Type of this parameter.
10.Append Generic Type parameters to StringBuilder