NB : This question is tagged C# too as it is a general question and an answer describing the use of this in C# is perfectly fine to me.
I have been exploring the PropertyGrid lately in the .Net Framework. I have checked on this property (BrowsableAttributes) and I have no idea of the use of it.
At first I thought this would be able to loop through every BrowsableAttribute
in your SelectedObject
then you would be able to find back the original property, that would have been usefull.
But no, apparently all this property does is giving you an AttributeCollection
containing only BrowsableAttribute
, all set to True
...
Can someone enlighten me on what is the point for such method ? I don't even understand how it's usefull inside the .NET...
Dim attributes = MyPropertyGrid.BrowsableAttributes
For Each A As Attribute In attributes
Dim Browsable As BrowsableAttribute = CType(A, BrowsableAttribute)
'Then how can I use this ? it's only property is Browsable (True/False)
Next
I was originally trying to solve a problem, where I don't know which object is selected in the property grid but I want to gather the object's data.
I have no idea on what the object's type is because it comes from a dynamically loaded DLL. I only know it is a derived class of another one, which I know. But I'm interesting in backing up the Object's properties obtained from the Property Grid to be able to save and load them later on.
Since the property grid already contains all those values, I thought this kind of property could be a shorcut for writing more code. I don't want to use reflection to inspect the code while the Property Grid already did it.