當前位置: 首頁>>代碼示例>>C#>>正文


C# Menu.AddRange方法代碼示例

本文整理匯總了C#中System.Windows.Forms.Menu.AddRange方法的典型用法代碼示例。如果您正苦於以下問題:C# Menu.AddRange方法的具體用法?C# Menu.AddRange怎麽用?C# Menu.AddRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.Menu的用法示例。


在下文中一共展示了Menu.AddRange方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddControlMenuItems

        public static void AddControlMenuItems(Menu.MenuItemCollection pParent, AemInstance pInstance)
        {
            List<MenuItem> menuItems = new List<MenuItem>();
              MenuItem item;

              item = new MenuItem();
              item.Text = "Start instance";
              item.Click += new EventHandler(ControlStartInstance);
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Stop instance";
              item.Click += new EventHandler(ControlStopInstance);
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Kill instance";
              item.Click += new EventHandler(ControlKillInstance);
              menuItems.Add(item);

              foreach (MenuItem i in menuItems) {
            i.Tag = pInstance;
              }

              pParent.AddRange(menuItems.ToArray());
        }
開發者ID:wcm-io-devops,項目名稱:aem-manager,代碼行數:26,代碼來源:AemActions.cs

示例2: AddOpenMenuItems

        public static void AddOpenMenuItems(Menu.MenuItemCollection pParent, AemInstance pInstance, bool pSetDefaultItem)
        {
            List<MenuItem> menuItems = new List<MenuItem>();
              MenuItem item;

              item = new MenuItem();
              item.Text = "Open Author/Publish";
              item.Click += new EventHandler(OpenAuthorPublish);
              if (pSetDefaultItem) {
            item.DefaultItem = true;
              }
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Open CRX";
              item.Click += new EventHandler(OpenCRX);
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Open CRXDE Lite";
              item.Click += new EventHandler(OpenCRXDELite);
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Open Felix Console";
              item.Click += new EventHandler(OpenFelixConsole);
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Open Folder";
              item.Click += new EventHandler(OpenFolder);
              menuItems.Add(item);

              if (pInstance.AemInstanceType == AemInstanceType.AEM54) {
            item = new MenuItem();
            item.Text = "Open Servlet Engine Admin";
            item.Click += new EventHandler(OpenServletEngineAdmin);
            menuItems.Add(item);
              }

              foreach (MenuItem i in menuItems) {
            i.Tag = pInstance;
              }

              pParent.AddRange(menuItems.ToArray());
        }
開發者ID:wcm-io-devops,項目名稱:aem-manager,代碼行數:46,代碼來源:AemActions.cs

示例3: AddLogMenuItems

        public static void AddLogMenuItems(Menu.MenuItemCollection pParent, AemInstance pInstance)
        {
            List<MenuItem> menuItems = new List<MenuItem>();
              MenuItem item;

              // show dynamic list of current logfiles
              item = new MenuItem();
              item.Text = "Open logfile...";
              item.Popup += LogFilesItem_Popup;
              item.MenuItems.Add(new MenuItem("-- No logfiles --"));
              menuItems.Add(item);

              item = new MenuItem();
              item.Text = "Console window";
              item.Click += new EventHandler(ShowConsoleWindow);
              menuItems.Add(item);

              foreach (MenuItem i in menuItems) {
            i.Tag = pInstance;
              }

              pParent.AddRange(menuItems.ToArray());
        }
開發者ID:wcm-io-devops,項目名稱:aem-manager,代碼行數:23,代碼來源:AemActions.cs


注:本文中的System.Windows.Forms.Menu.AddRange方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。