static void Main(string[] args) { //Draw the screen Console.SetCursorPosition(15, 1); Console.WriteLine("GUITAR MAESTRO: You Guitar Chord Companion\n"); IEnumerable <string> s = from c in chords select c.name; Console.SetCursorPosition(5, Console.WindowHeight - 2); Console.WriteLine(string.Join(" ", s)); DrawStaffs.Tabstaff(); DrawStaffs.Fretboard(); //Take in user input in a loop string input; do { Console.SetCursorPosition(5, 25); Console.Write("Choose a chord from the list to view: "); input = Console.ReadLine(); string fileName = string.Join( "", from c in chords where c.name.Equals(input) select c.textFile ); FileIO file = new FileIO(); file.DrawChord(fileName); FileIO.measureTop = 5; FileIO.measureLeft += 10; }while (input != "q"); //TODO: to upper case }
/// <summary> /// Draws a chord shape selected by the user on the tab staff /// </summary> /// <param name="chord"></param> public void DrawChord(string chord) { DrawStaffs draw = new DrawStaffs(); try { using (StreamReader reader = new StreamReader("Resources/" + chord)) { string line; while ((line = reader.ReadLine()) != null) { Console.SetCursorPosition(measureLeft, measureTop); Console.WriteLine("{0}", line); measureTop++; } //Console.SetCursorPosition(measureLeft, measureTop); } } catch (Exception e) { Console.WriteLine(e.Message); } }