/// <summary> /// Initializes a new instance of the <see cref="AddNewWindow"/> class. /// </summary> public EditShowWindow(int id, string show) { InitializeComponent(); _id = id; _show = show; nameTextBox.Text = _show; var release = Database.TVShows[_id]; if (!string.IsNullOrWhiteSpace(release.Release)) { customReleaseName.IsChecked = releaseTextBox.IsEnabled = true; releaseTextBox.Text = release.Release; } else { customReleaseName.IsChecked = releaseTextBox.IsEnabled = false; releaseTextBox.Text = ShowNames.Parser.GenerateTitleRegex(show).ToString(); } switch (Database.ShowData(_id, "grabber")) { case "TVRage": database.SelectedIndex = 1; break; case "TVDB": database.SelectedIndex = 2; break; case "TVcom": database.SelectedIndex = 3; break; case "EPisodeWorld": database.SelectedIndex = 4; break; case "IMDb": database.SelectedIndex = 5; break; case "AniDB": database.SelectedIndex = 6; break; case "Anime News Network": database.SelectedIndex = 7; break; case "EPGuides": database.SelectedIndex = 10; break; } _guide = AddNewWindow.CreateGuide((((database.SelectedValue as ComboBoxItem).Content as StackPanel).Children[1] as Label).Content.ToString().Trim()); _lang = Database.ShowData(_id, _guide.GetType().Name + ".lang"); var sel = 0; foreach (var lang in _guide.SupportedLanguages) { var sp = new StackPanel { Orientation = Orientation.Horizontal, Tag = lang }; sp.Children.Add(new Image { Source = new BitmapImage(new Uri("/RSTVShowTracker;component/Images/flag-" + lang + ".png", UriKind.Relative)), Height = 16, Width = 16, Margin = new Thickness(0, 0, 0, 0) }); sp.Children.Add(new Label { Content = " " + Languages.List[lang], Padding = new Thickness(0) }); language.Items.Add(sp); if (lang == _lang) { sel = language.Items.Count - 1; } } language.SelectedIndex = sel; switch (FileNames.Parser.GetEpisodeNotationType(_id)) { default: case "standard": standardRadioButton.IsChecked = true; break; case "airdate": dateRadioButton.IsChecked = true; if (FileNames.Parser.AirdateNotationShows.Contains(Utils.CreateSlug(show))) { standardRadioButton.IsEnabled = false; } break; } }