Exemple #1
0
        private async Task BuscarDetalhesWorkItems(VssConnection connection, string projeto)
        {
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            try
            {
                WorkItemService service   = new WorkItemService();
                int             ultimoId  = service.BuscarUltimoIdInserido();
                List <WorkItem> workItems = new List <WorkItem>();
                for (int i = ultimoId + 1; i <= ultimoId + 200; i++)
                {
                    try
                    {
                        workItems.Add(await witClient.GetWorkItemAsync(projeto, i));
                    }
                    catch
                    {
                        break;
                    }
                }

                Console.Write("Foram encontradas " + workItems.Count + " Data: " + DateTime.Now.ToString("dd/MM/yyyy hh:MM"));

                lista = CarregarItemsEncontrados(workItems);
            }
            catch (Exception ex)
            {
                Console.Write("Ocorreu um erro na busca pelas WorkItems. Data do Erro: " + DateTime.Now.ToString("dd/MM/yyyy hh:MM"));
            }
        }