Ok, so I took your advice and looked into reflection, and here's a quick and
dirty of what I came up with:
Private Sub frmObject_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Text = CType(Me.Tag, CommandOperationBase).GetType.ToString
Dim a As Assembly = Assembly.GetAssembly(Me.Tag.GetType)
Dim s As String = String.Empty
For Each t As Type In a.GetExportedTypes
For Each mi As MemberInfo In t.GetMembers
If mi.DeclaringType Is Me.Tag.GetType Then
If mi.MemberType = MemberTypes.Property Then
s &= mi.Name & vbCrLf
End If
End If
Next
Next
MessageBox.Show(s)
End Sub
Basically, I created a new instance of frmObject from another form, set its
Tag property equal to an object, then load the form. This code just
displays all of the properties of that object.
But therein lies the problem. I don't just need the properties of that
object, but also of the object it inherits (all the way back to the base
object) as well. How can I change the code to do this?
Thanks again,
Jason
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Is it possible to detect if a property of a class is Readonly, WriteOnly,
or
Read/Write?
With reflection, check the PropertyInfo.CanRead and CanWrite
properties.
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.