private void CommandPerformedHandler(CommandPerformedData data) { if (data is null || data.UserName is null) { return; } if (this.User.Credentials is null) { return; } if (UserNameComparer.Equals(data.UserName, this.User.Credentials.UserName)) { return; } string successDescription = data.IsSuccess ? "successfully" : "unsuccessfully"; string responseTitle = data.IsSuccess ? "Response" : "Error"; this.WriteLine(null); this.WriteLine(Invariant($"User '{data.UserName}' {successDescription} performed the command: {data.CommandLine}")); this.WriteLine(Invariant($"{responseTitle} message: {data.ResponseMessage}")); this.WriteLine(null); }
public void OnCommandPerformed(CommandPerformedData data) => this.commandPerformedHandler?.Invoke(data);