using System; using System.Collections.Generic; using Falcon.TaskScheduling; namespace Falcon.TaskSchedulingTests { public class TaskUnit:ITaskUnit { public string State { get; set; } public string Result { get; set; } public TaskType Type { get; set; } public static List ResultList { get; set; } = new List(); public TaskUnit() { this.State = ""; } public TaskUnit(string state,TaskType type) { this.State = state; this.Type = type; } public object Run() { return this.State as object; } public void TaskCallback(object result,Exception ex) { if(result is string str) { this.Result = str; } else { this.Result = ""; } ResultList.Add(this); } } public enum TaskType { system, first, queue, idel, } }