Beispiel #1
0
        /// <summary>
        /// 剔除已勾選連線
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_RemoveClients_Click(object sender, EventArgs e)
        {
            // 已選擇的連線 Index
            var checkedIndex = checkedListBox_Clients.CheckedIndices.Cast <int>().ToList();

            // 欲剔除的連線
            var checkedClients = new List <ProxyClient>();

            foreach (var index in checkedIndex)
            {
                checkedClients.Add(fAvailableClients[index]);
            }

            fProxyServer.RemoveClients(checkedClients);

            checkedListBox_Clients.Items.Clear();
        }