Ejemplo n.º 1
0
        private void AddConnection(ConnectionParams cp)
        {
            string key = ConnectionParams.PrepareConnKeyWithDb(cp);

            if (_selectedConnections.ContainsKey(key))
            {
                return;
            }

            ConnectionParams tmp = cp.CreateCopy();

            _selectedConnections.Add(key, tmp);
            RenderConnectionInList(tmp);
        }
Ejemplo n.º 2
0
        private void RemoveSelected()
        {
            ListViewItem     item = null;
            ConnectionParams cp   = null;
            string           key  = null;

            while (lv.SelectedItems.Count > 0)
            {
                item = lv.SelectedItems[0];
                cp   = item.Tag as ConnectionParams;
                lv.Items.Remove(item);
                if (cp == null)
                {
                    continue;
                }

                key = ConnectionParams.PrepareConnKeyWithDb(cp);
                if (_selectedConnections.ContainsKey(key))
                {
                    _selectedConnections.Remove(key);
                }
            }
        }