/// <summary> /// Determines whether the specified command is supported. /// </summary> /// <param name="command">The command.</param> /// <returns></returns> public bool IsSupported(ApiCommand command) { BuildCommands(); if(command == null || string.IsNullOrEmpty(command.Name)) return false; return mCommands.ContainsKey(command.Name); }
/// <summary> /// Determines whether the specified command is supported. /// </summary> /// <param name="command">The command.</param> /// <returns></returns> public bool IsSupported(ApiCommand command) { BuildCommands(); if (command == null || string.IsNullOrEmpty(command.Name)) { return(false); } return(mCommands.ContainsKey(command.Name)); }
/// <summary> /// Invokes the specified command. /// </summary> /// <param name="command">The command.</param> /// <returns></returns> public object Invoke(ApiCommand command) { BuildCommands(); if(IsSupported(command)) { var function = mCommands[command.Name]; return function(command.Parameters); } return new { Message = string.Format("{0} is not supported!",command?.Name) }; }
/// <summary> /// Invokes the specified command. /// </summary> /// <param name="command">The command.</param> /// <returns></returns> public object Invoke(ApiCommand command) { BuildCommands(); if (IsSupported(command)) { var function = mCommands[command.Name]; return(function(command.Parameters)); } return(new { Message = string.Format("{0} is not supported!", command?.Name) }); }