Re: event macro/handler/listener syntax
Bryan Bulten <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
> I wonder what the reasoning was, not to do
> the same for the C# bindings. Is the AddListener()
> syntax some sort of "native" C# way to connect
> events to handlers or is it impossible to use
> macros of some sort in C#?
C# actually has its own way of handling events, called Delegates, which
will probably be used for event handling in the future, and will be
cleaner than the AddMenuHandler(...) stuff. Delegates are supposedly
much more flexible than traditional callbacks.
To add and remove events a simple call like this is needed:
myDelegate += new EventHandler(...);
myDelegate -= evtHandler;
(I'm not 100% with my C#, but that's basically how it goes.)
From what I know, C# doesn't have the macro abilities available in
C/C++.
--
Bryan Bulten
http://opendev.ods.org/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+bl8b32WFWIzmzHgRApVjAJ9lZGkfGx7BC5Q9v1BaTT1lApSwvwCZAetO O25ulwZ7cu1EFsZzTMcHoMQ= =zuQE -----END PGP SIGNATURE-----