コード例 #1
0
 internal void SearchAndBeep(Morse m, char c)
 {
     foreach (KeyValuePair <string, string> item in m.MorseTable)
     {
         if (c == item.Key[0])
         {
             m.Beep(item.Value);
         }
     }
 }
コード例 #2
0
        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);
            }
        }