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; }
public OtoContainer(Oto oto, ProjectLineContainer baseContainer) { Oto = oto; BaseProjectLineContainer = baseContainer; }
private void HandleLoaded(ProjectLineContainer container) { Console.WriteLine("TaskManager: " + container.ToString() + " loaded"); runningTasks.TryRemove(container, out _); StartTask(); }