Beispiel #1
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;
            }
        }
        private void GetChannelsBW_Done(object sender, RunWorkerCompletedEventArgs e)
        {
            MyStandbyForm.Close();

            ChannelsListbox.Items.Clear();
            foreach (String Channel in Channels.Keys)
            {
                ChannelsListbox.Items.Add(Channel);
            }

            ChannelsListbox.Enabled  = true;
            DisconnectButton.Enabled = true;
        }