M
m. pollack
Hi all,
I have subclassed the CollectionEditor object in order to
override its OnInsert and OnRemove methods (because I am
exposing some properties (including a collection property)
of a class object at runtime with a PropertyGrid, and
needed to know when the user was adding objects to, or
removing objects from, the collection. My question is: Can
I use the OnInsert method to block the user from modifying
collection if the object to be added/removed fails some
test? OnInsert and OnRemove just return "void", so I don't
see how, but the docs suggest that it can be done.
One complication of using the CollectionEditor is that it
seems not to add/remove objects by calling the collection
class's Add or Remove methods (removal, for instance,
seems to just happen somehow via
(CollectionEditor.DestroyInstance()), but rather by
grabbing the whole inner list, working with it "offline",
and then just plunking it back in.
Any ideas?
I have subclassed the CollectionEditor object in order to
override its OnInsert and OnRemove methods (because I am
exposing some properties (including a collection property)
of a class object at runtime with a PropertyGrid, and
needed to know when the user was adding objects to, or
removing objects from, the collection. My question is: Can
I use the OnInsert method to block the user from modifying
collection if the object to be added/removed fails some
test? OnInsert and OnRemove just return "void", so I don't
see how, but the docs suggest that it can be done.
One complication of using the CollectionEditor is that it
seems not to add/remove objects by calling the collection
class's Add or Remove methods (removal, for instance,
seems to just happen somehow via
(CollectionEditor.DestroyInstance()), but rather by
grabbing the whole inner list, working with it "offline",
and then just plunking it back in.
Any ideas?