static void Main(string[] args) { /* IHuman h; * Theodore t; * h = new Theodore(); * //cast for assignement * t = (Theodore)h; * //use class based reference * t.Name = "Fred"; * t.Speak("I like public implementations!"); * //use interface reference * h.Name = "Teddy"; * h.Speak("I like VB!");*/ NotifyMe d = new NotifyMe(Listener.GetNotifiedAgain); InvokeDelegate(d); Listener lsnr = new Listener(); NotifyMe d2 = new NotifyMe(lsnr.GetNotified); InvokeDelegate(d2); InvokeDelegate(d); Console.Read(); }
public ActionResult Notify(NotifyMe notifyMe) { var repo = new Repository(Properties.Settings.Default.ConStr); repo.AddNotify(notifyMe); TempData["NotifyMe"] = notifyMe; return(Redirect("/home/index")); }
static void Main(string[] args) { NotifyMe d = new NotifyMe(Listener.GetNotifiedAgain); InvokeDelegate(d); Listener lsnr = new Listener(); NotifyMe d2 = new NotifyMe(lsnr.GetNotified); InvokeDelegate(d2); }
static void Main(string[] args) { IHuman h; Theodore t; h = new Theodore(); t = (Theodore)h; t.Name = "Fred"; t.Speak("I like public implementations!"); h.Name = "Teddy"; h.Speak("I like VB!"); NotifyMe d = new NotifyMe(Listener.GetNotifiedAgain); InvokeDelegate(d); Listener lsnr = new Listener(); NotifyMe d2 = new NotifyMe(lsnr.GetNotified); InvokeDelegate(d2); Console.ReadKey(); }
static void Main(string[] args) { /*IHuman h; * Theodore t; * h = new Theodore(); * t = (Theodore)h; * t.Speak("I like public implementations!"); * h.Name = "Teddy"; * h.Speak("I like VB!"); * Console.ReadLine();*/ NotifyMe d = new NotifyMe(Listener.GetNotifiedAgain); InvokeDelegate(d); Listener lsnr = new Listener(); NotifyMe d2 = new NotifyMe(lsnr.GetNotified); InvokeDelegate(d2); Console.ReadLine(); }
static void InvokeDelegate(NotifyMe d) { d("You are late paying your bills!"); }