예제 #1
0
        private void ChatboxKeepUpdated_Done(object sender, RunWorkerCompletedEventArgs e)
        {
            switch (CKUR)
            {
            case ChatboxKeepUpdatedResult.TIMEOUT:
                MessageBox.Show("Server connection timeout. Log in again", "Woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Mainclient.Close();
                Close();
                break;

            case ChatboxKeepUpdatedResult.KICKED:
                if (!AlreadyClosed)
                {
                    MessageBox.Show("You've been kicked from this channel", "Algo paso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Close();
                }
                break;

            case ChatboxKeepUpdatedResult.NORMAL_EXIT:
                break;

            default:
                MessageBox.Show("Chatbox Keep Update Routine abruptly closed. Kicking you from the chatroom", "Algo paso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                try { Mainclient.Leave(); } catch { };     //try in case the abrupt disconnection caused them to already leave.
                Close();
                break;
            }
        }
예제 #2
0
        private void ConnectBW_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Enabled = true;
            MyStandbyForm.Close();

            switch (ConnectResult)
            {
            case Colloquor.ColloquorClient.CQUORConnectionResult.NOCONNECT:
                MessageBox.Show("Unable to connect to " + MainClient.GetIP(), "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.LOGININVALID:
                MessageBox.Show("Unable to login: Invalid Credentials", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.LOGINALREADY:
                MessageBox.Show("Unable to login: Wait this isn't supposed to happen. Close the program and open it back up.", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.LOGINOTHERLOCALE:
                MessageBox.Show("Unable to login: You're already logged in somewhere else!", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.LOGINOTHER:
                MessageBox.Show("Unable to login: Something happened and the server couldn't log you in.", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.NOCOLLOQUOR:
                MessageBox.Show("This server doesn't have the Colloquor extension!", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.NOPERMISSION:
                MessageBox.Show("You don't have permission to use the colloquor extension on this server", "woops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MainClient.Close();
                break;

            case Colloquor.ColloquorClient.CQUORConnectionResult.SUCCESS:
                Hide();
                new ChannelPicker(ref MainClient).ShowDialog();
                Show();
                MainClient.Close();
                break;

            default:
                break;
            }
        }