Exemple #1
0
        protected void AddMenu(string text, ControllerMenuDelegate proc)
        {
            EventHandler handler = delegate(object sender, EventArgs e)
            {
                try
                {
                    proc();
                }
                catch (GUIException ex)
                {
                    MessageBox.Show(ex.Message, text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            };

            contextmenu.MenuItems.Add(text, handler);
        }
Exemple #2
0
 protected void AddMenu(string text,ControllerMenuDelegate proc)
 {
     EventHandler handler = delegate(object sender,EventArgs e)
     {
         try
         {
             proc();
         }
         catch (GUIException ex)
         {
             MessageBox.Show(ex.Message,text,MessageBoxButtons.OK,MessageBoxIcon.Error);
         }
     };
     contextmenu.MenuItems.Add(text,handler);
 }