コード例 #1
0
ファイル: FormMain.cs プロジェクト: JannesP/StreamsitePlayer
 public async void OpenSeries(Series series)
 {
     currentProvider = StreamProvider.Create(series.Provider);
     await currentProvider.LoadSeriesAsync(series.LinkExtension, comboBoxChangeSeries);
     if (currentProvider.GetSeasonCount() != 0) selectedSeason = 1;
     if (player != null)
     {
         player.StreamProvider = currentProvider;
     }
     Settings.WriteValue(Settings.LAST_SERIES, currentProvider.GetLinkExtension());
     Settings.SaveFileSettings();
     if (tcpServer != null)
     {
         tcpServer.BroadcastInfo(InfoNetworkMessage.InfoMessage.SeriesChanged);
     }
     BuildUIForCurrentProvider();
     HighlightCurrentEpisode(true);
 }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: JannesP/StreamsitePlayer
 private void RemoveSeries(Series series)
 {
     downloadToolStripMenuItem.Enabled = false;
     refreshToolStripMenuItem.Enabled = false;
     seriesToolStripMenuItem.Enabled = false;
     Seriescache.RemoveCachedSeries(series);
     comboBoxChangeSeries.Items.Remove(series);
     if (player != null && !player.IsDisposed)
     {
         player.Close();
         player = null;
     }
     currentProvider = null;
     ClearEpisodePanel();
 }
コード例 #3
0
 private void comboBoxStreamingProvider_SelectedIndexChanged(object sender, EventArgs e)
 {
     currentProvider = StreamProvider.Create((string)comboBoxStreamingProvider.SelectedItem);
     switch (currentProvider.SupportedSearchMode)
     {
         case StreamProvider.SearchMode.LOCAL:
             FormLoadingIndicator.ShowDialog(this, "Loading autocomplete list, please be patient ...");
             currentProvider.RequestSearchIndexAsync(CurrentCancellationTokenSource.Token).ContinueWith((indexTask) => {
                 textBoxSeries.Invoke((MethodInvoker)(() => {
                     if (indexTask.IsCanceled || indexTask.IsFaulted)
                     {
                         Util.ShowUserInformation("Couldn't load search index!");
                         textBoxSeries.UsedAutoCompleteMode = CustomTextBoxTest.CustomAutoCompleteTextBox.AutoCompleteMode.None;
                     }
                     else
                     {
                         SearchDictionary = indexTask.Result;
                         textBoxSeries.UsedAutoCompleteMode = CustomTextBoxTest.CustomAutoCompleteTextBox.AutoCompleteMode.Index;
                         textBoxSeries.FuzzyAutoCompleteSource = SearchDictionary.Keys.ToList();
                         buttonOpenOverview.Enabled = true;
                         textBoxSeries.Enabled = true;
                         textBoxSeries.Select();
                     }
                     FormLoadingIndicator.CloseDialog();
                 }));
             });
             break;
         case StreamProvider.SearchMode.REMOTE:
             textBoxSeries.Invoke((MethodInvoker)(() =>
             {
                 cachedRemoteSearches = new Dictionary<string, Dictionary<string, string>>();
                 textBoxSeries.UsedAutoCompleteMode = CustomTextBoxTest.CustomAutoCompleteTextBox.AutoCompleteMode.Suggestions;
                 textBoxSeries.FuzzyAutoCompleteSource = new List<string>();
                 buttonOpenOverview.Enabled = true;
                 textBoxSeries.Enabled = true;
                 textBoxSeries.Select();
             }));
             break;
         default:
             Logger.Log(TAG, "Searchmode not handled!");
             break;
     }
 }