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


C# CommandManager.CreateCommandEntrySet方法代码示例

本文整理汇总了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;
		}
开发者ID:kekekeks,项目名称:monodevelop,代码行数:23,代码来源:MacPlatform.cs

示例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;
		}
开发者ID:pjt33,项目名称:monodevelop,代码行数:39,代码来源:MacPlatform.cs

示例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;
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:20,代码来源:MacPlatform.cs


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