public Team(string name, Guid id, IProject parent = null) : base(name, id)
 {
     if (parent != null)
     {
         TeamProject typedParent = parent as TeamProject;
         ConcreteParentProject = typedParent ?? new TeamProject(parent);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns enumerable of accessible teams associated
        /// with the given team project
        /// </summary>
        /// <param name="teamProjectId">AzureDevOps team project ID for which to retrieve teams</param>
        /// <returns>teams associated with the given team project, or null if disconnected</returns>
        internal IEnumerable <Models.Team> GetTeamsFromProject(Models.TeamProject project)
        {
            if (!ConnectedToAzureDevOps)
            {
                return(null);
            }

            TeamHttpClient teamClient          = _baseServerConnection.GetClient <TeamHttpClient>();
            var            teams               = new List <WebApiTeamRef>();
            var            newElementsReturned = 0;

            // Continue to populate teams list until the number of new returned elements
            //  is less than the number of elements we requested
            do
            {
                var newTeams = teamClient.GetTeamsAsync(project.Id.ToString("D", CultureInfo.InvariantCulture), AzureDevOps_PAGE_SIZE, teams.Count()).Result;
                newElementsReturned = newTeams.Count();
                teams.AddRange(newTeams);
            }while (newElementsReturned >= AzureDevOps_PAGE_SIZE);

            return(teams.Select(t => new Models.Team(t.Name, t.Id, project)));
        }
Exemplo n.º 3
0
 public TeamProjectViewModel(TeamProject project, IList <TeamProjectViewModel> children)
 {
     this.Project   = project;
     this._children = children ?? new List <TeamProjectViewModel>();
 }
        /// <summary>
        /// Copy ctor - enforces correct types internally
        /// </summary>
        /// <param name="original">The original object being copied</param>
#pragma warning disable CA1062 // Validate arguments of public methods
        public TeamProject(TeamProject original) : this(original.Name, original.Id)
        {
        }
Exemplo n.º 5
0
 public AdoTeam(string name, Guid id, TeamProject parent = null) : base(name, id)
 {
     ParentProject = parent;
 }