コード例 #1
0
        public override IMenuItem AddButton(string text, string key, Bitmap icon, PluginIdentity identity)
        {
            var item = new ToolStripMenuItem {
                Text = text
            };
            var menuItem = AddItem(item, identity, key, false);

            MenuIcon.AssignIcon(menuItem, icon);
            return(menuItem);
        }
コード例 #2
0
        protected override IDropDownMenuItem AddDropDown(string text, string key, Bitmap icon, PluginIdentity identity)
        {
            var item = new ParentBarItem(text)
            {
                Padding = new Point(TOOLBAR_ITEM_PADDING_X, TOOLBAR_ITEM_PADDING_Y)
            };;
            var menuItem = AddItem(item, identity, key) as IDropDownMenuItem;

            MenuIcon.AssignIcon(menuItem, icon);
            return(menuItem);
        }
コード例 #3
0
        public override IMenuItem AddButton(string text, string key, Bitmap icon, PluginIdentity pluginIdentity)
        {
            var item = new BarItem(text)
            {
                Padding = new Point(TOOLBAR_ITEM_PADDING_X, TOOLBAR_ITEM_PADDING_Y)
            };
            var menuItem = AddItem(item, pluginIdentity, key);

            MenuIcon.AssignIcon(menuItem, icon);
            return(menuItem);
        }
コード例 #4
0
        private IDropDownMenuItem AddDropDownCore(ToolStripDropDownItem item, string text, string key,
                                                  Bitmap icon, PluginIdentity identity, bool label)
        {
            item.Text         = text;
            item.Padding      = new Padding(ItemPadding);
            item.ImageScaling = ToolStripItemImageScaling.SizeToFit;

            var menuItem = AddItem(item, identity, key, label) as IDropDownMenuItem;

            MenuIcon.AssignIcon(menuItem, icon);
            return(menuItem);
        }
コード例 #5
0
 protected override IDropDownMenuItem AddDropDown(string text, string key, Bitmap icon, PluginIdentity identity, bool isFirst = false)
 {
     if (!isFirst)
     {
         var item = new ParentBarItem(text)
         {
             Padding = new Point(TOOLBAR_ITEM_PADDING_X, TOOLBAR_ITEM_PADDING_Y)
         };
         var menuItem = AddItem(item, identity, key) as IDropDownMenuItem;
         MenuIcon.AssignIcon(menuItem, icon);
         return(menuItem);
     }
     else
     {
         var item = new ToolStripTabItem()
         {
             Text = text, Name = key, Image = icon,
         };
         var menuItem = AddItem(item, identity, key) as IDropDownMenuItem;
         MenuIcon.AssignIcon(menuItem, icon);
         return(menuItem);
     }
 }