Exemplo n.º 1
0
        static void Main(string[] args)

        {
            //Console.SetWindowSize(160, 90);
            //string c = Console.ReadKey(true).Key.ToString();
            //Console.WriteLine(c);
            //Console.Beep();
            allMail = EReceiving.DownloadAllMail();
            SortMailSender(allMail, EReceiving.login, true);
            Timer tm = new Timer(TimerCallback, null, 180000, 180000);
            char  k;

            do
            {
                Console.Clear();

                Console.WriteLine("|==== View:\n|= 1-All mail ({0})\n|= 2-Inbox ({1})\n|= 3-Sent Box({2})\n|= 4-Update\n\n0-Exit ", allMail.Count(), inBox.Count(), sentBox.Count());
                k = Console.ReadKey(true).KeyChar;
                switch (k)
                {
                case '1':
                    PrintMessageList(allMail);
                    break;

                case '2':
                    PrintMessageList(inBox);
                    break;

                case '3':
                    PrintMessageList(sentBox);
                    break;

                case '4':
                    EReceiving.UpdateMail(allMail);
                    break;

                case '0':
                    Console.WriteLine("Press any key");
                    break;

                default:
                    Console.WriteLine("Incorrect choice. Press any key");
                    Console.ReadKey();
                    break;
                }
            } while (k != '0');

            //++++++++++++++++++++++++++
            // Console.WriteLine("Press any key");
            // Console.ReadKey();
            // if (allMail != null)
            // {
            //// SortMailSender(allMail, EReceiving.login, true);
            // PrintMessageList(allMail);
            // }
            // Console.ReadKey();
            // PrintMessage(allMail[4]);
            // Console.ReadKey();.
        }
Exemplo n.º 2
0
 private static void TimerCallback(Object o)
 {
     EReceiving.UpdateMail(allMail);
 }