Exemplo n.º 1
0
        /// <summary>
        /// Main method
        /// </summary>
        static void Main()
        {
            mServer = new ServerClass();
            OutputProjects(mServer.GetProjectList());

            ThreadPool.QueueUserWorkItem(new WaitCallback(SocketThread));
            ThreadPool.QueueUserWorkItem(new WaitCallback(WCFThread));
            ThreadPool.QueueUserWorkItem(new WaitCallback(CheckClients));
            ThreadPool.QueueUserWorkItem(new WaitCallback(SaveFile));

            DisplayCommands();
            while (Run)
            {
                string cmd = Console.ReadLine();
                //string cmd = "l";
                switch (cmd)
                {
                case "l":
                    mServer.LoadFile();
                    break;

                case "s":
                    mServer.SaveFile();
                    break;

                case "se":
                    mServer.SaveFile();
                    Run = false;
                    break;

                case "e":
                    Run = false;
                    break;

                default:
                    Console.WriteLine("Wrong command!");
                    DisplayCommands();
                    break;
                }
            }
        }