public System.Action GenerateAction(int taskID, ActionModel action) { return(() => { var result = new ActionResultModel(); result.ID = action.ID; result.Result = new Dictionary <int, string>(); result.Result.Add((int)CommonResultKeyType.IsSuccess, "false"); try { ShutDownSys.ShutDown(); Debug.WriteLine("执行关机"); result.Result[(int)CommonResultKeyType.IsSuccess] = "true"; } catch { } //返回数据 ActionTaskResulter.Add(taskID, result); }); }
public System.Action GenerateAction(int taskID, ActionModel action) { return(() => { OnEventStateChanged?.Invoke(taskID, action.ID, ActionInvokeStateType.Runing); var result = new ActionResultModel(); result.ID = action.ID; result.Result = new Dictionary <int, object>(); result.Result.Add((int)CommonResultKeyType.IsSuccess, false); try { ShutDownSys.ShutDown(); Debug.WriteLine("执行关机"); result.Result[(int)CommonResultKeyType.IsSuccess] = true; } catch { } //返回数据 ActionTaskResulter.Add(taskID, result); OnEventStateChanged?.Invoke(taskID, action.ID, ActionInvokeStateType.Done); }); }