Node GetFoldNode(CFolderEntry x) { Node xReturn = new Node(); xReturn.Text = x.Name; xReturn.Tag = x; xReturn.ContextMenu = contextMenuStrip3; xReturn.NodeClick += new EventHandler(xReturn_NodeClick); return(xReturn); }
private void renameToolStripMenuItem1_Click(object sender, EventArgs e) { CFolderEntry x = (CFolderEntry)advTree1.SelectedNode.Tag; Renamer y = new Renamer(x.Name, true); if (y.ShowDialog() != DialogResult.OK) { return; } node1.Text = x.Name = y.FileName; }
private void GetSelFiles(CFolderEntry folder) { folderTree.Enabled = fileList.Enabled = false; var x = folder.GetFiles(); fileList.Items.Clear(); fileList.Items.AddRange(x.Select(y => new ListViewItem(y.Name) { Tag = y }).ToArray()); folderTree.Enabled = fileList.Enabled = true; }
private void deleteFolderToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete?", "WARNING", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } CFolderEntry x = (CFolderEntry)advTree1.SelectedNode.Tag; xsession.DeleteFolder(x.Path); advTree1.SelectedNode.Remove(); advTree1.SelectedIndex = 0; }
void GetSelFiles(CFolderEntry Folder) { advTree1.Enabled = listView1.Enabled = false; List <ListViewItem> xItems = new List <ListViewItem>(); CFileEntry[] x = Folder.GetFiles(); foreach (CFileEntry y in x) { ListViewItem z = new ListViewItem(y.Name); z.Tag = y; xItems.Add(z); } listView1.Items.Clear(); listView1.Items.AddRange(xItems.ToArray()); advTree1.Enabled = listView1.Enabled = true; }