Esempio n. 1
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            Logger.Clear();

            Logger.Log("Starting folder renamer...");

            tabControl.SelectTab(1);

            Application.DoEvents();

            var options = new FolderDateRenamer.RenameFoldersParams(txtFileNamePattern.Text,
                                                                    txtDatePattern.Text, chkUseEXIFDataToGetDate.Checked,
                                                                    chkUseFileDateIfNoEXIF.Checked, chkRecusrive.Checked,
                                                                    chkPreview.Checked)
            {
                SkipTopLevel                   = chkSkipTopLevel.Checked,
                SkipNumeric                    = chkSkipNumeric.Checked,
                SkipFolders                    = txtSkipFolders.Text,
                Logger                         = Logger,
                SkipIfFolderHasXmpFile         = chkSkipIfXmp.Checked,
                SkipIfFolderNameAlreadyHasDate = chkSkipIfFolderNameAlreadyHasDate.Checked
            };

            var renamer = new FolderDateRenamer(options);

            Logger.Log("Parsing images in " + txtPath.Text);

            renamer.ParseImageDates(txtPath.Text);

            if (!options.TestMode)
            {
                Logger.Log(renamer.RenameQueue.Count + " folder renames in Queue.  Renaming now..");

                DialogResult response =
                    MessageBox.Show(string.Format("Rename {0} folders now?", renamer.RenameQueue.Count),
                                    "Confirm Rename", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (response == DialogResult.Yes)
                {
                    renamer.RenameFolders();
                }
                else
                {
                    Logger.Log("Cancelled rename");
                }
            }
            else
            {
                Logger.Log(renamer.RenameQueue.Count +
                           " folder renames in Queue.  Skipping rename because preview/test is checked.");
            }


            Logger.Log("Done.");
            MessageBox.Show("Done");
        }
Esempio n. 2
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            Logger.Clear();

            Logger.Log("Starting folder renamer...");

            tabControl.SelectTab(1);

            Application.DoEvents();

            var options = new FolderDateRenamer.RenameFoldersParams(txtFileNamePattern.Text,
                                                                    txtDatePattern.Text, chkUseEXIFDataToGetDate.Checked,
                                                                    chkUseFileDateIfNoEXIF.Checked, chkRecusrive.Checked,
                                                                    chkPreview.Checked)
                {
                    SkipTopLevel = chkSkipTopLevel.Checked,
                    SkipNumeric = chkSkipNumeric.Checked,
                    SkipFolders = txtSkipFolders.Text,
                    Logger = Logger,
                    SkipIfFolderHasXmpFile = chkSkipIfXmp.Checked,
                    SkipIfFolderNameAlreadyHasDate = chkSkipIfFolderNameAlreadyHasDate.Checked
                };

            var renamer = new FolderDateRenamer(options);

            Logger.Log("Parsing images in " + txtPath.Text);

            renamer.ParseImageDates(txtPath.Text);

            if (!options.TestMode)
            {
                Logger.Log(renamer.RenameQueue.Count + " folder renames in Queue.  Renaming now..");

                DialogResult response =
                    MessageBox.Show(string.Format("Rename {0} folders now?", renamer.RenameQueue.Count),
                                    "Confirm Rename", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (response == DialogResult.Yes)
                {
                    renamer.RenameFolders();
                }
                else
                {
                    Logger.Log("Cancelled rename");
                }
            }
            else
            {
                Logger.Log(renamer.RenameQueue.Count +
                           " folder renames in Queue.  Skipping rename because preview/test is checked.");
            }

            Logger.Log("Done.");
            MessageBox.Show ("Done");
        }