private int MenuRecord(record r) ///////////////// { Console.SetCursorPosition(0, 0); CountStringsFromConsole = 7; ConsoleCLear(); r.WriteToConsole(); string str = "0) Press to back.\n" + "1) Press to play record.\n" + "2) Press to stop record.\n" + "3) Press to view record's information"; Console.WriteLine(str); try { int sel = int.Parse(Console.ReadLine()); return(sel); } catch { return(FormatException()); } }
public void ProcessingMenuRecord(record r) { Console.SetCursorPosition(0, 0); if(r == null) { Console.Clear(); Console.WriteLine("none record doesn't play\nPress any key to back"); Console.ReadLine(); } else { int sel = -1; while(sel != 0) { sel = MenuRecord(r); Console.Clear(); Console.SetCursorPosition(0, 0); switch(sel) { case 0: break; case 1: var th =SearchThread(r); if(th == null) { var cl = new WorkWithThreads(); ConsoleCLear(); cl.AddPlaingRecord(r); Console.SetCursorPosition(0, 0); Console.WriteLine("Your record is started successfull\nPress any key to back"); Console.ReadLine(); } else { Console.WriteLine("this record is plying now"); Console.WriteLine("Press any key to back"); Console.ReadLine(); } sel = 0; break; case 2: try { var thr =SearchThread(r); var cl = new WorkWithThreads(); cl.AbortRecord(r); Console.SetCursorPosition(0, 0); Console.WriteLine("Your record is stoped successfull"); } catch { Console.SetCursorPosition(0, 0); Console.WriteLine("Your record doesn't playing now"); } Console.WriteLine("Press any key to back"); Console.ReadLine(); sel = 0; break; case 3: r.WriteToConsole(); r.WriteAbout(); Console.WriteLine("Press any key to back"); Console.ReadLine(); break; } } } }
private int MenuRecord(record r) ///////////////// { Console.SetCursorPosition(0, 0); CountStringsFromConsole = 7; ConsoleCLear(); r.WriteToConsole(); string str = "0) Press to back.\n" + "1) Press to play record.\n" + "2) Press to stop record.\n" + "3) Press to view record's information"; Console.WriteLine(str); try { int sel = int.Parse(Console.ReadLine()); return sel; } catch { return FormatException(); } }
public void ProcessingMenuRecord(record r) { Console.SetCursorPosition(0, 0); if (r == null) { Console.Clear(); Console.WriteLine("none record doesn't play\nPress any key to back"); Console.ReadLine(); } else { int sel = -1; while (sel != 0) { sel = MenuRecord(r); Console.Clear(); Console.SetCursorPosition(0, 0); switch (sel) { case 0: break; case 1: var th = SearchThread(r); if (th == null) { var cl = new WorkWithThreads(); ConsoleCLear(); cl.AddPlaingRecord(r); Console.SetCursorPosition(0, 0); Console.WriteLine("Your record is started successfull\nPress any key to back"); Console.ReadLine(); } else { Console.WriteLine("this record is plying now"); Console.WriteLine("Press any key to back"); Console.ReadLine(); } sel = 0; break; case 2: try { var thr = SearchThread(r); var cl = new WorkWithThreads(); cl.AbortRecord(r); Console.SetCursorPosition(0, 0); Console.WriteLine("Your record is stoped successfull"); } catch { Console.SetCursorPosition(0, 0); Console.WriteLine("Your record doesn't playing now"); } Console.WriteLine("Press any key to back"); Console.ReadLine(); sel = 0; break; case 3: r.WriteToConsole(); r.WriteAbout(); Console.WriteLine("Press any key to back"); Console.ReadLine(); break; } } } }