Esempio n. 1
0
 internal static void OnBrightnessCalculated(object sender, WorkFinishedEventArgs e)
 {
     if (BrightnessCalculated != null)
     {
         BrightnessCalculated(sender, e);
     }
 }
Esempio n. 2
0
 internal static void OnWorkDone(object sender, WorkFinishedEventArgs e)
 {
     if (WorkDone != null)
     {
         WorkDone(sender, e);
     }
 }
Esempio n. 3
0
 internal void OnFramesLoaded(object sender, WorkFinishedEventArgs e)
 {
     if (FramesLoaded != null)
     {
         FramesLoaded(sender, e);
     }
 }
Esempio n. 4
0
 internal static void OnFramesLoaded(object sender, WorkFinishedEventArgs e)
 {
     HasInit = true;
     if (FramesLoaded != null)
     {
         FramesLoaded(sender, e);
     }
 }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
 internal static void OnFramesLoaded(object sender, WorkFinishedEventArgs e)
 {
     HasInit = true;
     if (FramesLoaded != null) { FramesLoaded(sender, e); }
 }
Esempio n. 7
0
 internal static void OnWorkDone(object sender, WorkFinishedEventArgs e)
 {
     if (WorkDone != null) { WorkDone(sender, e); }
 }
Esempio n. 8
0
 private void CurrentProject_BrightnessCalculated(object sender, WorkFinishedEventArgs e)
 {
     InitPoints();
 }
Esempio n. 9
0
 internal static void OnBrightnessCalculated(object sender, WorkFinishedEventArgs e)
 {
     if (BrightnessCalculated != null) { BrightnessCalculated(sender, e); }
 }
Esempio n. 10
0
        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();
        }
Esempio n. 11
0
 internal void OnFramesLoaded(object sender, WorkFinishedEventArgs e)
 {
     if (FramesLoaded != null) { FramesLoaded(sender, e); }
 }
Esempio n. 12
0
        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); }
        }
Esempio n. 13
0
 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); }
 }
Esempio n. 14
0
 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); }
 }