class EventDispatcher { private static Dictionary> observers = new Dictionary>(); public static void Dispatch(string eventName, string obj) { foreach(IPlugin plugin in observers[eventName]) { plugin.Run(obj); } } } class Chrome { public string CurrentUrl {set; get;} public void LoadPage() { EventDispatcher.Dispatch("page.loaded", this.CurrentUrl); } } interface IPlugin { void Run(string somethin); } class AdBlock : IPlugin { public void Run(string somethin) { Console.WriteLine("now I can try to detect advertisement on the page: " + something); } } EventDispatcher.Connect("page.loaded", new AdBlock()); Chrome chrome = new Chrome(); chrome.CurrentUrl = "http://google.com"; chrome.LoadPage();