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


C# Commands.CommandManager类代码示例

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


CommandManager类属于MonoDevelop.Components.Commands命名空间,在下文中一共展示了CommandManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MDSubMenuItem

		public MDSubMenuItem (CommandManager manager, CommandEntrySet ces, CommandSource commandSource = CommandSource.MainMenu, object initialCommandTarget = null)
		{
			this.ces = ces;

			this.Submenu = new MDMenu (manager, ces, commandSource, initialCommandTarget);
			this.Title = this.Submenu.Title;
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:7,代码来源:MDSubMenuItem.cs

示例2: MenuButtonEntry

		public MenuButtonEntry (Gtk.Entry entry, Gtk.Button button)
		{
			if (entry == null) entry = new Gtk.Entry ();
			if (button == null) button = new Gtk.Button (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.Out));
			
			this.entry = entry;
			this.button = button;
			
			manager = new CommandManager ();
			manager.RegisterGlobalHandler (this);
			
			if (entry.Parent == null)
				PackStart (entry, true, true, 0);
			if (button.Parent == null)
				PackStart (button, false, false, 2);
			
			ActionCommand cmd = new ActionCommand ("InsertOption", "InsertOption", null);
			cmd.CommandArray = true;
			manager.RegisterCommand (cmd);
			entrySet = new CommandEntrySet ();
			entrySet.AddItem ("InsertOption");
			
			button.Clicked += ShowQuickInsertMenu;
			button.StateChanged += ButtonStateChanged;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:25,代码来源:MenuButtonEntry.cs

示例3: MDSubMenuItem

		public MDSubMenuItem (CommandManager manager, CommandEntrySet ces)
		{
			this.ces = ces;

			this.Submenu = new MDMenu (manager, ces);
			this.Title = this.Submenu.Title;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:MDSubMenuItem.cs

示例4: GetCommand

		public virtual Command GetCommand (CommandManager manager)
		{
			if (localCmd != null) {
				if (manager.GetCommand (localCmd.Id) == null)
					manager.RegisterCommand (localCmd);
				localCmd = null;
			}
				
			return manager.GetCommand (cmdId);
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:10,代码来源:CommandEntry.cs

示例5: MDMenuItem

		public MDMenuItem (CommandManager manager, CommandEntry ce, ActionCommand command)
		{
			this.ce = ce;
			this.manager = manager;

			isArrayItem = command.CommandArray;

			Target = this;
			Action = ActionSel;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:MDMenuItem.cs

示例6: CommandMenuItem

		public CommandMenuItem (object commandId, CommandManager commandManager, string overrideLabel, bool disabledVisible): base ("")
		{
			this.commandId = commandId;
			this.commandManager = commandManager;
			this.overrideLabel = overrideLabel;
			this.disabledVisible = disabledVisible;
			ActionCommand cmd = commandManager.GetCommand (commandId) as ActionCommand;
			if (cmd != null)
				isArray = cmd.CommandArray;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:10,代码来源:CommandMenuItem.cs

示例7: CommandCheckMenuItem

		public CommandCheckMenuItem (object commandId, CommandManager commandManager, string overrideLabel, bool disabledVisible): base ("")
		{
			this.commandId = commandId;
			this.commandManager = commandManager;
			this.overrideLabel = overrideLabel;
			this.disabledVisible = disabledVisible;
			
			ActionCommand cmd = commandManager.GetCommand (commandId) as ActionCommand;
			if (cmd != null && cmd.ActionType == ActionType.Radio)
				this.DrawAsRadio = true;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:CommandCheckMenuItem.cs

示例8: MDMenuItem

		public MDMenuItem (CommandManager manager, CommandEntry ce, ActionCommand command, CommandSource commandSource, object initialCommandTarget)
		{
			this.ce = ce;
			this.manager = manager;
			this.initialCommandTarget = initialCommandTarget;
			this.commandSource = commandSource;

			isArrayItem = command.CommandArray;

			Target = this;
			Action = ActionSel;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:MDMenuItem.cs

示例9: MDMenu

		public MDMenu (CommandManager manager, CommandEntrySet ces, CommandSource commandSource, object initialCommandTarget)
		{
			this.WeakDelegate = this;

			AutoEnablesItems = false;

			Title = (ces.Name ?? "").Replace ("_", "");

			foreach (CommandEntry ce in ces) {
				if (ce.CommandId == Command.Separator) {
					AddItem (NSMenuItem.SeparatorItem);
					if (!string.IsNullOrEmpty (ce.OverrideLabel))
						AddItem (new MDMenuHeaderItem (ce.OverrideLabel));
					continue;
				}

				if (string.Equals (ce.CommandId as string, servicesID, StringComparison.Ordinal)) {
					AddItem (new MDServicesMenuItem ());
					continue;
				}

				var subset = ce as CommandEntrySet;
				if (subset != null) {
					AddItem (new MDSubMenuItem (manager, subset, commandSource, initialCommandTarget));
					continue;
				}

				var lce = ce as LinkCommandEntry;
				if (lce != null) {
					AddItem (new MDLinkMenuItem (lce));
					continue;
				}

				Command cmd = manager.GetCommand (ce.CommandId);
				if (cmd == null) {
					LoggingService.LogError ("MacMenu: '{0}' maps to null command", ce.CommandId);
					continue;
				}

				if (cmd is CustomCommand) {
					LoggingService.LogWarning ("MacMenu: '{0}' is unsupported custom-rendered command' '", ce.CommandId);
					continue;
				}

				var acmd = cmd as ActionCommand;
				if (acmd == null) {
					LoggingService.LogWarning ("MacMenu: '{0}' has unknown command type '{1}'", cmd.GetType (), ce.CommandId);
					continue;
				}

				AddItem (new MDMenuItem (manager, ce, acmd, commandSource, initialCommandTarget));
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:53,代码来源:MDMenu.cs

示例10: CreateMenuItem

		internal protected override Gtk.MenuItem CreateMenuItem (CommandManager manager)
		{
			Gtk.ImageMenuItem item = new Gtk.ImageMenuItem (text != null ? text : url);
			item.Image = new Gtk.Image (icon, Gtk.IconSize.Menu);
			item.Activated += new EventHandler (HandleActivation);
			item.Selected += delegate {
				CommandInfo ci = new CommandInfo (Text);
				ci.Icon = icon;
				ci.Description = AddinManager.CurrentLocalizer.GetString ("Open {0}", Url);
				manager.NotifySelected (ci);
			};
			item.Deselected += delegate {
				manager.NotifyDeselected ();
			};
			return item;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:16,代码来源:LinkCommandEntry.cs

示例11: CreateToolItem

		internal protected virtual Gtk.ToolItem CreateToolItem (CommandManager manager)
		{
			if (cmdId == CommandManager.ToCommandId (Command.Separator))
				return new Gtk.SeparatorToolItem ();

			Command cmd = GetCommand (manager);
			if (cmd == null)
				return new Gtk.ToolItem ();
			
			if (cmd is CustomCommand) {
				Gtk.Widget child = (Gtk.Widget) Activator.CreateInstance (((CustomCommand)cmd).WidgetType);
				Gtk.ToolItem ti;
				if (child is Gtk.ToolItem)
					ti = (Gtk.ToolItem) child;
				else {
					ti = new Gtk.ToolItem ();
					ti.Child = child;
				}
				if (cmd.Text != null && cmd.Text.Length > 0) {
					//strip "_" accelerators from tooltips
					string text = cmd.Text;
					while (true) {
						int underscoreIndex = text.IndexOf ('_');
						if (underscoreIndex > -1)
							text = text.Remove (underscoreIndex, 1);
						else
							break;
					}
					ti.TooltipText = text;
				}
				return ti;
			}
			
			ActionCommand acmd = cmd as ActionCommand;
			if (acmd == null)
				throw new InvalidOperationException ("Unknown cmd type.");

			if (acmd.CommandArray) {
				CommandMenu menu = new CommandMenu (manager);
				menu.Append (CreateMenuItem (manager));
				return new MenuToolButton (menu, acmd.Icon);
			}
			else if (acmd.ActionType == ActionType.Normal)
				return new CommandToolButton (cmdId, manager);
			else
				return new CommandToggleToolButton (cmdId, manager);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:47,代码来源:CommandEntry.cs

示例12: Start

		public static void Start (CommandManager commandManager, bool publishServer)
		{
			AutoTestService.commandManager = commandManager;
			
			string sref = Environment.GetEnvironmentVariable ("MONO_AUTOTEST_CLIENT");
			if (!string.IsNullOrEmpty (sref)) {
				Console.WriteLine ("AutoTest service starting");
				MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
				byte[] data = Convert.FromBase64String (sref);
				MemoryStream ms = new MemoryStream (data);
				BinaryFormatter bf = new BinaryFormatter ();
				IAutoTestClient client = (IAutoTestClient) bf.Deserialize (ms);
				client.Connect (manager.AttachClient (client));
			}
			if (publishServer && !manager.IsClientConnected) {
				MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
				BinaryFormatter bf = new BinaryFormatter ();
				ObjRef oref = RemotingServices.Marshal (manager);
				MemoryStream ms = new MemoryStream ();
				bf.Serialize (ms, oref);
				sref = Convert.ToBase64String (ms.ToArray ());
				File.WriteAllText (SessionReferenceFile, sref);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:24,代码来源:AutoTestService.cs

示例13: CommandToolButton

		public CommandToolButton (object commandId, CommandManager commandManager): base ("")
		{
			this.commandId = commandId;
			this.commandManager = commandManager;
			UseUnderline = true;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:6,代码来源:CommandToolButton.cs

示例14: CreateMenuItem

		internal static Gtk.MenuItem CreateMenuItem (CommandManager manager, object cmdId, bool isArrayMaster)		
		{
			return CreateMenuItem (manager, null, cmdId, isArrayMaster, null, true);
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:4,代码来源:CommandEntry.cs

示例15: InitApp

		void InitApp (CommandManager commandManager)
		{
			if (initedApp)
				return;

			commandManager.CommandActivating += OnCommandActivating;

			//mac-ify these command names
			commandManager.GetCommand (EditCommands.MonodevelopPreferences).Text = GettextCatalog.GetString ("Preferences...");
			commandManager.GetCommand (EditCommands.DefaultPolicies).Text = GettextCatalog.GetString ("Custom Policies...");
			commandManager.GetCommand (HelpCommands.About).Text = GettextCatalog.GetString ("About {0}", BrandingService.ApplicationName);
			commandManager.GetCommand (MacIntegrationCommands.HideWindow).Text = GettextCatalog.GetString ("Hide {0}", BrandingService.ApplicationName);
			commandManager.GetCommand (ToolCommands.AddinManager).Text = GettextCatalog.GetString ("Add-in Manager...");
			
			initedApp = true;
			
			IdeApp.Workbench.RootWindow.DeleteEvent += HandleDeleteEvent;

			if (MacSystemInformation.OsVersion >= MacSystemInformation.Lion) {
				IdeApp.Workbench.RootWindow.Realized += (sender, args) => {
					var win = GtkQuartz.GetWindow ((Gtk.Window) sender);
					win.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary;
				};
			}
		}
开发者ID:pjt33,项目名称:monodevelop,代码行数:25,代码来源:MacPlatform.cs


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