本文整理汇总了C#中MonoDevelop.Components.Commands.CommandManager.CreateCommandEntrySet方法的典型用法代码示例。如果您正苦于以下问题:C# CommandManager.CreateCommandEntrySet方法的具体用法?C# CommandManager.CreateCommandEntrySet怎么用?C# CommandManager.CreateCommandEntrySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Components.Commands.CommandManager
的用法示例。
在下文中一共展示了CommandManager.CreateCommandEntrySet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetGlobalMenu
public override bool SetGlobalMenu (CommandManager commandManager, string commandMenuAddinPath, string appMenuAddinPath)
{
if (setupFail)
return false;
try {
InitApp (commandManager);
CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
MacMainMenu.Recreate (commandManager, ces);
CommandEntrySet aes = commandManager.CreateCommandEntrySet (appMenuAddinPath);
MacMainMenu.SetAppMenuItems (commandManager, aes);
} catch (Exception ex) {
try {
MacMainMenu.Destroy (true);
} catch {}
LoggingService.LogError ("Could not install global menu", ex);
setupFail = true;
return false;
}
return true;
}
示例2: SetGlobalMenu
public override bool SetGlobalMenu (CommandManager commandManager, string commandMenuAddinPath, string appMenuAddinPath)
{
if (setupFail)
return false;
try {
InitApp (commandManager);
NSApplication.SharedApplication.HelpMenu = null;
var rootMenu = NSApplication.SharedApplication.MainMenu;
if (rootMenu == null) {
rootMenu = new NSMenu ();
NSApplication.SharedApplication.MainMenu = rootMenu;
} else {
rootMenu.RemoveAllItems ();
}
CommandEntrySet appCes = commandManager.CreateCommandEntrySet (appMenuAddinPath);
rootMenu.AddItem (new MDSubMenuItem (commandManager, appCes));
CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
foreach (CommandEntry ce in ces) {
rootMenu.AddItem (new MDSubMenuItem (commandManager, (CommandEntrySet) ce));
}
} catch (Exception ex) {
try {
var m = NSApplication.SharedApplication.MainMenu;
if (m != null) {
m.Dispose ();
}
NSApplication.SharedApplication.MainMenu = null;
} catch {}
LoggingService.LogError ("Could not install global menu", ex);
setupFail = true;
return false;
}
return true;
}
示例3: SetGlobalMenu
public override bool SetGlobalMenu (CommandManager commandManager, string commandMenuAddinPath)
{
if (setupFail)
return false;
try {
InitApp (commandManager);
CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
OSXMenu.Recreate (commandManager, ces, ignoreCommands);
} catch (Exception ex) {
try {
OSXMenu.Destroy (true);
} catch {}
MonoDevelop.Core.LoggingService.LogError ("Could not install global menu", ex);
setupFail = true;
return false;
}
return true;
}