private bool OkToClose() { if (!TheTVDB.LocalCache.Instance.HasSeries(codeFinderForm.SelectedCode())) //todo Get add show to work with TVMAZE { DialogResult dr = MessageBox.Show("tvdb code unknown, close anyway?", "TVRename Add/Edit Show", 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 Show", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } if (chkAutoFolders.Checked && string.IsNullOrWhiteSpace(txtBaseFolder.Text)) { MessageBox.Show("Please enter base folder for this show or turn off automatic folders", "TVRename Add/Edit Show", MessageBoxButtons.OK, MessageBoxIcon.Warning); Folders.SelectedTab = tabPage5; txtBaseFolder.Focus(); return(false); } if (chkAutoFolders.Checked && !TVSettings.OKPath(txtBaseFolder.Text, false)) { MessageBox.Show("Please check the base folder is a valid one and has no invalid characters" , "TVRename Add/Edit Show", MessageBoxButtons.OK, MessageBoxIcon.Warning); Folders.SelectedTab = tabPage5; txtBaseFolder.Focus(); return(false); } if (chkAutoFolders.Checked && rdoFolderCustom.Checked && !txtSeasonFormat.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; txtSeasonFormat.Focus(); return(false); } return(true); }
private void SetShowItem() { int code = codeFinder.SelectedCode(); ShowItem.TvdbCode = code; ShowItem.AutoAddFolderBase = cbDirectory.Text + lblDirectoryName.Text; ShowItem.AutoAddType = ShowItem.AutomaticFolderType.libraryDefault; //Set Default Timezone based on Network ShowItem.ShowTimeZone = TimeZoneHelper.TimeZoneForNetwork(codeFinder.SelectedShow()?.Network); if (!originalHint.Contains(codeFinder.SelectedShow().Name, StringComparison.OrdinalIgnoreCase)) { ShowItem.AliasNames.Add(originalHint); } }
private void SetShowItem() { int code = codeFinder.SelectedCode(); ShowItem.TvdbCode = code; ShowItem.AutoAddFolderBase = cbDirectory.Text + lblDirectoryName.Text; //Set Default Timezone and if not then set on Network ShowItem.ShowTimeZone = TVSettings.Instance.DefaultShowTimezoneName ?? TimeZoneHelper.TimeZoneForNetwork(codeFinder.SelectedShow()?.Network, ShowItem.ShowTimeZone); if (!originalHint.Contains(codeFinder.SelectedShow().Name, StringComparison.OrdinalIgnoreCase)) { ShowItem.AliasNames.Add(originalHint); } }
private bool OkToClose() { if (!TheTVDB.Instance.HasSeries(codeFinderForm.SelectedCode())) { DialogResult dr = MessageBox.Show("tvdb code unknown, close anyway?", "TVRename Add/Edit Show", 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 Show", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(true); }
private void bnOK_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; Code = codeFinderControl.SelectedCode(); Close(); }