Beispiel #1
0
        private bool OkToClose()
        {
            if (!TMDB.LocalCache.Instance.HasMovie(codeFinderForm.SelectedCode())) //todo Get add show to work with other providers
            {
                DialogResult dr = MessageBox.Show("tvdb code unknown, close anyway?", "TVRename Add/Edit Movie",
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dr == DialogResult.No)
                {
                    return(false);
                }
            }
            if (chkCustomLanguage.Checked && string.IsNullOrWhiteSpace(cbLanguage.SelectedItem?.ToString()))
            {
                MessageBox.Show("Please enter language for the show or accept the default preferred language", "TVRename Add/Edit Movie",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return(false);
            }
            if (chkAutoFolders.Checked && string.IsNullOrWhiteSpace(cbDirectory.SelectedItem.ToString()))
            {
                MessageBox.Show("Please enter base folder for this show or turn off automatic folders", "TVRename Add/Edit Movie",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);

                Folders.SelectedTab = tabPage5;
                cbDirectory.Focus();

                return(false);
            }
            if (chkAutoFolders.Checked && !TVSettings.OKPath(cbDirectory.SelectedItem.ToString(), false))
            {
                MessageBox.Show("Please check the base folder is a valid one and has no invalid characters"
                                , "TVRename Add/Edit Movie",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);

                Folders.SelectedTab = tabPage5;
                cbDirectory.Focus();

                return(false);
            }

            if (chkAutoFolders.Checked && rdoFolderCustom.Checked && !txtFolderNameFormat.Text.IsValidDirectory())
            {
                MessageBox.Show("Please check the custom subdirectory is a valid one and has no invalid characters"
                                , "TVRename Add/Edit Show",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);

                Folders.SelectedTab = tabPage5;
                txtFolderNameFormat.Focus();

                return(false);
            }

            return(true);
        }
 private void MatchDoubleClick(object sender, EventArgs e)
 {
     DialogResult = DialogResult.OK;
     Code         = codeFinderControl.SelectedCode();
     Close();
 }