Esempio n. 1
0
 public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
 {
     MenuCommand[] commandArray = new MenuCommand[ToolLoader.Tool.Count];
     for (int i = 0; i < ToolLoader.Tool.Count; i++)
     {
         MenuCommand command = new MenuCommand(ToolLoader.Tool[i].ToString(), new EventHandler(this.ToolEvt));
         command.Description = "Start tool " + string.Join(string.Empty, ToolLoader.Tool[i].ToString().Split(new char[] { '&' }));
         commandArray[i] = command;
     }
     return commandArray;
 }
Esempio n. 2
0
 public static void CreateQuickInsertMenu(TextBoxBase targetControl, Control popupControl, string[,] quickInsertMenuItems)
 {
     ContextMenuStrip quickInsertMenu = new ContextMenuStrip();
     for (int i = 0; i < quickInsertMenuItems.GetLength(0); i++)
     {
         if (quickInsertMenuItems[i, 0] == "-")
         {
             quickInsertMenu.Items.Add(new MenuSeparator());
         }
         else
         {
             MenuCommand command = new MenuCommand(quickInsertMenuItems[i, 0], new QuickInsertMenuHandler(targetControl, quickInsertMenuItems[i, 1]).EventHandler);
             quickInsertMenu.Items.Add(command);
         }
     }
     new QuickInsertHandler(popupControl, quickInsertMenu);
 }