当前位置: 首页>>代码示例>>C#>>正文


C# TaskType.ToString方法代码示例

本文整理汇总了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;
 }
开发者ID:judell,项目名称:elmcity,代码行数:13,代码来源:Scheduler.cs

示例2: TaskEntity

 public TaskEntity(TaskType type)
 {
     Type = type;
     SetKeys(null, type.ToString());
 }
开发者ID:tamilselvamr,项目名称:branch,代码行数:5,代码来源:TaskEntity.cs

示例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);
 }
开发者ID:judell,项目名称:elmcity,代码行数:8,代码来源:Scheduler.cs

示例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);
 }
开发者ID:judell,项目名称:elmcity,代码行数:11,代码来源:Scheduler.cs

示例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;
 }
开发者ID:judell,项目名称:elmcity,代码行数:10,代码来源:Scheduler.cs

示例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());
 }
开发者ID:judell,项目名称:elmcity,代码行数:10,代码来源:Scheduler.cs

示例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);
 }
开发者ID:judell,项目名称:elmcity,代码行数:6,代码来源:Scheduler.cs

示例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());
        }
开发者ID:judell,项目名称:elmcity,代码行数:11,代码来源:Scheduler.cs

示例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;
 }
开发者ID:judell,项目名称:elmcity,代码行数:10,代码来源:Scheduler.cs

示例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;
 }
开发者ID:judell,项目名称:elmcity,代码行数:7,代码来源:Scheduler.cs

示例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);
 }
开发者ID:jalbertbowden,项目名称:elmcity,代码行数:10,代码来源:Scheduler.cs


注:本文中的TaskType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。