Exemplo n.º 1
0
        private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string original, selected;

            folderBrowserDialog1.Description = "First select the folder where your original photos are located";
            if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                original = folderBrowserDialog1.SelectedPath;
                folderBrowserDialog1.Description = "Now select the folder where your selected photos are located";
                if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                {
                    selected = folderBrowserDialog1.SelectedPath;
                    if (original == selected)
                    {
                        MessageBox.Show("The original and selected folders cannot be the same", "Error",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        RecentFolder r = new RecentFolder(original, selected);
                        recentFolders.Add(r);
                        OpenFolder(r);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void OpenFolder(RecentFolder folder)
        {
            this.currentFolder = folder;
            treeView1.Nodes.Clear();
            var rootInfo = new DirectoryInfo(this.currentFolder.original);
            var rootNode = treeView1.Nodes.Add(rootInfo.Name);

            rootNode.Tag        = rootInfo.FullName;
            rootNode.ImageIndex = 0;
            if (rootInfo.GetDirectories().First() != null)
            {
                rootNode.Nodes.Add("Please wait...");
            }
        }