コード例 #1
0
        private static TfsTeamProjectCollection GetTeamProjectCollection(Server server)
        {
            var teamProjectCollection = TeamProjectCollectionFactory.GetTeamProjectCollection(server);

            teamProjectCollection.EnsureAuthenticated();

            return teamProjectCollection;
        }
コード例 #2
0
        private void RegisterServers(ContainerBuilder builder)
        {
            foreach (ServerElement serverElement in this.settings.Servers)
            {
                var server = new Server
                {
                    Name = serverElement.Name,
                    UserName = serverElement.UserName,
                    Password = serverElement.Password,
                    Uri = serverElement.Uri
                };

                builder.RegisterInstance(server);
            }
        }
コード例 #3
0
        public static TfsTeamProjectCollection GetTeamProjectCollection(Server server)
        {
            if (string.IsNullOrEmpty(server.UserName) || string.IsNullOrEmpty(server.Password))
            {
                return new TfsTeamProjectCollection(server.Uri);
            }

            var tfsCredentials = new TfsClientCredentials(new BasicAuthCredential(new NetworkCredential(server.UserName, server.Password)))
            {
                AllowInteractive = false
            };

            var teamProjectCollection = new TfsTeamProjectCollection(server.Uri, tfsCredentials);

            return teamProjectCollection;
        }
コード例 #4
0
        private static IEventService GetEventService(Server server)
        {
            var teamProjectCollection = GetTeamProjectCollection(server);

            return teamProjectCollection.GetService<IEventService>();
        }