ParameterInfo.Attributes gets the attributes for this parameter. : ParameterInfo « Reflection « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Reflection » ParameterInfoScreenshots 
ParameterInfo.Attributes gets the attributes for this parameter.
 

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class MyClass1
   Public Function MyMethod(As Integer, ByRef j As Short, ByRef k As LongAs Integer
      j = 2
      Return 0
   End Function 
End Class 

Public Class ParameterInfo_Attributes
   Public Shared Sub Main()
      Dim myType As Type = GetType(MyClass1)
      Dim myMethodBase As MethodBase = myType.GetMethod("MyMethod")
      Dim myParameters As ParameterInfo() = myMethodBase.GetParameters()
      Console.WriteLine(myParameters.Length)
      Dim As Integer
      For i = To myParameters.Length - 1
         Console.WriteLine("The {0} parameter has the attribute : {1}", i + 1, myParameters(i).Attributes)
      Next i
   End Sub 
End Class 

   
  
Related examples in the same category
1.ParameterInfo.GetCustomAttributes gets all the custom attributes defined on this parameter.
2.ParameterInfo.IsDefined
3.ParameterInfo.IsOut Property tells whether this is an output parameter.
4.ParameterInfo.Name Property returns the name of the parameter.
5.ParameterInfo.ParameterType Property gets the Type of this parameter.
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.