public ProxyConfigUI(ProxyConfig config) { InitializeComponent(); this.Config = config; // Options - Proxy ucProxyAccounts.btnAdd.Click += new EventHandler(ProxyAccountsAddButton_Click); ucProxyAccounts.btnRemove.Click += new EventHandler(ProxyAccountsRemoveButton_Click); ucProxyAccounts.btnTest.Click += new EventHandler(ProxyAccountTestButton_Click); ucProxyAccounts.AccountsList.SelectedIndexChanged += new EventHandler(ProxyAccountsList_SelectedIndexChanged); // Proxy if (cboProxyConfig.Items.Count == 0) { cboProxyConfig.Items.AddRange(typeof(EProxyConfigType).GetEnumDescriptions()); } cboProxyConfig.SelectedIndex = (int)config.ProxyConfigType; ProxySetup(config.ProxyList); if (ucProxyAccounts.AccountsList.Items.Count > 0) { ucProxyAccounts.AccountsList.SelectedIndex = config.ProxySelected; } }