internal void SearchAndBeep(Morse m, char c) { foreach (KeyValuePair <string, string> item in m.MorseTable) { if (c == item.Key[0]) { m.Beep(item.Value); } } }
static void Main(string[] args) { Morse m = new Morse(); m.DisplayTitle(); Console.ForegroundColor = ConsoleColor.Yellow; char c = ' '; while (c != '*') { c = Console.ReadKey().KeyChar; m.SearchAndBeep(m, c); } }