private void ShowSplashScreen(Entities.JobProgress progress = null) { try { Presentation.Controllers.SplashScreen.Show(progress); Application.DoEvents(); } catch { /*Splash screen failed. No problem. */ } }
public JobProgress(Entities.JobProgress Progress) { InitializeComponent(); this.appUpdAsyncHelper = new AsyncCalls(); job = Progress; if (job != null) { job.PropertyChanged += new PropertyChangedEventHandler(job_PropertyChanged); } }
internal static void Show(Entities.JobProgress progress = null) { if (frmSplash == null) { frmSplash = new FrmSplashScreen(); } frmSplash.Progress = progress; frmSplash.Show(); System.Windows.Forms.Application.DoEvents(); }
private void Update(Entities.JobProgress info) { // Ensure inside UI thread if (!this.appUpdAsyncHelper.Execute( this, new UpdateDelegate(Update), info)) { return; } if (this.InvokeRequired) { return; } switch (info.Status) { case Entities.JobProgress.JobStatus.InProgress: if (!this.Visible) { this.Visible = true; } break; case Entities.JobProgress.JobStatus.Idle: case Entities.JobProgress.JobStatus.Done: if (this.Visible) { this.Visible = false; } break; } this.lblJobName.Text = info.JobName; this.pgsMainBar.Value = info.Percent; Application.DoEvents(); }
void job_PropertyChanged(object sender, PropertyChangedEventArgs e) { Entities.JobProgress progress = (Entities.JobProgress)sender; Update(progress); }