sharpevents 1.0.1
Library that adds C#-esque events to D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
sharpevents
Library that adds C#-esque events to D.
How to use
the Event class is localed in the sev.event
module (short for sharpevents)
To create a new event, do like this.
public Event MyNewEvent = new Event();
An event handler has the signature of void [name] (void* sender, EventArgs args)
public void MyEventHandler (void* sender, EventArgs args) {
//Do something.
}
Subscribe to an event by doing += (like in C#). Remember to use a pointer to the handler.
MyNewEvent += &MyEventHandler;
To unsubscribe, use -=
MyNewEvent -= &MyEventHandler;
To invoke subscribed event handlers, run the class instance like a function. Remember to specify sender and arguments (cast to void*)
MyNewEvent(null, null);
Donations
If this small library has been of any help to you, consider Donating. c:
- Registered by Clipsey
- 1.0.1 released 6 years ago
- PolyplexEngine/sharpevents
- MIT
- Copyright © 2018, Clipsey
- Authors:
- Dependencies:
- none
- Versions:
-
2.0.0 2020-Feb-27 1.0.2 2018-May-13 1.0.1 2018-Mar-15 1.0.0 2018-Feb-27 ~master 2020-Feb-27 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
185 downloads total
-
- Score:
- 0.8
- Short URL:
- sharpevents.dub.pm