Пример #1
0
 public static IAppMessage CommandCompletionError(ICommandResult result, IAppMessage CompletionMessage)
 => error("Successfully executed the @CommandName command but was unable to complete it: @CompletionError",
          new
 {
     result.Spec.CommandName,
     CompletionError = CompletionMessage.Format()
 });
Пример #2
0
 public static IAppMessage CommandExecutionAndCompletionError(ICommandResult result, IAppMessage CompletionMessage)
 => error("An error occurred while executing the @CommandName command and also unabled to complete it: Execution Error - @ExecutionError; Completion Error = @CompletionError",
          new
 {
     result.Spec.CommandName,
     ExecutionError  = result.Message.Format(),
     CompletionError = CompletionMessage.Format()
 });
Пример #3
0
    /// <summary>
    /// Renders a message for display
    /// </summary>
    /// <param name="Message"></param>
    /// <param name="Orignator"></param>
    /// <returns></returns>
    public static string Format(this IAppMessage Message, SystemNodeIdentifier Orignator)
    {
        var tsFmt = Message.Timestamp.FormatTimestamp();

        return(concat(tsFmt, " ", Orignator, "> ", Message.Format(false)));
    }
Пример #4
0
 internal static string Format(IAppMessage message, string prepend, string postpend, bool ts)
 => (!string.IsNullOrWhiteSpace(prepend) ? $"{prepend} {message.Format(false)}" : message.Format(ts))
 + (!string.IsNullOrWhiteSpace(postpend) ? $" {postpend}" : String.Empty);
Пример #5
0
 public static T fail <T>(IAppMessage reason, [CallerMemberName] string member = null,
                          [CallerFilePath] string path = null, [CallerLineNumber] int line = 0)
 => throw new Exception <int>(reason.Format(false), member, path, line);
Пример #6
0
 public override string ToString()
 => Message.Format();