// perform same actions after every query private static void ReturnToMenu(string menu) { string DIV = "---------------------------------------"; WriteToFile write = new WriteToFile(); Console.WriteLine(String.Format("\n{0}\nYour results have been exported to {1}\n{2}\n\nHit any key to return to the main menu...", DIV, write.OutFileLocation, DIV)); Console.ReadLine(); Console.Clear(); Console.WriteLine(menu); }
// pass results to this method so that it can be determined which method in the WriteToFile class should be used private static void WriteResultsToFile(List <Numbers> results, int runCount, int callIdentifier, string query) { WriteToFile writeToFile = new WriteToFile(); Results getResults = new Results(); if (runCount == 0) { writeToFile.New(results, getResults.GetHeader(runCount, callIdentifier, query), callIdentifier); } else { writeToFile.Append(results, getResults.GetHeader(runCount, callIdentifier, query), callIdentifier); } }