Exemple #1
0
        void UpdateFormThreadSafe(TvdbHandler.UpdateProgressEventArgs _event)
        {
            try
            {
                if (!InvokeRequired)
                {
                    switch (_event.CurrentUpdateStage)
                    {
                    case TvdbHandler.UpdateProgressEventArgs.UpdateStage.downloading:
                        lblUpdateStage.Text = "Downloading updates";
                        break;

                    case TvdbHandler.UpdateProgressEventArgs.UpdateStage.seriesupdate:
                        lblUpdateStage.Text = "Updating series";
                        break;

                    case TvdbHandler.UpdateProgressEventArgs.UpdateStage.episodesupdate:
                        lblUpdateStage.Text = "Updating episode";
                        break;

                    case TvdbHandler.UpdateProgressEventArgs.UpdateStage.bannerupdate:
                        lblUpdateStage.Text = "Updating banners";
                        break;

                    case TvdbHandler.UpdateProgressEventArgs.UpdateStage.finishupdate:
                        lblUpdateStage.Text = "Updating Finished";
                        break;
                    }

                    ibUpdateProgress.BarFillProcent = _event.CurrentStageProgress;
                    txtUpdateProgress.Text          = _event.CurrentUpdateDescription;
                }
                else
                {
                    Invoke(new UpdateFormThreadSafeDelegate(UpdateFormThreadSafe), new object[] { _event });
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #2
0
 private void TvdbHandlerOnUpdateProgressed(TvdbHandler.UpdateProgressEventArgs args)
 {
     ServiceRegistration.Get <ILogger>().Debug("TvDbWrapper: ... {0} {2}. Total: {3}", args.CurrentUpdateStage, args.CurrentStageProgress, args.CurrentUpdateDescription, args.OverallProgress);
 }
Exemple #3
0
 void m_tvdbHandler_UpdateProgressed(TvdbHandler.UpdateProgressEventArgs _event)
 {
     UpdateFormThreadSafe(_event);
 }