コード例 #1
0
        private void RequestWaveFormImages(ProjectLineContainer container, int height)
        {
            var task = new Task(() => ExceptionCatcher.Current.CatchOnAction(() => container.LoadImages(height), $"Failed to load images for [{container}]"));

            task.ContinueWith(delegate
            {
                try
                {
                    App.MainDispatcher.Invoke(delegate
                    {
                        container.FinishImagesLoading();
                        HandleLoaded(container);
                    });
                }
                catch (TaskCanceledException) { }
            });
            taskQueue[container] = task;
        }
コード例 #2
0
 public OtoContainer(Oto oto, ProjectLineContainer baseContainer)
 {
     Oto = oto;
     BaseProjectLineContainer = baseContainer;
 }
コード例 #3
0
 private void HandleLoaded(ProjectLineContainer container)
 {
     Console.WriteLine("TaskManager: " + container.ToString() + " loaded");
     runningTasks.TryRemove(container, out _);
     StartTask();
 }