protected virtual void OnRegister(RegisterEventArgs e) { RegisterEventHendler handler = Registered; if (handler != null) { handler(this, e); } }
void Auth_Registered(object sender, RegisterEventArgs e) { if (e.Code == MsgType.OK) { startForm.loginTextBox.BeginInvoke(new Action(() => { startForm.loginTextBox.Text = name; })); startForm.passTextBox.BeginInvoke(new Action(() => { startForm.passTextBox.Text = pass; })); startForm.errorLabel.BeginInvoke(new Action(() => { startForm.errorLabel.Text = e.Message; })); this.DialogResult = DialogResult.OK; } errorLabel.BeginInvoke(new Action(() => { errorLabel.Text = e.Message; })); }