Exemplo n.º 1
0
        private void CreateFolderToolStripMenuItemCombinedClick(object sender, EventArgs e)
        {
            TreeNode tn = m_fitCombined.InnerTreeView.SelectedNode;

            if (tn == null)
            {
                return;
            }
            FSNode node = m_fitCombined.GetFSNodeByTreeNode(tn);

            if (node == null)
            {
                return;
            }
            var rf = new RenameFile("Create Folder");

            if (rf.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string directoryPath;

            if (node is FSNodeDir)
            {
                directoryPath = node.GetPath() + '\\' + rf.NewName;
            }
            else
            {
                directoryPath = node.GetPath().SubstringBeforeLast('\\', true) + rf.NewName;
            }
            if (!Directory.Exists(directoryPath))
            {
                Directory.CreateDirectory(directoryPath);
            }
        }
Exemplo n.º 2
0
        private void RenameToolStripMenuItemCombinedClick(object sender, EventArgs e)
        {
            TreeNode tn = m_fitCombined.InnerTreeView.SelectedNode;

            if (tn == null)
            {
                return;
            }
            var rf = new RenameFile {
                NewName = tn.Text
            };

            if (rf.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            m_fitCombined.RenameSelected(rf.NewName);
        }
Exemplo n.º 3
0
        private void CreateCopyToolStripMenuItemCombinedClick(object sender, EventArgs e)
        {
            var selected = m_fitCombined.GetSelectedNode() as FSNodeFile;

            if (selected == null)
            {
                return;
            }
            string name = selected.Name.SubstringBeforeLast('.') + "_copy." + selected.Name.SubstringAfterLast('.');
            var    rf   = new RenameFile("Name of copy")
            {
                NewName = name
            };

            if (rf.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            name = rf.NewName;
            PasteNode(selected, selected.Parent, name);
        }
Exemplo n.º 4
0
 private void CreateCopyToolStripMenuItemCombinedClick(object sender, EventArgs e)
 {
     var selected = m_fitCombined.GetSelectedNode() as FSNodeFile;
     if (selected == null)
         return;
     string name = selected.Name.SubstringBeforeLast('.') + "_copy." + selected.Name.SubstringAfterLast('.');
     var rf = new RenameFile("Name of copy") {NewName = name};
     if (rf.ShowDialog() == DialogResult.Cancel)
         return;
     name = rf.NewName;
     PasteNode(selected, selected.Parent, name);
 }
Exemplo n.º 5
0
 private void CreateFolderToolStripMenuItemCombinedClick(object sender, EventArgs e)
 {
     TreeNode tn = m_fitCombined.InnerTreeView.SelectedNode;
     if (tn == null)
         return;
     FSNode node = m_fitCombined.GetFSNodeByTreeNode(tn);
     if (node == null)
         return;
     var rf = new RenameFile("Create Folder");
     if (rf.ShowDialog() == DialogResult.Cancel)
         return;
     string directoryPath;
     if (node is FSNodeDir)
         directoryPath = node.GetPath() + '\\' + rf.NewName;
     else
         directoryPath = node.GetPath().SubstringBeforeLast('\\', true) + rf.NewName;
     if (!Directory.Exists(directoryPath))
         Directory.CreateDirectory(directoryPath);
 }
Exemplo n.º 6
0
 private void RenameToolStripMenuItemCombinedClick(object sender, EventArgs e)
 {
     TreeNode tn = m_fitCombined.InnerTreeView.SelectedNode;
     if (tn == null)
         return;
     var rf = new RenameFile {NewName = tn.Text};
     if (rf.ShowDialog() == DialogResult.Cancel)
         return;
     m_fitCombined.RenameSelected(rf.NewName);
 }