public MainForm() { InitializeComponent(); Init(); this._controller = new ChatClientController(); this._controller.ToUI += ControllerOnToUI; this._controller.ToUIOnError += ControllerOnToUIOnError; ChangeDialog(DialogPage.CONNECTION_FORM); this.connectionForm1.SetController(this._controller); this.loginForm1.SetController(this._controller); this.registerForm1.SetController(this._controller); this.chatView1.SetController(this._controller); this.connectionForm1.OnConnectionStateUpdate += ConnectionForm1OnOnConnectionStateUpdate; this.loginForm1.RegisterButton.Click += (sender, args) => AimHelper(DialogPage.REGISTER_FORM, DialogPage.LOGIN_FORM); this.registerForm1.LoginButton.Click += (sender, args) => AimHelper(DialogPage.LOGIN_FORM, DialogPage.REGISTER_FORM); }
public void SetController(ChatClientController controller) { this._comptroller = controller; }