public TeamCityMonitor(Config config, IBuildLight buildLight) { this.config = config; this.buildLight = buildLight; authPath = config.GuestAccess ? "guestAuth" : "httpAuth"; var httpClientHandler = new HttpClientHandler { Credentials = new NetworkCredential(config.Username, config.Password) }; httpClient = new HttpClient(httpClientHandler) { BaseAddress = new Uri(config.ServerUrl) }; }
private static IBuildLight GetBuildLightDriver(TeamFlashConfig config) { IBuildLight driver = null; if (string.IsNullOrEmpty(config.BuildLightDriver) || config.BuildLightDriver == "*") { driver = DefaultBuildLight; } else { var type = Type.GetType(config.BuildLightDriver); if (type == null) { return(DefaultBuildLight); } driver = type.Assembly.CreateInstance(config.BuildLightDriver, true) as IBuildLight; } if (driver == null) { driver = DefaultBuildLight; } return(driver); }