K
Koen
The things you can do with a propertygrid are fantastic. Howeveer all
properties you want to appear in the grid need to be public and all
properties that you want to be editable need to have a set accessor.
How can I make my class expose the properties differently for a PropertyGrid
than for normal use in the code?
Some more details: I want to use the propertygrid to edit resources. I
already have a class that can read/write these resources but I do not want
to change these resources at run-time, so I don't want a 'set' of the
properties to be publicly visible (malicious programmers are always around
to change some common resource). However a property grid is ideal to edit
the class and hence the resources I could do a run-time check in the set of
the property to see if the object is writable, but it is so much cleaner
that a call that will go through set is trapped by the compiler (like when
no set accessor exists) .
I also want to expose some properties in their full complexity while in
run-time they are simply exposed like strings. So the type of the property
would change between runtime and peropertygrid
Koen.
properties you want to appear in the grid need to be public and all
properties that you want to be editable need to have a set accessor.
How can I make my class expose the properties differently for a PropertyGrid
than for normal use in the code?
Some more details: I want to use the propertygrid to edit resources. I
already have a class that can read/write these resources but I do not want
to change these resources at run-time, so I don't want a 'set' of the
properties to be publicly visible (malicious programmers are always around
to change some common resource). However a property grid is ideal to edit
the class and hence the resources I could do a run-time check in the set of
the property to see if the object is writable, but it is so much cleaner
that a call that will go through set is trapped by the compiler (like when
no set accessor exists) .
I also want to expose some properties in their full complexity while in
run-time they are simply exposed like strings. So the type of the property
would change between runtime and peropertygrid
Koen.