internal static void OnBrightnessCalculated(object sender, WorkFinishedEventArgs e) { if (BrightnessCalculated != null) { BrightnessCalculated(sender, e); } }
internal static void OnWorkDone(object sender, WorkFinishedEventArgs e) { if (WorkDone != null) { WorkDone(sender, e); } }
internal void OnFramesLoaded(object sender, WorkFinishedEventArgs e) { if (FramesLoaded != null) { FramesLoaded(sender, e); } }
internal static void OnFramesLoaded(object sender, WorkFinishedEventArgs e) { HasInit = true; if (FramesLoaded != null) { FramesLoaded(sender, e); } }
protected void MainWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { throw e.Error; } //TODO: handle error (no direct UI call => no UI handle) KeyValuePair <Work, object> arg = (KeyValuePair <Work, object>)e.Result; WorkFinishedEventArgs eArgs = new WorkFinishedEventArgs(e.Cancelled, arg.Key); switch (arg.Key) { case Work.LoadFrames: if (e.Cancelled) { foreach (string s in (string[])arg.Value) { Frame f = Frames.FirstOrDefault(t => t.FilePath == s); if (f == null) { break; } else { Frames.Remove(f); } } } OnFramesLoaded(this, eArgs); break; case Work.CalculateBrightness: IsBrightnessCalculated = !e.Cancelled; OnBrightnessCalculated(this, eArgs); break; default: OnWorkDone(this, eArgs); break; } IsWorkingWaitHandler.Set(); }
private void CurrentProject_BrightnessCalculated(object sender, WorkFinishedEventArgs e) { InitPoints(); }
protected void MainWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { throw e.Error; } //TODO: handle error (no direct UI call => no UI handle) KeyValuePair<Work, object> arg = (KeyValuePair<Work, object>)e.Result; WorkFinishedEventArgs eArgs = new WorkFinishedEventArgs(e.Cancelled, arg.Key); switch (arg.Key) { case Work.LoadFrames: if (e.Cancelled) { foreach (string s in (string[])arg.Value) { Frame f = Frames.FirstOrDefault(t => t.FilePath == s); if (f == null) { break; } else { Frames.Remove(f); } } } OnFramesLoaded(this, eArgs); break; case Work.CalculateBrightness: IsBrightnessCalculated = !e.Cancelled; OnBrightnessCalculated(this, eArgs); break; default: OnWorkDone(this, eArgs); break; } IsWorkingWaitHandler.Set(); }
private void CurrentProject_WorkDone(object sender, WorkFinishedEventArgs e) { try { if (!e.Cancelled) { switch (e.Topic) { case Work.ProcessThumbs: UIHandler.RefreshImages(); break; case Work.LoadProject: UIHandler.InitOpenedProject(); break; } UIHandler.SetStatusLabel(Message.GetString(e.Topic.ToString()) + " " + Message.GetString("is done")); } else { UIHandler.SetStatusLabel(Message.GetString(e.Topic.ToString()) + " " + Message.GetString("got cancelled")); } UIHandler.SetProgress(0); } catch (Exception ex) { Error.Report("Work finished", ex); } }
private void CurrentProject_FramesLoaded(object sender, WorkFinishedEventArgs e) { try { UIHandler.SetStatusLabel(Message.GetString("Frames loaded")); UIHandler.RefreshImages(); UIHandler.SetProgress(0); UIHandler.InitAfterFrameLoad(); UIHandler.SelectTableRow(0); } catch (Exception ex) { Error.Report("Frames loading finished", ex); } }
private void CurrentProject_BrightnessCalculated(object sender, WorkFinishedEventArgs e) { try { UIHandler.SetStatusLabel(Message.GetString("Brightness calculated")); UIHandler.SetProgress(0); UpdateTable(false); MainGraph.RefreshGraph(); } catch (Exception ex) { Error.Report("Brightness calculation finished", ex); } }