public static void DisplayTable(string label, ISymbolConversionResponse response, int maxCols, int maxRows = 0) { Console.WriteLine($"\n{label}"); if (response.IsSuccess) { if (FormatTable(response.Data.Table, maxCols, maxRows)) { // Warnings if (response.Data.Warnings.Count > 0) { Console.WriteLine($"\n{string.Join(",", response.Data.Warnings.Select(warning => $"{warning}"))}"); } } else { Console.WriteLine($"Response contains an empty data set: {response.Data?.Raw}"); } } else { Console.WriteLine($"IsSuccess: {response.IsSuccess}\n{response.HttpStatus}"); } Console.Write("\nHit <enter> to continue..."); Console.ReadLine(); }
private static void DisplayResponse(string label, ISymbolConversionResponse response) { Console.WriteLine($"\n{label}\n"); if (response.IsSuccess) { // Matches foreach (KeyValuePair <string, ISymbolConversionTable> match in response.Data.Matches) { Console.WriteLine($"{match.Key} - {match.Value.Description}"); if (match.Value.RIC != null) { Console.WriteLine($"\tRIC: {match.Value.RIC}"); } if (match.Value.ISIN != null) { Console.WriteLine($"\tISIN: {match.Value.ISIN}"); } if (match.Value.CUSIP != null) { Console.WriteLine($"\tCUSIP: {match.Value.CUSIP}"); } if (match.Value.PermID != null) { Console.WriteLine($"\tPermID: {match.Value.PermID}"); } if (match.Value.SEDOL != null) { Console.WriteLine($"\tSEDOL: {match.Value.SEDOL}"); } if (match.Value.LipperID != null) { Console.WriteLine($"\tLipperID: {match.Value.LipperID}"); } if (match.Value.Ticker != null) { Console.WriteLine($"\tTicker: {match.Value.Ticker}"); } } // Warnings foreach (string warning in response.Data.Warnings) { Console.WriteLine($"WARNING: {warning}"); } } else { Console.WriteLine(response.Status); } Console.Write("\nHit any key to continue..."); Console.ReadKey(); Console.WriteLine(); }
public static void DisplayTable(string label, ISymbolConversionResponse response) { DisplayTable(label, response, 0); }