public void SetConfiguration(ConfigurationBase newConfiguration) { if (timer != null) { timer.Change(Timeout.Infinite, Timeout.Infinite); } configuration = newConfiguration as TeamFoundationConfiguration; if (configuration == null) { throw new ApplicationException("Configuration can not be null."); } var credentialProvider = new PlainCredentialsProvider(configuration.Username, configuration.Password); var teamProjectCollection = new TfsTeamProjectCollection(new Uri(configuration.CollectionUri), credentialProvider); buildServer = teamProjectCollection.GetService<IBuildServer>(); if (timer == null) { timer = new Timer(Tick, null, 0, configuration.PollInterval); } else { timer.Change(0, configuration.PollInterval); } }
public TeamFoundationSettingsControl(TeamFoundationConfiguration configuration) { InitializeComponent(); this.configuration = configuration; }