private void lstVIew_ItemActivated(object sender, EventArgs e) { //This is needed incase the user tries to select multiple series and press ENTER, you can only upload one serie at a time. if (StaticInfo.CurrentDatabase == null) { MessageBox.Show("There doesent seem to be a functional database configured. Please configure one and try again."); return; } if (string.IsNullOrWhiteSpace(StaticInfo.CurrentDatabase.DatabaseName)) { MessageBox.Show("There doesent seem to be a functional database configured. Please configure one and try again."); return; } if (lstView_SeriesFromAPI.SelectedItems.Count > 1) { MessageBox.Show("Vennligst bare velg en ting du vil laste opp"); return; } if (lstView_SeriesFromAPI.SelectedItems.Count == 0) { MessageBox.Show("Vennligst velg en ting du vil laste opp"); return; } CLSerie serie = currentList.Find(x => x.name == lstView_SeriesFromAPI.SelectedItems[0].Name); AddSeries addSeries = new AddSeries(serie); addSeries.ShowDialog(); }
private void txt_Search_KeyDown(object sender, KeyEventArgs e) { if (e.Shift && e.KeyCode == Keys.Enter && File.Exists(StaticInfo.LocalSeriesPath + txt_Search.Text + ".json")) { ConfigurationManager manager = new ConfigurationManager(); JObject JOserie = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(File.ReadAllText(StaticInfo.LocalSeriesPath + txt_Search.Text + ".json")); CLSerie serie = manager.GetSeriesFromJson(JOserie); AddSeries addSeries = new AddSeries(serie); addSeries.ShowDialog(); } else if (e.KeyCode == Keys.Enter) { btn_ConfirmSearch.PerformClick(); } else if (e.Control && e.KeyCode == Keys.L) { LatestWatched watched = new LatestWatched(); watched.ShowDialog(); } }