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);
            }
        }
예제 #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();
        }
예제 #3
0
 public void DeleteTeam(string project, string team)
 {
     // create team object
     using (TeamHttpClient teamHttpClient = new TeamHttpClient(_uri, _credentials))
     {
         teamHttpClient.DeleteTeamAsync(project, team).SyncResult();
     }
 }
예제 #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();
        }
예제 #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();
            }
        }
예제 #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");
 }