Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace EventManager2a
- {
- class Program
- {
- static void Main(string[] args)
- {
- EventManager eventManager = new EventManager();
- eventManager.AttachListener("clickSpecial", (object sender, EventArgs e) => Console.WriteLine("I am the first listener for event clickSpecial"));
- eventManager.AttachListener("clickSpecial", delegate(object sender, EventArgs e) { Console.WriteLine("I am the second listener of the clickSpecial"); });
- eventManager.TriggerEvent("clickSpecial", new { name = "stoyan", age = 50}, EventArgs.Empty);
- A a = new A(eventManager);
- B b = new B(eventManager);
- a.TriggerClickSpecial();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement