Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ClientSocket client = new ClientSocket();
            ModelManager model = new ModelManager(client);
            ChatSystem chat = new ChatSystem("Client");
            Observer observer=new Observer("Observer", chat, model);
            Controller controller = new Controller(model, chat);

            Application.Run(new Login(controller)); //Mistake this call will go into a a loop which first leaves it when closing the GUI. First then it connects to the server
            //with the last 2 method calls.

            client.setObserver(observer);
            client.Loopconnect();
        }