CommandResults Methods
ClassMethods10 members
A factory for
ExecuteCommandResult. Produces a canceled result.
public static class CommandResults{ public static ExecuteCommandResult Canceled() { // ... }} Produces an unsuccessful result with an error message.
public static class CommandResults{ public static ExecuteCommandResult Failure( string? errorMessage = null) { // ... }}Parameters
errorMessagestring?optionalAn optional error message.Failure(string, string, CommandResultFormat)Section titled Failure(string, string, CommandResultFormat)staticExecuteCommandResult Produces an unsuccessful result with an error message and result data.
public static class CommandResults{ public static ExecuteCommandResult Failure( string errorMessage, string result, CommandResultFormat resultFormat = CommandResultFormat.Text) { // ... }}Parameters
errorMessagestringThe error message.resultstringThe result data.resultFormatCommandResultFormatoptionalThe format of the result data. Defaults to CommandResultFormat.Text.Failure(string, CommandResultData)Section titled Failure(string, CommandResultData)staticExecuteCommandResult Produces an unsuccessful result with an error message and a value.
public static class CommandResults{ public static ExecuteCommandResult Failure( string errorMessage, CommandResultData value) { // ... }}Parameters
errorMessagestringThe error message.valueCommandResultDataThe value produced by the command. Produces an unsuccessful result from an
Exception. Exception.Message is used as the error message. public static class CommandResults{ public static ExecuteCommandResult Failure( Exception exception) { // ... }}Parameters
exceptionExceptionThe exception to get the error message from. Produces a success result.
public static class CommandResults{ public static ExecuteCommandResult Success() { // ... }} Produces a success result.
public static class CommandResults{ public static ExecuteCommandResult Success( string message) { // ... }}Parameters
messagestringSuccess(string, string, CommandResultFormat)Section titled Success(string, string, CommandResultFormat)staticExecuteCommandResult Produces a success result with a message and result data.
public static class CommandResults{ public static ExecuteCommandResult Success( string message, string result, CommandResultFormat resultFormat = CommandResultFormat.Text) { // ... }}Parameters
messagestringThe message associated with the result.resultstringThe result data.resultFormatCommandResultFormatoptionalThe format of the result data. Defaults to CommandResultFormat.Text.Success(string, string, CommandResultFormat, bool)Section titled Success(string, string, CommandResultFormat, bool)staticExecuteCommandResult Produces a success result with a message and result data.
public static class CommandResults{ public static ExecuteCommandResult Success( string message, string result, CommandResultFormat resultFormat, bool displayImmediately) { // ... }}Parameters
messagestringThe message associated with the result.resultstringThe result data.resultFormatCommandResultFormatThe format of the result data.displayImmediatelyboolA value indicating whether the result data should be displayed immediately in the dashboard.Remarks
When
displayImmediately is true, the dashboard opens the result dialog automatically when the command completes. Other clients can still read the result data from ExecuteCommandResult.Data. Success(string, CommandResultData)Section titled Success(string, CommandResultData)staticExecuteCommandResult Produces a success result with a message and a value.
public static class CommandResults{ public static ExecuteCommandResult Success( string message, CommandResultData value) { // ... }}Parameters
messagestringThe message associated with the result.valueCommandResultDataThe value produced by the command.