public IV1Configuration LoadV1Configuration() { if (VersionOneSettings == null) { throw new InvalidOperationException("Connection is needed for configuration loading."); } var path = VersionOneSettings.Path; var integrated = VersionOneSettings.Integrated; var proxy = GetProxy(VersionOneSettings.ProxySettings); var apiConnector = new V1APIConnector(path + ConfigUrlSuffix, null, null, integrated, proxy); apiConnector.SetUpstreamUserAgent("VersionOne.Client.VisualStudio/9.0.0"); return new V1Configuration(apiConnector); }
public void Connect(VersionOneSettings settings) { var path = settings.Path; var username = settings.Username; var password = settings.Password; var integrated = settings.Integrated; var proxy = GetProxy(settings.ProxySettings); VersionOneSettings = settings; var metaConnector = new V1APIConnector(path + MetaUrlSuffix, username, password, integrated, proxy); metaConnector.SetUpstreamUserAgent("VersionOne.Client.VisualStudio/9.0.0"); MetaModel = new MetaModel(metaConnector); var localizerConnector = new V1APIConnector(path + LocalizerUrlSuffix, username, password, integrated, proxy); localizerConnector.SetUpstreamUserAgent("VersionOne.Client.VisualStudio/9.0.0"); Localizer = new Localizer(localizerConnector); var dataConnector = new V1APIConnector(path + DataUrlSuffix, username, password, integrated, proxy); dataConnector.SetUpstreamUserAgent("VersionOne.Client.VisualStudio/9.0.0"); Services = new Services(MetaModel, dataConnector); V1Configuration = LoadV1Configuration(); }