public bool DeleteTeam()
        {
            // Use the previously created team (from the sample above)
            WebApiTeamRef        team;
            TeamProjectReference project = ClientSampleHelpers.FindAnyProject(this.Context);

            if (!this.Context.TryGetValue <WebApiTeamRef>("$newTeam", out team) || !this.Context.TryGetValue <TeamProjectReference>("$projectOfNewTeam", out project))
            {
                throw new Exception("Run the create team sample above first.");
            }

            // Get a client
            VssConnection  connection = Context.Connection;
            TeamHttpClient teamClient = connection.GetClient <TeamHttpClient>();

            try
            {
                teamClient.DeleteTeamAsync(project.Id.ToString(), team.Id.ToString()).SyncResult();

                Console.WriteLine("'{0}' team deleted from project {1}", team.Name, project.Name);

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Unable to delete team: " + ex);

                return(false);
            }
        }
Exemplo n.º 2
0
        public void DeleteTeam(string project, string team)
        {
            VssConnection  connection     = new VssConnection(_uri, _credentials);
            TeamHttpClient teamHttpClient = connection.GetClient <TeamHttpClient>();

            teamHttpClient.DeleteTeamAsync(project, team).SyncResult();
        }
Exemplo n.º 3
0
 public void DeleteTeam(string project, string team)
 {
     // create team object
     using (TeamHttpClient teamHttpClient = new TeamHttpClient(_uri, _credentials))
     {
         teamHttpClient.DeleteTeamAsync(project, team).SyncResult();
     }
 }
Exemplo n.º 4
0
        public void DeleteTeam()
        {
            string teamName = "My new team";

            VssConnection  connection     = new VssConnection(_uri, _credentials);
            TeamHttpClient teamHttpClient = connection.GetClient <TeamHttpClient>();

            teamHttpClient.DeleteTeamAsync(_configuration.Project, teamName).SyncResult();
        }
Exemplo n.º 5
0
        public void DeleteTeam()
        {
            string project = _configuration.Project;
            string team    = "My new team";

            // create team object
            using (TeamHttpClient teamHttpClient = new TeamHttpClient(_uri, _credentials))
            {
                teamHttpClient.DeleteTeamAsync(project, team).SyncResult();
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Remove an existing team
 /// </summary>
 /// <param name="TeamProjectName"></param>
 /// <param name="TeamName"></param>
 static void DeleteTeam(string TeamProjectName, string TeamName)
 {
     Console.WriteLine("Delete the team '{0}' in the team project '{1}'", TeamName, TeamProjectName);
     TeamClient.DeleteTeamAsync(TeamProjectName, TeamName).SyncResult();
     Console.WriteLine("Completed");
 }