forked from e-mgam-e/Lab1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunner.cs
More file actions
36 lines (29 loc) · 878 Bytes
/
Runner.cs
File metadata and controls
36 lines (29 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lab1.Interfaces;
using OxyPlot;
namespace Lab1
{
public class Runner
{
private readonly List<ITask> tasks = new List<ITask>();
// Графики, собранные после выполнения задач
public List<PlotModel> Models { get; } = new List<PlotModel>();
public void AddTask(ITask task) => tasks.Add(task);
public void RunAll()
{
Models.Clear();
foreach (var task in tasks)
{
Console.WriteLine($"Запуск: {task.Name}");
task.Run();
if (task.LastPlotModel != null)
Models.Add(task.LastPlotModel);
Console.WriteLine();
}
}
}
}