Ejemplo n.º 1
0
 public DelegateMenuTest()
 {
     Delegates.MainMenu dateTimeMenu = m_Menu.AddMenu("Show Date/Time");
     dateTimeMenu.AddItem("Show date").Displaying += new ShowDate().Run;
     dateTimeMenu.AddItem("Show time").Displaying += new ShowTime().Run;
     Delegates.MainMenu infoAndVersionMenu = m_Menu.AddMenu("Version and digit");
     infoAndVersionMenu.AddItem("Show virsion").Displaying += new ShowVersion().Run;
     infoAndVersionMenu.AddItem("Count digits").Displaying += new CountDigits().Run;
 }
 private static void showDelegateMenu()
 {
     Delegates.MainMenu mainMenu     = new Delegates.MainMenu();
     Delegates.Menu     dateTimeMenu = mainMenu.AddMenu("Show Date/Time");
     dateTimeMenu.AddItem("Show Time", new TimeAction().ExecuteItem);
     dateTimeMenu.AddItem("Show Date", new DateAction().ExecuteItem);
     Delegates.Menu versionAndDigits = mainMenu.AddMenu("Version and Digits");
     versionAndDigits.AddItem("Count Digits", new CountDigitsAction().ExecuteItem);
     versionAndDigits.AddItem("Show Version", new VersionAction().ExecuteItem);
     mainMenu.Show();
 }