PropertyInfo.PropertyType Property : PropertyInfo « Reflection « VB.Net






PropertyInfo.PropertyType Property

 

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Namespace MyNamespace
    Public Class Example
        Public ReadOnly Property Answer As Integer
            Get
                Return 42
            End Get
        End Property

        Public Shared Sub Main()
            Dim t As Type = GetType(MyNamespace.Example) 
            Dim pi As PropertyInfo = t.GetProperty("Answer")
            Console.WriteLine(t.Name)
            Console.WriteLine(pi.Name)
            Console.WriteLine(pi.PropertyType)

        End Sub
    End Class
End Namespace

   
  








Related examples in the same category

1.PropertyInfo.Attributes Property gets the attributes for this property.
2.PropertyInfo.CanRead
3.PropertyInfo.CanWrite
4.PropertyInfo.GetAccessors
5.PropertyInfo.GetGetMethod returns the public or non-public get accessor for this property.
6.Get and display the GetGetMethod Method for each property
7.Display the GetGetMethod without using the MethodInfo
8.PropertyInfo.GetIndexParameters
9.Get Index Parameters
10.PropertyInfo.GetSetMethod
11.Display the GetSetMethod without using the MethodInfo
12.PropertyInfo.MemberType
13.PropertyInfo.SetValue
14.LocalVariableInfo Class (System.Reflection)_VB.htm