Esempio n. 1
0
        private void AuthenticationCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if (eventsDisabled)
            {
                return;
            }

            eventsDisabled = true;

            if (!AuthenticationCheckBox.Checked)
            {
                ProxyUsernameTextBox.Clear();
                ProxyPasswordTextBox.Clear();
            }
            SelectUseThisProxyServer();

            eventsDisabled = false;
        }
Esempio n. 2
0
        private void AccountListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (AccountListView.SelectedItem == null)
            {
                return;
            }
            string accountName = AccountListView.SelectedItem.ToString();

            lock (_bot)
            {
                if (_bot.AccountManager.Accounts.ContainsKey(accountName))
                {
                    Account account = _bot.AccountManager.Accounts[accountName];
                    UsernameTextBox.Text = account.Name;
                    if (account.Password == null)
                    {
                        PasswordTextBox.Clear();
                    }
                    else
                    {
                        PasswordTextBox.Password = account.Password;
                    }
                    if (account.Server == "YELLOW")
                    {
                        ServerComboBox.SelectedIndex = 2;
                    }
                    else if (account.Server == "BLUE")
                    {
                        ServerComboBox.SelectedIndex = 1;
                    }
                    else
                    {
                        ServerComboBox.SelectedIndex = 0;
                    }
                    if (account.MacAddress != null)
                    {
                        MacRandomCheckBox.IsChecked = false;
                        MacAddressTextBox.Text      = account.MacAddress;
                    }
                    else
                    {
                        MacRandomCheckBox.IsChecked = true;
                    }
                    if (account.Socks.Version != SocksVersion.None || account.Socks.Username != null || account.Socks.Password != null ||
                        account.Socks.Host != null || account.Socks.Port != -1)
                    {
                        ProxyCheckBox.IsChecked = true;
                    }
                    else
                    {
                        ProxyCheckBox.IsChecked = false;
                    }
                    if (account.Socks.Version == SocksVersion.Socks4)
                    {
                        ProxyVersion = 4;
                    }
                    else if (account.Socks.Version == SocksVersion.Socks5)
                    {
                        ProxyVersion = 5;
                    }
                    if (account.Socks.Host == null)
                    {
                        ProxyHostTextBox.Clear();
                    }
                    else
                    {
                        ProxyHostTextBox.Text = account.Socks.Host;
                    }
                    if (account.Socks.Port == -1)
                    {
                        ProxyPortTextBox.Clear();
                    }
                    else
                    {
                        ProxyPortTextBox.Text = account.Socks.Port.ToString();
                    }
                    if (account.Socks.Username != null || account.Socks.Password != null)
                    {
                        AnonymousCheckBox.IsChecked = false;
                    }
                    else
                    {
                        AnonymousCheckBox.IsChecked = true;
                    }
                    if (account.Socks.Username == null)
                    {
                        ProxyUsernameTextBox.Clear();
                    }
                    else
                    {
                        ProxyUsernameTextBox.Text = account.Socks.Username;
                    }
                    if (account.Socks.Password == null)
                    {
                        ProxyPasswordTextBox.Clear();
                    }
                    else
                    {
                        ProxyPasswordTextBox.Password = account.Socks.Password;
                    }
                }
            }
        }