예제 #1
0
        public IEnumerable <Changeset> Get(string projectPath, DateTime from)
        {
            var projectCollection = _tfsServer.GetCollection();

            if (projectCollection.HasAuthenticated == false)
            {
                projectCollection.Authenticate();
            }

            // Get the Changeset list from the TFS API.
            var source = projectCollection.GetService <VersionControlServer>();

            var projectHistory = source.QueryHistory(projectPath, VersionSpec.Latest, 0, RecursionType.Full,
                                                     null, new DateVersionSpec(from.Date), null, int.MaxValue,
                                                     true, false, false, false)
                                 .OfType <Changeset>()
                                 .Reverse();

            return(projectHistory.ToList().AsEnumerable());
        }
예제 #2
0
        public IEnumerable <TeamFoundationIdentity> GetAllUsersInTfsBasedOnProjectCollection()
        {
            try
            {
                var            css4        = _tfsServer.GetCollection().GetService <ICommonStructureService4>();
                TfsTeamService teamService = _tfsServer.GetCollection().GetService <TfsTeamService>();

                return(from p in css4.ListProjects()
                       let allTeams = teamService.QueryTeams(p.Uri)
                                      from a in allTeams
                                      let ppls = a.GetMembers(_tfsServer.GetCollection(), MembershipQuery.Direct)
                                                 from ppl in ppls
                                                 select ppl);
            }
            catch (Exception)
            {
                return(EnumerableExtensions.Empty <TeamFoundationIdentity>());
            }
        }