Beispiel #1
0
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (listView1.SelectedItems.Count == 1)
     {
         RDMListViewItem item = listView1.SelectedItems[0] as RDMListViewItem;
         connectRemoteDesktop(item.ItemInfo.loginname, item.ItemInfo.password, item.ItemInfo.address, item.ItemInfo.port, item.ItemInfo.accountName, item.ItemInfo.useMultimon);
     }
 }
Beispiel #2
0
 private void popConnectMenuItem_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count == 1)
     {
         RDMListViewItem item = listView1.SelectedItems[0] as RDMListViewItem;
         connectRemoteDesktop(item.ItemInfo.loginname, item.ItemInfo.password, item.ItemInfo.address, item.ItemInfo.port, item.ItemInfo.accountName);
     }
 }
 private void listView1_MouseUp(object sender, MouseEventArgs e)
 {
     isDrag = false;
     if ((this.itemSelected != null) && (this.itemDraged != null))
     {
         if (this.itemDraged.Index != this.itemSelected.Index)
         {
             this.listView1.Items.RemoveAt(this.itemDraged.Index);
             this.listView1.Items.Insert(this.itemSelected.Index, this.itemDraged);
             this.itemDraged   = null;
             this.itemSelected = null;
             RefreshDataList();
             JSONUtils.Write(dataList.ToArray(), CONFIG_FILENAME);
         }
     }
     this.Cursor = Cursors.Default;
 }
Beispiel #4
0
        private void deleteMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 1)
            {
                try
                {
                    RDMListViewItem listViewItem = listView1.SelectedItems[0] as RDMListViewItem;
                    AccountItem     itemData     = dataList[listViewItem.Index];

                    var re = MessageBox.Show(resManager.GetString("delete.messagebox.caption"), resManager.GetString("delete.messagebox.title"), MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (re == DialogResult.Yes)
                    {
                        dataList.Remove(itemData);
                        listView1.Items.Remove(listViewItem);
                        JSONUtils.Write(dataList.ToArray(), CONFIG_FILENAME);
                    }
                }
                catch { }
            }
        }
Beispiel #5
0
        private void editMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 1)
            {
                try
                {
                    RDMListViewItem listViewItem = listView1.SelectedItems[0] as RDMListViewItem;
                    AccountItem     itemData     = dataList[listViewItem.Index];

                    ConnectConfigForm configForm = new ConnectConfigForm(itemData);
                    configForm.ShowDialog();
                    if (configForm.DialogResult == DialogResult.OK)
                    {
                        listViewItem.Refresh();
                        JSONUtils.Write(dataList.ToArray(), CONFIG_FILENAME);
                    }
                }
                catch { }
            }
        }
 private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
 {
     itemDraged  = (RDMListViewItem)e.Item;
     this.Cursor = Cursors.Hand;
     isDrag      = true;
 }