Beispiel #1
0
        private void B_Rename_Click(object sender, EventArgs e)
        {
            if (TB_FolderPath.Text.Length < 3 || !Directory.Exists(TB_FolderPath.Text))
            {
                MessageBox.Show("Folder Path is not Valid", "Invalid Folder Path", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (L_SeasonCount.Text == "0")
            {
                MessageBox.Show("No " + (MovieMode ? "movies" : "episodes") + " were detected, choose another folder", "No Files Detected", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (SelectedNamingStyle == -1)
            {
                MessageBox.Show("No Naming Style is selected, choose a naming style before continuing", "No Naming Style", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (TB_SeriesName.Text == "")
            {
                MessageBox.Show("Series Name can not be Empty", "No Series Name", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (!MovieMode && !Episode.EpIsValid(NamingStyles[SelectedNamingStyle].GetEpName(new Episode(2, 13, "Ep Name"))))
            {
                if (DialogResult.Cancel == MessageBox.Show("The current Naming Style will not be \ndetectable by the App after the Re-Name.\n\nDo you want to continue anyway?", "Naming Style Undetectable", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk))
                {
                    if (!AddNamingRule())
                    {
                        return;
                    }
                }
                else
                {
                    AddNamingRule();
                }
            }

            Form1.renameSubForm.Prepare();
            Form1.renameSubForm.Show();
            Hide();
            Form1.renameSubForm.Start();
        }
Beispiel #2
0
        private void B_Continue_Click(object sender, EventArgs e)
        {
            if (TB_FolderPath.Text.Length < 3 || !Directory.Exists(TB_FolderPath.Text))
            {
                MessageBox.Show("Folder Path is not Valid", "Invalid Folder Path", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (L_SeasonCount.Text == "0")
            {
                MessageBox.Show("No " + (MovieMode ? "movies" : "episodes") + " were detected, choose another folder", "No Files Detected", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (SelectedNamingStyle == -1)
            {
                MessageBox.Show("No Naming Style is selected, choose a naming style before continuing", "No Naming Style", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (TB_SeriesName.Text == "")
            {
                MessageBox.Show("Series Name can not be Empty", "No Series Name", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            if (!MovieMode && !Episode.EpIsValid(NamingStyles[SelectedNamingStyle].GetEpName(new Episode(2, 13, "Ep Name"))))
            {
                if (DialogResult.Cancel == MessageBox.Show("The current Naming Style will not be \ndetectable by the App after the Re-Name.\n\nDo you want to continue anyway?", "Naming Style Undetectable", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk))
                {
                    if (!AddNamingRule())
                    {
                        return;
                    }
                }
                else
                {
                    AddNamingRule();
                }
            }

            Cursor.Current = Cursors.WaitCursor;
            foreach (var Season in Seasons)
            {
                Season.Control?.RefreshName();
                foreach (var Episode in Season.Episodes)
                {
                    Episode.Control?.RefreshName();
                    foreach (var Sub in Episode.Subs)
                    {
                        Sub.Control?.RefreshName();
                    }
                }
            }

            foreach (var Movie in Movies)
            {
                Movie.Control?.RefreshName();
                foreach (var Sub in Movie.Subs)
                {
                    Sub.Control?.RefreshName();
                }
            }

            Form1.reviewSubForm.CB_CleanFolders.Checked   = O_CleanFolders;
            Form1.reviewSubForm.CB_ReOrderFolders.Checked = O_ReOrderFolders;
            Form1.reviewSubForm.ToggleDesignMode();
            Form1.reviewSubForm.Show();
            Hide();
            Cursor.Current = Cursors.Default;
        }