当前位置: 首页>>代码示例>>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;未经允许,请勿转载。