当前位置: 首页>>代码示例>>C#>>正文


C# CommandEntrySet.AddItemSet方法代码示例

本文整理汇总了C#中MonoDevelop.Components.Commands.CommandEntrySet.AddItemSet方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEntrySet.AddItemSet方法的具体用法?C# CommandEntrySet.AddItemSet怎么用?C# CommandEntrySet.AddItemSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Components.Commands.CommandEntrySet的用法示例。


在下文中一共展示了CommandEntrySet.AddItemSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BugsViewWidget


//.........这里部分代码省略.........
            bugsList.DragBegin += HandleBugsListDragBegin;
            bugsList.DragDataReceived += HandleBugsListDragDataReceived;
            bugsList.DragEnd += HandleBugsListDragEnd;
            bugsList.DragMotion += HandleBugsListDragMotion;

            bugsList.Selection.Mode = SelectionMode.Multiple;
            bugsList.Selection.Changed += HandleBugsListSelectionChanged;

            Gtk.TargetEntry[] targets = new Gtk.TargetEntry [] { new TargetEntry ("bug", TargetFlags.Widget, 0) };
            //			bugsList.EnableModelDragSource (Gdk.ModifierType.None, targets, Gdk.DragAction.Move);
            Gtk.Drag.SourceSet (bugsList, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Move);
            bugsList.EnableModelDragDest (targets, Gdk.DragAction.Move);

            ActionCommand setPrioHigh = new ActionCommand (LocalCommands.SetPriorityHigh, GettextCatalog.GetString ("Set High Priority (Bottom)"));
            ActionCommand setPrioMed = new ActionCommand (LocalCommands.SetPriorityMed, GettextCatalog.GetString ("Set Medium Priority (Bottom)"));
            ActionCommand setPrioLow = new ActionCommand (LocalCommands.SetPriorityLow, GettextCatalog.GetString ("Set Low Priority (Bottom)"));
            ActionCommand setPrioHighTop = new ActionCommand (LocalCommands.SetPriorityHighTop, GettextCatalog.GetString ("Set High Priority (Top)"));
            ActionCommand setPrioMedTop = new ActionCommand (LocalCommands.SetPriorityMedTop, GettextCatalog.GetString ("Set Medium Priority (Top)"));
            ActionCommand setPrioLowTop = new ActionCommand (LocalCommands.SetPriorityLowTop, GettextCatalog.GetString ("Set Low Priority (Top)"));
            ActionCommand toggleRead = new ActionCommand (LocalCommands.ToggleNewMarker, GettextCatalog.GetString ("Mark as Changed"));
            ActionCommand openInBrowser = new ActionCommand (LocalCommands.OpenInBrowser, GettextCatalog.GetString ("Open in Browser"));
            ActionCommand refreshBugInfo = new ActionCommand (LocalCommands.RefreshFromSever, GettextCatalog.GetString ("Refresh From Server"));
            ActionCommand setTagCommand = new ActionCommand (LocalCommands.TagsList, GettextCatalog.GetString ("Set tag"));
            ActionCommand clearTagsCommand = new ActionCommand (LocalCommands.ClearTags, GettextCatalog.GetString ("Clear Tags"));
            ActionCommand editTagsCommand = new ActionCommand (LocalCommands.EditTags, GettextCatalog.GetString ("Edit Tags"));
            setTagCommand.CommandArray = true;
            setTagCommand.ActionType = ActionType.Check;

            menuSet = new CommandEntrySet ();
            menuSet.Add (openInBrowser);
            menuSet.AddSeparator ();
            menuSet.Add (setPrioHighTop);
            menuSet.Add (setPrioHigh);
            menuSet.Add (setPrioMedTop);
            menuSet.Add (setPrioMed);
            menuSet.Add (setPrioLowTop);
            menuSet.Add (setPrioLow);
            menuSet.AddSeparator ();

            CommandEntrySet tagsSet = menuSet.AddItemSet (GettextCatalog.GetString ("Tags"));
            tagsSet.Add (setTagCommand);
            tagsSet.AddSeparator ();
            tagsSet.Add (clearTagsCommand);
            tagsSet.Add (editTagsCommand);

            menuSet.Add (toggleRead);
            menuSet.AddSeparator ();
            menuSet.Add (refreshBugInfo);

            // Manage menu

            ActionCommand newServer = new ActionCommand (LocalCommands.NewServer, GettextCatalog.GetString ("Add Server..."));
            ActionCommand deleteServer = new ActionCommand (LocalCommands.DeleteServer, GettextCatalog.GetString ("Remove Server"));
            ActionCommand editServer = new ActionCommand (LocalCommands.EditServer, GettextCatalog.GetString ("Edit Server"));
            CommandEntrySet adminMenuSet = new CommandEntrySet ();
            adminMenuSet.Add (newServer);
            adminMenuSet.Add (deleteServer);
            adminMenuSet.Add (editServer);

            // Edit button

            MenuButton editButton = new MenuButton ();
            editButton.Relief = ReliefStyle.None;
            editButton.Label = GettextCatalog.GetString ("Manage");
            editButton.MenuCreator = delegate {
                return IdeApp.CommandService.CreateMenu (adminMenuSet);
            };
            hboxHeader.PackStart (editButton, false, false, 0);
            Box.BoxChild ch = (Box.BoxChild) hboxHeader [editButton];
            ch.Position = 1;
            editButton.ShowAll ();

            // Group by button

            CommandEntrySet groupByMenuSet = new CommandEntrySet ();
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByNothing, GettextCatalog.GetString ("Don't group")));
            groupByMenuSet.AddSeparator ();
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByComponent, GettextCatalog.GetString ("Component")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByMilestone, GettextCatalog.GetString ("Target Milestone")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByOwner, GettextCatalog.GetString ("Assigned To")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupBySeverity, GettextCatalog.GetString ("Severity")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByStatus, GettextCatalog.GetString ("Status")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByTag, GettextCatalog.GetString ("Tag")));

            MenuButton groupButton = new MenuButton ();
            groupButton.Relief = ReliefStyle.None;
            groupButton.Label = GettextCatalog.GetString ("Group By");
            groupButton.MenuCreator = delegate {
                return IdeApp.CommandService.CreateMenu (groupByMenuSet);
            };
            hboxHeader.PackStart (groupButton, false, false, 0);
            ch = (Box.BoxChild) hboxHeader [groupButton];
            ch.Position = 4;
            groupButton.ShowAll ();

            // Load data

            FillServers ();
            FillServer (null);
        }
开发者ID:slluis,项目名称:bugziller,代码行数:101,代码来源:BugsViewWidget.cs


注:本文中的MonoDevelop.Components.Commands.CommandEntrySet.AddItemSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。