Ejemplo n.º 1
0
        //text
        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode == null)
            {
                return;
            }
            TreeNode_Folder     TR  = (TreeNode_Folder)treeView1.SelectedNode;
            FolderBrowserDialog Fol = new FolderBrowserDialog();

            Fol.Description         = "Info files folder";
            Fol.ShowNewFolderButton = true;
            Fol.SelectedPath        = TR.Folder.InfosFolder;
            if (Fol.ShowDialog() == DialogResult.OK)
            {
                TR.Folder.InfosFolder = Fol.SelectedPath;
                ShouldSaveFolders     = true;
                //Properties
                listView2.Items.Clear();
                listView2.Items.Add("Name");
                listView2.Items[listView2.Items.Count - 1].SubItems.Add(TR.Folder.Name);
                listView2.Items.Add("Path");
                listView2.Items[listView2.Items.Count - 1].SubItems.Add(TR.Folder.Path);
                listView2.Items.Add("Snapshots Path");
                listView2.Items[listView2.Items.Count - 1].SubItems.Add(TR.Folder.ImagesFolder);
                listView2.Items.Add("Info Texts Path");
                listView2.Items[listView2.Items.Count - 1].SubItems.Add(TR.Folder.InfosFolder);
            }
        }
Ejemplo n.º 2
0
        private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (treeView1.SelectedNode == null)
            {
                e.CancelEdit = true; return;
            }
            if (e.Label == null)
            {
                return;
            }
            TreeNode_Folder fol = (TreeNode_Folder)treeView1.SelectedNode;

            fol.Folder.Name   = e.Label;
            fol.Text          = e.Label;
            ShouldSaveFolders = true;
            //Properties
            listView2.Items.Clear();
            listView2.Items.Add("Name");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(((TreeNode_Folder)e.Node).Folder.Name);
            listView2.Items.Add("Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(((TreeNode_Folder)e.Node).Folder.Path);
            listView2.Items.Add("Snapshots Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(((TreeNode_Folder)e.Node).Folder.ImagesFolder);
            listView2.Items.Add("Info Texts Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(((TreeNode_Folder)e.Node).Folder.InfosFolder);
        }
Ejemplo n.º 3
0
 void RefreshFolders()
 {
     treeView1.Nodes.Clear();
     foreach (MFolder fol in BASE.FOLDERS)
     {
         TreeNode_Folder TR = new TreeNode_Folder();
         TR.ImageIndex         = 0;
         TR.SelectedImageIndex = 1;
         TR.Folder             = fol;
         treeView1.Nodes.Add(TR);
     }
 }
Ejemplo n.º 4
0
 public void FindFolders()
 {
     Nodes.Clear();
     foreach (MFolder fol in _Folder.Folders)
     {
         TreeNode_Folder TR = new TreeNode_Folder();
         TR.ImageIndex         = this.ImageIndex;
         TR.SelectedImageIndex = this.SelectedImageIndex;
         TR.Folder             = fol;
         Nodes.Add(TR);
     }
 }
Ejemplo n.º 5
0
        //After selecting a folder
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode == null)
            {
                return;
            }
            listView1.Items.Clear();
            pictureBox1.Image = Properties.Resources.MyNes;
            richTextBox1.Text = "";
            _SelectedFolder   = (TreeNode_Folder)treeView1.SelectedNode;
            //Properties
            listView2.Items.Clear();
            listView2.Items.Add("Name");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(_SelectedFolder.Folder.Name);
            listView2.Items.Add("Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(_SelectedFolder.Folder.Path);
            listView2.Items.Add("Snapshots Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(_SelectedFolder.Folder.ImagesFolder);
            listView2.Items.Add("Info Texts Path");
            listView2.Items[listView2.Items.Count - 1].SubItems.Add(_SelectedFolder.Folder.InfosFolder);
            TextBox1_mapper.Text = _SelectedFolder.Folder.Mapper.ToString();
            switch (_SelectedFolder.Folder.Filter)
            {
            case FolderFilter.All: ComboBox1_nav.SelectedIndex = 0; TextBox1_mapper.Enabled = false; break;

            case FolderFilter.SupportedMappersOnly: ComboBox1_nav.SelectedIndex = 1; TextBox1_mapper.Enabled = false; break;

            case FolderFilter.Mapper: ComboBox1_nav.SelectedIndex = 2; TextBox1_mapper.Enabled = true; break;
            }
            if (!Directory.Exists(_SelectedFolder.Folder.Path))
            {
                MessageBox.Show("This folder isn't exist on the disk !!");
                DeleteFolder(this, null);
            }
            else
            {
                if (_SelectedFolder.Folder.Files == null)
                {
                    _SelectedFolder.Folder.Files = new List <MFile>();
                    BuildCache();
                }
                else if (_SelectedFolder.Folder.Files.Count == 0)
                {
                    BuildCache();
                }
                LoadFilesFromCache();
            }
        }