Ejemplo n.º 1
0
        /// <summary>
        /// Previews the rename.
        /// </summary>
        private void PreviewRename()
        {
            frmPreview previewWindow = new frmPreview();

            previewWindow.SetFileList(this.FileList);

            if (previewWindow.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    this.FileList.RenameFiles();

                    MessageBox.Show(this, "Job done!\n\nEverything worked!", this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (RenameProcessFailedException Ex)
                {
                    MessageBox.Show(this, "Could not rename these files:\n\n" + Ex.Message, this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception Ex)
                {
                    MessageBox.Show(this, "A error occured during the rename process:\n" + Ex.Message, this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            previewWindow.Dispose();

            ResetGui();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Previews the rename.
        /// </summary>
        private void PreviewRename()
        {
            frmPreview previewWindow = new frmPreview();

            previewWindow.SetFileList(this.FileList);

            if (previewWindow.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    this.FileList.RenameFiles();

                    MessageBox.Show(this, "Job done!\n\nEverything worked!", this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (RenameProcessFailedException Ex)
                {
                    MessageBox.Show(this, "Could not rename these files:\n\n" + Ex.Message, this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception Ex)
                {
                    MessageBox.Show(this, "A error occured during the rename process:\n" + Ex.Message, this.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            previewWindow.Dispose();

            ResetGui();
        }