delegates/4/application.cs - An Application class. | Lecture 6 - slide 9 : 20 Program 3 |
using System; public class Application{ public static void Main(){ A a1 = new A(1), a2 = new A(2), a3 = new A(3); Messenger m = new Messenger("CS at AAU", a2.MethodA); m.InstallMessage(a1.MethodA); m.DoSend(); Console.WriteLine(); m.InstallMessage(a3.MethodA); m.InstallMessage(a3.MethodA); m.DoSend(); Console.WriteLine(); m.UnInstallMessage(a3.MethodA); m.UnInstallMessage(a1.MethodA); m.DoSend(); } }