public void TestJson() { var file = @"C:\Users\a.sheglov\Desktop\example.txt"; var json = File.ReadAllText(file); var result = CapacitySearcher.Parse(json); }
public void GetIterationCapacity() { var tfs = new TfsTeamProjectCollection(new Uri("https://msk-tfs1.securitycode.ru/tfs/Endpoint%20Security")); var searcher = new CapacitySearcher(tfs); var cap = searcher.SearchActualCapacity(tfs.AuthorizedIdentity.DisplayName); //var workItemStore = tfs.GetService<WorkItemStore>(); //var teamService = tfs.GetService<TfsTeamService>(); //var css = tfs.GetService<ICommonStructureService>(); //var ims = tfs.GetService<IIdentityManagementService2>(); //var client = tfs.GetClient<WorkHttpClient>(); ////var allMineGroups = workItemStore //// .Projects //// .OfType<Project>() //// .SelectMany(x => ims.ListApplicationGroups(x.Uri.ToString(), ReadIdentityOptions.ExtendedProperties)) //// .Where(x => ims.IsMember(x.Descriptor, tfs.AuthorizedIdentity.Descriptor)) //// .ToList(); //var project = workItemStore.Projects["SNES"]; //var iter = client.GetTeamIterationsAsync(new TeamContext(project.Guid), "current").Result; //var guid = iter[0].Id; //var project = workItemStore.Projects["SNES"]; ////var mineGroups = teamService //// .QueryTeams(project.Uri.ToString()) //// .Where(x => ims.IsMember(x.Identity.Descriptor, tfs.AuthorizedIdentity.Descriptor)) //// .ToList(); //var team = teamService.QueryTeams(project.Uri.ToString()).FirstOrDefault(); //var node = css // .ListStructures(project.Uri.ToString()) // .Single(item => item.StructureType == "ProjectLifecycle"); //var iter = project // .IterationRootNodes // .OfType<Node>() // .Select(x => css.GetNodeFromPath($"{node.Path}\\{x.Name}")) // .Where(x => x.IsCurrent()) // .FirstOrDefault(); //var request = $"{tfs.Uri}/{project.Store.TeamProjectCollection.SessionId}/{project.Id}/{team.Identity.Descriptor.Identifier}/_apis/work/teamsettings/iterations/{iter.Name}"; //var allProjects = workItemStore.Projects.OfType<Project>().ToList(); //foreach (var proj in allProjects) //{ // try // { // var teams = GetMyTeams(teamService, proj); // // { // Console.WriteLine(sprint.Name); // // Console.WriteLine(iteration.StartDate); // Console.WriteLine(iteration.FinishDate); // if (iteration.IsCurrent()) // { // } // } // } // catch (Exception e) // { // continue; // } //} // var map = GetProjectsWithSettings(tfs.GetService<ProjectHttpClient>(), tfs.GetService<TeamSettingsConfigurationService>()); //IIdentityManagementService ims = tfs.GetService<IIdentityManagementService>(); //var identity = ims.ReadIdentity(IdentitySearchFactor.DisplayName, tfs.AuthorizedIdentity.DisplayName, MembershipQuery.Direct, ReadIdentityOptions.None); //WorkItemTrackingHttpClient workItemTrackingClient = tfs.GetClient<WorkItemTrackingHttpClient>(); //WorkItemClassificationNode result = workItemTrackingClient.GetClassificationNodeAsync( // "SNES", // TreeStructureGroup.Iterations, // null, // 4).Result; // //var teamSettings = tfs.GetService<>(); //var projects = css.ListAllProjects(); //TeamContext context = null; //string iterID = null; //var client = tfs.GetClient<WorkHttpClient>(); //var iters = client.GetTeamIterationsAsync(context, "current").Result; //var iteration = client.Пуе(context).Result; }