public Tuple <bool, List <TaskResult>, string> GetTaskList(TaskParam param) { var body = Newtonsoft.Json.JsonConvert.SerializeObject(param); var url = this.GetPostUrl(Method_GetTaskList, body); return(this.Post <List <TaskResult> >(url, body)); }
}//функция считает значение CP public Model(BaseLayer baseLayer, Preferences preferences) { //конструктор класса, создает задачу и константу (только одна, Ставка) _baseLayer = baseLayer; _preferences = preferences; stake = new TaskParamName() { Name = "Ставка" }; stakeValue = new TaskParam { Task = _baseLayer.Task }; bonus = new EventParamName() { Name = "Бонус" }; soeg = new CombinParamName() { Name = "SoEG" }; InitialEvents = preferences.evenoddGame ? InitialEvents = preferences.evenoddNames : InitialEvents = preferences.numericNames; game = new Dice(InitialEvents.Length, preferences.numberofthrowings); //, preferences.numberofoutcomesperstake); GenerateEvents(); }//конструктор класса*/
public TaskParam CreateTaskParam(TaskContent contentinfo) { var param = new TaskParam(); param.taskID = contentinfo.TaskId; param.taskName = contentinfo.TaskName; param.tmBeg = DateTimeFormat.DateTimeFromString(contentinfo.Begin); return(param); }
public void AddTaskParam(Task task, TaskParam param, TaskParamName name, decimal value) { if (param == null || task == null || name == null) { return; } param.Task = task; param.TaskParamName = name; param.Value = value; dssDbContext.TaskParams.Add(param); }
public void AddCB(ResLoadDelegate cb, ResLoadParams param) { if (cb == null) { return; } TaskParam tp = new TaskParam(); tp._cb = cb; tp._param = param; lstTask.Add(tp); }
public void ChangePriorityTop(string name) { lock (lockObject) { TaskParam taskParam = tasks.Find((TaskParam o) => o.name == name); if (taskParam != null) { tasks.Remove(taskParam); tasks.Insert(0, taskParam); } } }
public void Add(string name, Action act) { if (threads != null) { TaskParam taskParam = new TaskParam(); taskParam.name = name; taskParam.act = act; lock (lockObject) { tasks.Add(taskParam); } } }
/// <summary> /// 新增待处理事件 /// </summary> /// <param name="callerName"></param> protected void CLPush(string callerName, TaskParam arg = TaskParam._Default) { lock (CommandLock) { if (arg != TaskParam._Default) { CommandList.Add(callerName + arg); } else { CommandList.Add(callerName); } } }
public Model(BaseLayer _baseLayer, Preferences _preferences) { baseLayer = _baseLayer; preferences = _preferences; numberOfHeads = new EventParamName() { Name = "Кол-во Г" }; numberOfTails = new EventParamName() { Name = "Кол-во Р" }; numberOfDoubleHeads = new EventParamName() { Name = "Кол-во ГГ" }; headBonus = new TaskParamName() { Name = "Бонус за Г" }; tailCost = new TaskParamName() { Name = "Бонус за Р" }; doubleHeadBonus = new TaskParamName() { Name = "Бонус за ГГ" }; headBonusValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.HeadBonus }; tailCostValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.TailCost }; doubleHeadBonusValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.DoubleHeadBonus }; InitialEvents = new char[] { 'Г', 'Р' }; game = new Coin(InitialEvents.Length, preferences.NumberOfThrowings); numberOfHeadsInOutcomes = game.CountSequences(0); numberOfTailsInOutcomes = game.CountSequences(1); numberOfDoubleHeadsInOutcomes = game.CountSequences(0, 3); }
private void Worker() { try { TaskParam taskParam = null; while (!stopAllThreads) { if (tasks.Count > 0 || taskParam != null) { lock (lockObject) { if (taskParam != null) { workingCount--; taskParam = null; } if (tasks.Count > 0) { taskParam = tasks[0]; tasks.RemoveAt(0); workingCount++; } } if (taskParam != null && taskParam.act != null) { taskParam.act(); } } } } catch (Exception ex) { if (!(ex is ThreadAbortException)) { Debug.LogError((object)("MultiThreadTaskRunner : " + ex.ToString())); } } }
public TaskParams() { Shtraf = new TaskParam(); Premia = new TaskParam(); }
public TaskParam(TaskParam obj) : this(obj.i, obj.mSec) { }