From 18af4d37146b6deecff6ff8f9227b29f5630be49 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sat, 27 Aug 2016 17:34:21 -0400 Subject: [PATCH] added success indicator when processing trades --- Program.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Program.cs b/Program.cs index b8e6621..cb5d3e9 100644 --- a/Program.cs +++ b/Program.cs @@ -439,22 +439,25 @@ public static class Program Console.WriteLine("Processing..."); for (var t = 0; t < trades.Length; t++) { + bool success = false; switch (tradeActions[t]) { case TradeAction.Accept: - if (Verbose) Console.WriteLine($"Accepting {trades[t].Description}..."); - account.AcceptConfirmation(trades[t]); + if (Verbose) Console.Write($"Accepting {trades[t].Description}..."); + success = account.AcceptConfirmation(trades[t]); break; case TradeAction.Deny: - if (Verbose) Console.WriteLine($"Denying {trades[t].Description}..."); - account.AcceptConfirmation(trades[t]); + if (Verbose) Console.Write($"Denying {trades[t].Description}..."); + success = account.AcceptConfirmation(trades[t]); break; case TradeAction.Ignore: - if (Verbose) Console.WriteLine($"Ignoring {trades[t].Description}..."); + if (Verbose) Console.Write($"Ignoring {trades[t].Description}..."); + success = true; break; default: throw new ArgumentOutOfRangeException(); } + if (Verbose) Console.WriteLine(success); } Console.WriteLine("Done."); }