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


C# Commands.Command类代码示例

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


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

示例1: CommandInfo

		internal CommandInfo (Command cmd)
		{
			text = cmd.Text;
			icon = cmd.Icon;
			accelKey = cmd.AccelKey;
			description = cmd.Description;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:CommandInfo.cs

示例2: CommandResult

 public CommandResult(Command cmd, CommandInfo ci, CommandTargetRoute route, string match, string matchedString, int rank)
     : base(match, matchedString, rank)
 {
     this.ci = ci;
     command = cmd;
     this.route = route;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:SearchResult.cs

示例3: 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:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:CommandEntry.cs

示例4: KeyBindingChangedEventArgs

		public KeyBindingChangedEventArgs (Command command, KeyBinding oldKeyBinding)
		{
			OldKeyBinding = oldKeyBinding;
			Command = command;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:5,代码来源:Command.cs

示例5: KeyBindingChangedEventArgs

		public KeyBindingChangedEventArgs (Command command, string oldBinding)
		{
			this.command = command;
			this.binding = oldBinding;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:Command.cs

示例6: Run

		public void Run (object target, Command cmd, object data)
		{
			MethodInfo mi = (MethodInfo) cmd.HandlerData;
			if (mi != null)
				mi.Invoke (target, new object[] {data} );
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:6,代码来源:CommandManager.cs

示例7: GetCommandKey

		internal static string GetCommandKey (Command cmd)
		{
			if (cmd.Id is Enum)
				return cmd.Id.GetType () + "." + cmd.Id;
			else
				return cmd.Id.ToString ();
		}
开发者ID:hduregger,项目名称:monodevelop,代码行数:7,代码来源:KeyBindingService.cs

示例8: CreateMenuItem

		static Gtk.MenuItem CreateMenuItem (CommandManager manager, Command cmd, object cmdId, bool isArrayMaster, string overrideLabel, bool disabledVisible)
		{
			cmdId = CommandManager.ToCommandId (cmdId);
			if (cmdId == CommandManager.ToCommandId (Command.Separator))
				return new Gtk.SeparatorMenuItem ();
			
			if (cmd == null)
				cmd = manager.GetCommand (cmdId);

			if (cmd == null) {
				MonoDevelop.Core.LoggingService.LogWarning ("Unknown command '{0}'", cmdId);
				return new Gtk.MenuItem ("<Unknown Command>");
			}
			
			if (cmd is CustomCommand) {
				Gtk.Widget child = (Gtk.Widget) Activator.CreateInstance (((CustomCommand)cmd).WidgetType);
				CustomMenuItem ti = new CustomMenuItem ();
				ti.Child = child;
				return ti;
			}
			
			ActionCommand acmd = cmd as ActionCommand;
			if (acmd.ActionType == ActionType.Normal || (isArrayMaster && acmd.CommandArray))
				return new CommandMenuItem (cmdId, manager, overrideLabel, disabledVisible);
			else
				return new CommandCheckMenuItem (cmdId, manager, overrideLabel, disabledVisible);
		}	
开发者ID:zenek-y,项目名称:monodevelop,代码行数:27,代码来源:CommandEntry.cs

示例9: Add

		public void Add (Command cmd)
		{
			cmds.Add (new CommandEntry (cmd));
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CommandEntrySet.cs

示例10: GetSelectedCommandIter

		bool GetSelectedCommandIter (out TreeIter iter, out Command cmd)
		{
			TreeSelection sel = keyTreeView.Selection;
			if (!sel.GetSelected (out iter)) {
				cmd = null;
				return false;
			}
			
			cmd = (Command)filterModel.GetValue (iter, commandCol);
			if (cmd == null)
				return false;
			
			if (keyStore.GetIterFirst (out iter) && FindIterForCommand (cmd, iter, out iter))
				return true;
			
			throw new Exception ("Did not find command in underlying model");
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:17,代码来源:KeyBindingsPanel.cs

示例11: Run

		protected virtual void Run (object target, Command cmd)
		{
			next.Run (target, cmd);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CustomCommandTargetAttribute.cs

示例12: CheckCommand

            internal SearchResult CheckCommand(Command c, CommandTargetRoute route)
            {
                ActionCommand cmd = c as ActionCommand;
                if (cmd == null || cmd.CommandArray)
                    return null;

                int rank;
                string matchString = cmd.Text.Replace ("_", "");
                if (MatchName (matchString, out rank)) {
                    try {
                        var ci = IdeApp.CommandService.GetCommandInfo (cmd.Id, route);
                        if (ci.Enabled && ci.Visible)
                            return new CommandResult (cmd, ci, route, pattern, matchString, rank);
                    } catch (Exception 	ex) {
                        LoggingService.LogError ("Failure while checking command: " + cmd.Id, ex);
                    }
                }
                return null;
            }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:19,代码来源:CommandSearchCategory.cs

示例13:

		void ICommandTargetHandler.Run (object target, Command cmd)
		{
			Run (target, cmd);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CustomCommandTargetAttribute.cs

示例14: Run

			protected override void Run (object target, Command cmd)
			{
				NodeCommandHandler nch = (NodeCommandHandler) target;
				if (nch.tree == null) {
					base.Run (target, cmd);
					return;
				}
				try {
					nch.tree.LockUpdates ();
					base.Run (target, cmd);
				} finally {
					nch.tree.UnlockUpdates ();
				}
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:14,代码来源:NodeCommandHandler.cs

示例15: KeyBindingSelectedEventArgs

			public KeyBindingSelectedEventArgs (IEnumerable<string> keys, int selectedKey, Command command, TreeIter iter)
			{
				if (command == null)
					throw new ArgumentNullException (nameof (command));
				AllKeys = new List<string> (keys);
				if (selectedKey < 0 || ((selectedKey != 0 && AllKeys.Count != 0) && selectedKey >= AllKeys.Count))
					throw new ArgumentOutOfRangeException (nameof (selectedKey));
				SelectedKey =  selectedKey;
				Command = command;
				Iter = iter;
			}
开发者ID:kdubau,项目名称:monodevelop,代码行数:11,代码来源:KeyBindingsPanel.cs


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