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(); }
public void Unsubscribe(Observer observer) { observers.Remove(observer); }
public void Subscribe(Observer observer) { observers.Add(observer); }
public void setObserver(Observer observer) { this.mListOut.Subscribe(observer); }