當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。