本文整理汇总了C#中IMainForm.FindMenuItem方法的典型用法代码示例。如果您正苦于以下问题:C# IMainForm.FindMenuItem方法的具体用法?C# IMainForm.FindMenuItem怎么用?C# IMainForm.FindMenuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMainForm
的用法示例。
在下文中一共展示了IMainForm.FindMenuItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FDMenus
public FDMenus(IMainForm mainForm)
{
// modify the file menu
ToolStripMenuItem fileMenu = (ToolStripMenuItem)mainForm.FindMenuItem("FileMenu");
RecentProjects = new RecentProjectsMenu();
fileMenu.DropDownItems.Insert(5, RecentProjects);
// modify the view menu
ToolStripMenuItem viewMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ViewMenu");
View = new ToolStripMenuItem(TextHelper.GetString("Label.MainMenuItem"));
View.Image = Icons.Project.Img;
viewMenu.DropDownItems.Add(View);
// modify the tools menu - add a nice GUI classpath editor
ToolStripMenuItem toolsMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ToolsMenu");
GlobalClasspaths = new ToolStripMenuItem(TextHelper.GetString("Label.GlobalClasspaths"));
GlobalClasspaths.ShortcutKeys = Keys.F9 | Keys.Control;
GlobalClasspaths.Image = Icons.Classpath.Img;
toolsMenu.DropDownItems.Insert(toolsMenu.DropDownItems.Count - 3, GlobalClasspaths);
mainForm.IgnoredKeys.Add(GlobalClasspaths.ShortcutKeys);
ProjectMenu = new ProjectMenu();
MenuStrip mainMenu = mainForm.MenuStrip;
mainMenu.Items.Insert(5, ProjectMenu);
ToolStrip toolBar = mainForm.ToolStrip;
toolBar.Items.Add(new ToolStripSeparator());
toolBar.Items.Add(RecentProjects.ToolbarSelector);
BuildProject = new ToolStripButton(Icons.Gear.Img);
BuildProject.Name = "BuildProject";
BuildProject.ToolTipText = TextHelper.GetString("Label.BuildProject").Replace("&", "");
toolBar.Items.Add(BuildProject);
TestMovie = new ToolStripButton(Icons.GreenCheck.Img);
TestMovie.Name = "TestMovie";
TestMovie.ToolTipText = TextHelper.GetString("Label.TestMovie").Replace("&", "");
toolBar.Items.Add(TestMovie);
ConfigurationSelector = new ToolStripComboBox();
ConfigurationSelector.Name = "ConfigurationSelector";
ConfigurationSelector.ToolTipText = TextHelper.GetString("ToolTip.SelectConfiguration");
ConfigurationSelector.Items.AddRange(new string[] { TextHelper.GetString("Info.Debug"), TextHelper.GetString("Info.Release") });
ConfigurationSelector.DropDownStyle = ComboBoxStyle.DropDownList;
ConfigurationSelector.AutoSize = false;
ConfigurationSelector.Enabled = false;
ConfigurationSelector.Width = 85;
ConfigurationSelector.Margin = new Padding(1, 0, 0, 0);
ConfigurationSelector.FlatStyle = PluginBase.MainForm.Settings.ComboBoxFlatStyle;
ConfigurationSelector.Font = PluginBase.Settings.DefaultFont;
toolBar.Items.Add(ConfigurationSelector);
}
示例2: FDMenus
public FDMenus(IMainForm mainForm)
{
// modify the file menu
ToolStripMenuItem fileMenu = (ToolStripMenuItem)mainForm.FindMenuItem("FileMenu");
RecentProjects = new RecentProjectsMenu();
fileMenu.DropDownItems.Insert(5, RecentProjects);
// modify the view menu
ToolStripMenuItem viewMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ViewMenu");
View = new ToolStripMenuItem(TextHelper.GetString("Label.MainMenuItem"));
View.Image = Icons.Project.Img;
viewMenu.DropDownItems.Add(View);
PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowProject", View);
// modify the tools menu - add a nice GUI classpath editor
ToolStripMenuItem toolsMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ToolsMenu");
GlobalClasspaths = new ToolStripMenuItem(TextHelper.GetString("Label.GlobalClasspaths"));
GlobalClasspaths.ShortcutKeys = Keys.F9 | Keys.Control;
GlobalClasspaths.Image = Icons.Classpath.Img;
toolsMenu.DropDownItems.Insert(toolsMenu.DropDownItems.Count - 4, GlobalClasspaths);
PluginBase.MainForm.RegisterShortcutItem("ToolsMenu.GlobalClasspaths", GlobalClasspaths);
ProjectMenu = new ProjectMenu();
MenuStrip mainMenu = mainForm.MenuStrip;
mainMenu.Items.Insert(5, ProjectMenu);
ToolStrip toolBar = mainForm.ToolStrip;
toolBar.Items.Add(new ToolStripSeparator());
toolBar.Items.Add(RecentProjects.ToolbarSelector);
BuildProject = new ToolStripButton(Icons.Gear.Img);
BuildProject.Name = "BuildProject";
BuildProject.ToolTipText = TextHelper.GetStringWithoutMnemonics("Label.BuildProject");
PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.BuildProject", BuildProject);
toolBar.Items.Add(BuildProject);
TestMovie = new ToolStripButton(Icons.GreenCheck.Img);
TestMovie.Name = "TestMovie";
TestMovie.ToolTipText = TextHelper.GetStringWithoutMnemonics("Label.TestMovie");
PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.TestMovie", TestMovie);
toolBar.Items.Add(TestMovie);
ConfigurationSelector = new ToolStripComboBoxEx();
ConfigurationSelector.Name = "ConfigurationSelector";
ConfigurationSelector.ToolTipText = TextHelper.GetString("ToolTip.SelectConfiguration");
ConfigurationSelector.Items.AddRange(new string[] { TextHelper.GetString("Info.Debug"), TextHelper.GetString("Info.Release") });
ConfigurationSelector.DropDownStyle = ComboBoxStyle.DropDownList;
ConfigurationSelector.AutoSize = false;
ConfigurationSelector.Enabled = false;
ConfigurationSelector.Width = ScaleHelper.Scale(GetThemeWidth("ProjectManager.TargetBuildSelectorWidth", 85));
ConfigurationSelector.Margin = new Padding(1, 0, 0, 0);
ConfigurationSelector.FlatStyle = PluginBase.MainForm.Settings.ComboBoxFlatStyle;
ConfigurationSelector.Font = PluginBase.Settings.DefaultFont;
toolBar.Items.Add(ConfigurationSelector);
PluginBase.MainForm.RegisterShortcutItem("ProjectMenu.ConfigurationSelectorToggle", Keys.Control | Keys.F5);
PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.ConfigurationSelectorToggle", ConfigurationSelector);
TargetBuildSelector = new ToolStripComboBoxEx();
TargetBuildSelector.Name = "TargetBuildSelector";
TargetBuildSelector.ToolTipText = TextHelper.GetString("ToolTip.TargetBuild");
TargetBuildSelector.AutoSize = false;
TargetBuildSelector.Width = ScaleHelper.Scale(GetThemeWidth("ProjectManager.ConfigurationSelectorWidth", 120));
TargetBuildSelector.Margin = new Padding(1, 0, 0, 0);
TargetBuildSelector.FlatStyle = PluginBase.MainForm.Settings.ComboBoxFlatStyle;
TargetBuildSelector.Font = PluginBase.Settings.DefaultFont;
toolBar.Items.Add(TargetBuildSelector);
PluginBase.MainForm.RegisterShortcutItem("ProjectMenu.TargetBuildSelector", Keys.Control | Keys.F7);
PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.TargetBuildSelector", TargetBuildSelector);
EnableTargetBuildSelector(false);
}