示例#1
0
 /// <summary>
 /// see whether task has some success
 /// </summary>
 /// <param name="task"></param>
 /// <param name="minnetsuccess"></param>
 /// <returns></returns>
 public static bool HasNetSuccess(string task, int minnetsuccess)
 {
     TaskStatus ts = new TaskStatus();
     string fn = GetDbPath(task);
     if (Util.FromFile<TaskStatus>(fn, ref ts))
     {
         return ts.NetSuccess >= minnetsuccess;
     }
     return false;
 }
示例#2
0
 /// <summary>
 /// gets a task
 /// </summary>
 /// <param name="task"></param>
 /// <returns></returns>
 public static TaskStatus GetTask(string task)
 {
     TaskStatus ts = new TaskStatus();
     string fn = GetDbPath(task);
     if (Util.FromFile<TaskStatus>(fn, ref ts))
     {
         return ts;
     }
     return ts;
 }
示例#3
0
        /// <summary>
        /// count successful task
        /// </summary>
        /// <param name="task"></param>
        public static void CountSuccess(string task)
        {
            TaskStatus ts = new TaskStatus();
            string fn = GetDbPath(task);
            if (Util.FromFile<TaskStatus>(fn, ref ts))
            {

            }
            ts.Task = task;
            ts.Attempts++;
            ts.Successes++;
            Util.ToFile<TaskStatus>(ts, fn);
        }