protected virtual void OnConnectError(ConnectionErrorEventArgs e) { this.State = ServerState.Disconnected; OnGlobalMessageReceived(new NotificationEventArgs(new NotificationMessage("Could not connect to server {0}. {1}", this.Name, e.Exception.GetBaseException().Message))); if (ConnectError != null) ConnectError(this, e); }
void HandleConnectError (object sender, ConnectionErrorEventArgs e) { var serverSection = GetServerSection (e.Server); if (e.Exception is NotAuthenticatedException) { if (e.Server.Authenticate (this)) { JabbRApplication.Instance.SaveConfiguration (); e.Server.Connect (); } } else { MessageBox.Show (this, e.Exception.GetBaseException ().Message, string.Format ("Could not connect to server {0}. {1}", e.Server.Name)); } }