PropertyInfo.CanWrite : PropertyInfo « Reflection « VB.Net






PropertyInfo.CanWrite

 

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class Mypropertyb
    Private myCaption As String = "B Default caption"

    Public ReadOnly Property Caption() As String
        Get
            Return myCaption
        End Get
    End Property
End Class

Class Mypropertyinfo

    Public Shared Function Main() As Integer
        Dim Mypropertyb As New Mypropertyb()

        Console.Write(Mypropertyb.Caption)

        Console.Write(Mypropertyb.Caption)

        Dim MyTypeb As Type = Type.GetType("Mypropertyb")
        Dim Mypropertyinfob As PropertyInfo = MyTypeb.GetProperty("Caption")


        Return 0
    End Function
End Class

   
  








Related examples in the same category

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