Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class PropertyAccessor
- Private ReadOnly _canRead As Boolean
- Private ReadOnly _canWrite As Boolean
- Private ReadOnly _type As Type
- Private ReadOnly _name As String
- Public ReadOnly Property CanRead As Boolean
- Get
- Return _canRead
- End Get
- End Property
- Public ReadOnly Property CanWrite As Boolean
- Get
- Return _canWrite
- End Get
- End Property
- Public ReadOnly Property PropertyType As Type
- Get
- Return _type
- End Get
- End Property
- Public ReadOnly Property Name As String
- Get
- Return _name
- End Get
- End Property
- Public Sub New(ByRef inboundProperty As PropertyInfo)
- _canRead = inboundProperty.CanRead
- _canWrite = inboundProperty.CanWrite
- _type = inboundProperty.PropertyType
- _name = inboundProperty.Name
- GenerateSetter(inboundProperty.GetSetMethod(True))
- GenerateGetter(inboundProperty.GetGetMethod(True))
- End Sub
- Public Sub New(ByRef inboundField As FieldInfo)
- _canRead = True
- _canWrite = Not inboundField.IsInitOnly
- _type = inboundField.FieldType
- _name = inboundField.Name
- GenerateSetter(inboundField)
- GenerateGetter(inboundField)
- End Sub
- Private Sub GenerateSetter(ByRef setMethod As MethodInfo)
- ' Trying to write this one
- End Sub
- Private Sub GenerateGetter(ByRef getMethod As MethodInfo)
- ' Trying to write this one
- End Sub
- Private Sub GenerateSetter(ByRef field As FieldInfo)
- ' TBC
- End Sub
- Private Sub GenerateGetter(ByRef field As FieldInfo)
- ' TBC
- End Sub
- Public Sub [Set](ByRef instance As Object, ByRef value As Object)
- ' TBC
- End Sub
- Public Function [Get](ByRef instance As Object) As Object
- ' TBC
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement