Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Michael Hudgell
|
Sep 4, 2007 - 5:10 AM
|
Could the Elegant.Ui.Command type be extended with a set of properties to let you know if each event has any eventhandlers attatched...
so, for example for the Executed event:
public bool IsExecutedAttatched { get { return (Executed != null); } }
Currently this comparison is privilidged to within the class, and even inheriting from the class doesn’t give one access to do the comparison...
Uses could be to see if you need to enable/disable an option based on whether anything has hooked it etc...
|
|
Technical Support
|
Sep 4, 2007 - 9:35 AM
|
The restriction when you cannot know the number of subscribers was made for the reason of better encapsulation of events. There are probably some subtleties in the design of your application, which require what you requested. Would let us know more details so that we can help you?
As for the IsExecutedAttatched -like property, we have never seen this kind of APIs before, and it looks a bit strange for us. Again give us more details (if it is possible) about your app’s design to see what we can do.
|
|
Michael Hudgell
|
Sep 5, 2007 - 5:13 AM
|
You are indeed correct... I have come up with a better way of encapsulating the required functionality...
Where is the delete thread button when you need it :-)
Mike
|
|