private static TfsTeamProjectCollection GetTeamProjectCollection(Server server) { var teamProjectCollection = TeamProjectCollectionFactory.GetTeamProjectCollection(server); teamProjectCollection.EnsureAuthenticated(); return teamProjectCollection; }
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); } }
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; }
private static IEventService GetEventService(Server server) { var teamProjectCollection = GetTeamProjectCollection(server); return teamProjectCollection.GetService<IEventService>(); }