本文整理汇总了C#中TaskType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TaskType.ToString方法的具体用法?C# TaskType.ToString怎么用?C# TaskType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskType
的用法示例。
在下文中一共展示了TaskType.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateStartTaskForId
public static HttpResponse UpdateStartTaskForId(string id, TaskType type)
{
var task = new Dictionary<string, object>();
task["id"] = id;
task["start"] = DateTime.UtcNow;
task["status"] = TaskStatus.running.ToString();
task["hostname"] = System.Net.Dns.GetHostName();
var tasktable = type.ToString();
var ts_response = TableStorage.UpmergeDictToTableStore(task, tasktable, partkey: master_pk, rowkey: id);
var http_response = ts_response.http_response;
GenUtils.LogMsg("status", "Scheduler.UpdateStartTaskForId: " + id, http_response.status.ToString());
return http_response;
}
示例2: TaskEntity
public TaskEntity(TaskType type)
{
Type = type;
SetKeys(null, type.ToString());
}
示例3: StoreTaskForId
public static void StoreTaskForId(Task task, string id, TaskType type)
{
task.hostname = System.Net.Dns.GetHostName();
var dict_obj = ObjectUtils.ObjToDictObj(task);
var tasktable = type.ToString();
var ts_response = TableStorage.UpmergeDictToTableStore(dict_obj, table: tasktable, partkey: master_pk, rowkey: id);
GenUtils.LogMsg("status", "Scheduler.StoreTaskForId: " + id, null);
}
示例4: UnlockId
public static HttpResponse UnlockId(string id, TaskType type)
{
//if (ExistsLockRecordForId(id, type)) // don't need to check, if doesn't exist delete will just fail
//{
var tasktable = type.ToString();
// return ts.DeleteEntity(tasktable, lock_pk, id).http_response; // don't need to wait for verification
return ts.MaybeDeleteEntity(tasktable, lock_pk, id).http_response;
//}
//else
// return default(HttpResponse);
}
示例5: LockId
public static HttpResponse LockId(string id, TaskType type)
{
var entity = new Dictionary<string, object>();
entity.Add("PartitionKey", lock_pk);
entity.Add("RowKey", id);
entity.Add("LockedAt", DateTime.UtcNow);
var tasktable = type.ToString();
var ts_response = ts.InsertEntity(tasktable, entity);
return ts_response.http_response;
}
示例6: StopTaskForId
public static void StopTaskForId(string id, TaskType type)
{
var task = new Dictionary<string, object>();
task["id"] = id;
task["stop"] = DateTime.UtcNow;
task["status"] = TaskStatus.stopped.ToString();
var tasktable = type.ToString();
var ts_response = TableStorage.UpmergeDictToTableStore(task, table: tasktable, partkey: master_pk, rowkey: id);
GenUtils.LogMsg("status", "Scheduler.StopTaskForId: " + id, ts_response.http_response.status.ToString());
}
示例7: IsLockedId
public static bool IsLockedId(string id, TaskType type)
{
var q = string.Format(TableStorage.query_template_pk_rk, lock_pk, id);
var tasktable = type.ToString();
return ts.ExistsEntity(tasktable, q);
}
示例8: InitTaskForId
public static void InitTaskForId(string id, TaskType type)
{
Scheduler.UnlockId(id, type);
var task = new Task(id);
var dict_obj = ObjectUtils.ObjToDictObj(task);
var tasktable = type.ToString();
var ts_response = TableStorage.UpdateDictToTableStore(dict_obj, table: tasktable, partkey: master_pk, rowkey: id);
var http_response = ts_response.http_response;
GenUtils.LogMsg("status", "Scheduler.InitTaskForId: " + id, http_response.status.ToString());
}
示例9: FetchTaskForId
public static Task FetchTaskForId(string id, TaskType type)
{
var q = string.Format(task_query_template, master_pk, id);
var tasktable = type.ToString();
var dict_obj = TableStorage.QueryForSingleEntityAsDictObj(ts, tasktable, q);
var task = (Task)ObjectUtils.DictObjToObj(dict_obj, new Task().GetType());
task.start = task.start.ToUniversalTime();
task.stop = task.stop.ToUniversalTime();
return task;
}
示例10: ExistsLockRecordForId
public static bool ExistsLockRecordForId(string id, TaskType type)
{
var q = string.Format(task_query_template, lock_pk, id);
var tasktable = type.ToString();
var dict_obj = TableStorage.QueryForSingleEntityAsDictObj(ts, tasktable, q);
return dict_obj.Keys.Count != 0;
}
示例11: UnlockId
public static HttpResponse UnlockId(string id, TaskType type)
{
if (ExistsLockRecordForId(id, type))
{
var tasktable = type.ToString();
return ts.DeleteEntity(tasktable, lock_pk, id).http_response;
}
else
return default(HttpResponse);
}