private void CreateThreadForGetItem(object jobId) { try { string result = ""; TranslationJobStatus jobStatus = new TranslationJobStatus(cc, new Guid((string)jobId)); jobStatus.Refresh(); cc.ExecuteQuery(); result += ListJobItems(jobStatus, ItemTypes.Canceled); result += ListJobItems(jobStatus, ItemTypes.Failed); result += ListJobItems(jobStatus, ItemTypes.InProgress); result += ListJobItems(jobStatus, ItemTypes.NotStarted); result += ListJobItems(jobStatus, ItemTypes.Succeeded); DispatcherOperation dop = Dispatcher.BeginInvoke(new Action <string>(PrintResult), result); } catch (Exception e) { DispatcherOperation dop = Dispatcher.BeginInvoke(new Action <string>(PrintResult), e.ToString()); } }
static void TestGetItems(string guid) { TranslationJobStatus jobStatus = new TranslationJobStatus(cc, new Guid(guid)); cc.Load(jobStatus); cc.ExecuteQuery(); Console.WriteLine("Job Status"); Console.WriteLine("jobStatus.Name" + jobStatus.Name); Console.WriteLine("jobStatus.Count" + jobStatus.Count); Console.WriteLine("jobStatus.Canceled" + jobStatus.Canceled); Console.WriteLine("jobStatus.Failed" + jobStatus.Failed); Console.WriteLine("jobStatus.InProgress" + jobStatus.InProgress); Console.WriteLine("jobStatus.NotStarted" + jobStatus.NotStarted); Console.WriteLine("jobStatus.Succeeded" + jobStatus.Succeeded); ListJobItems(jobStatus, ItemTypes.Canceled); ListJobItems(jobStatus, ItemTypes.Failed); jobStatus.Refresh(); cc.ExecuteQuery(); ListJobItems(jobStatus, ItemTypes.InProgress); ListJobItems(jobStatus, ItemTypes.NotStarted); ListJobItems(jobStatus, ItemTypes.Succeeded); }
private void CreateThreadForGetItem(object jobId) { try { string result = ""; TranslationJobStatus jobStatus = new TranslationJobStatus(cc, new Guid((string)jobId)); jobStatus.Refresh(); cc.ExecuteQuery(); result += ListJobItems(jobStatus, ItemTypes.Canceled); result += ListJobItems(jobStatus, ItemTypes.Failed); result += ListJobItems(jobStatus, ItemTypes.InProgress); result += ListJobItems(jobStatus, ItemTypes.NotStarted); result += ListJobItems(jobStatus, ItemTypes.Succeeded); DispatcherOperation dop = Dispatcher.BeginInvoke(new Action<string>(PrintResult), result); } catch (Exception e) { DispatcherOperation dop = Dispatcher.BeginInvoke(new Action<string>(PrintResult), e.ToString()); } }