MonoDevelop.Components.Commands.CommandManager.GetCommand C# (CSharp) Method

GetCommand() public method

Gets a registered command.
public GetCommand ( object cmdId ) : MonoDevelop.Components.Commands.Command
cmdId object /// The identifier of the command ///
return MonoDevelop.Components.Commands.Command
		public Command GetCommand (object cmdId)
		{
			// Include the type name when converting enum members to ids.
			cmdId = ToCommandId (cmdId);
			
			Command cmd;
			if (cmds.TryGetValue (cmdId, out cmd))
				return cmd;
			else
				return null;
		}

Usage Example

示例#1
0
		public virtual Command GetCommand (CommandManager manager)
		{
			if (localCmd != null) {
				if (manager.GetCommand (localCmd.Id) == null)
					manager.RegisterCommand (localCmd);
				localCmd = null;
			}
				
			return manager.GetCommand (cmdId);
		}
All Usage Examples Of MonoDevelop.Components.Commands.CommandManager::GetCommand