public void HandleKey()
 {
     c = Console.ReadKey(true).KeyChar;
     MyEventArgs e = new MyEventArgs (c);
     if (c == '3')
         key3Pressed (this, e);
     if (c == '5')
         key5Pressed (this, e);
     if (c >= '0' && c <= '9')
         numberPressed (this, e);
     anyKeyPressed (this, e);
     checkExit (this, e);
 }
 public void ExitProgram(object source, MyEventArgs e)
 {
     if (e.GetInfo() == '\n')
         Environment.Exit (0);
 }
 public void numberPressed(object source, MyEventArgs e)
 {
     Console.WriteLine ("Key {0} was pressed", e.GetInfo());
 }