Gets the Type of this parameter. : ParameterInfo « Reflection « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# / C Sharp » Reflection » ParameterInfoScreenshots 
Gets the Type of this parameter.
  
 using System;
 using System.Reflection;

 class parminfo
 {
    public static void mymethod (int int1m, out string str2m, ref string str3m)
    {
       str2m = "asdf";
    }

    public static int Main(string[] args)
    {
       Type Mytype = Type.GetType("parminfo");
       MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
       Console.Write("\nMymethodbase = " + Mymethodbase);
       ParameterInfo[]Myarray = Mymethodbase.GetParameters();
       foreach (ParameterInfo Myparam in Myarray)
       {
          Console.Write ("\nFor parameter # " + Myparam.Position 
             ", the ParameterType is - " + Myparam.ParameterType);
       }
       return 0;
    }
 }

   
    
  
Related examples in the same category
1.ParameterInfo: GetParameters
2.Dumping the methods and their parameters for a class.
3.Dumps the properties names and current values from an object type (used for static classes)
4.Dumps the properties names and current values from an object
5.Gets the attributes for this parameter.
6.Gets all the custom attributes defined on this parameter.
7.If attribute of the type or its derived types is applied
8.Gets a value indicating whether this is an output parameter.
9.Gets the name of the parameter.
10.Append Generic Type parameters to StringBuilder
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.