public FacadeRepository() { NameValueCollection settings = ConfigurationManager.AppSettings; ServiceSettings _settings = new ServiceSettings(); _settings.AppendSettings(settings); #region initialize webHttpClient for converting old mapping string proxyHost = _settings["ProxyHost"]; string proxyPort = _settings["ProxyPort"]; string facadeServiceUri = _settings["FacadeServiceUri"]; if (facadeServiceUri.EndsWith("/")) { facadeServiceUri = facadeServiceUri.Remove(facadeServiceUri.Length - 1); } if (!string.IsNullOrEmpty(proxyHost) && !string.IsNullOrEmpty(proxyPort)) { WebProxy webProxy = _settings.GetWebProxyCredentials().GetWebProxy() as WebProxy; _facadeServiceClient = new WebHttpClient(facadeServiceUri, null, webProxy); } else { _facadeServiceClient = new WebHttpClient(facadeServiceUri); } #endregion }
public FileRepository() { NameValueCollection settings = ConfigurationManager.AppSettings; _settings = new ServiceSettings(); _settings.AppendSettings(settings); _proxyHost = _settings["ProxyHost"]; _proxyPort = _settings["ProxyPort"]; _adapterServiceUri = _settings["AdapterServiceUri"]; if (_adapterServiceUri.EndsWith("/")) { _adapterServiceUri = _adapterServiceUri.Remove(_adapterServiceUri.Length - 1); } _dataServiceUri = _settings["DataServiceUri"]; if (_dataServiceUri.EndsWith("/")) { _dataServiceUri = _dataServiceUri.Remove(_dataServiceUri.Length - 1); } _hibernateServiceUri = _settings["HibernateServiceUri"]; if (_hibernateServiceUri.EndsWith("/")) { _hibernateServiceUri = _hibernateServiceUri.Remove(_hibernateServiceUri.Length - 1); } _referenceDataServiceUri = _settings["RefDataServiceUri"]; if (_referenceDataServiceUri.EndsWith("/")) { _referenceDataServiceUri = _referenceDataServiceUri.Remove(_referenceDataServiceUri.Length - 1); } }
public SpreadsheetController(ISpreadsheetRepository repository) { NameValueCollection settings = ConfigurationManager.AppSettings; _settings = new ServiceSettings(); _settings.AppendSettings(settings); _repository = repository; }
public FileController(FileRepository repository) : base() { NameValueCollection settings = ConfigurationManager.AppSettings; _settings = new ServiceSettings(); _settings.AppendSettings(settings); _repository = repository; _repository.AuthHeaders = _authHeaders; }
public NHibernateRepository() { NameValueCollection settings = ConfigurationManager.AppSettings; _settings = new ServiceSettings(); _settings.AppendSettings(settings); _proxyHost = _settings["ProxyHost"]; _proxyPort = _settings["ProxyPort"]; _adapterServiceUri = _settings["AdapterServiceUri"]; _dataServiceUri = _settings["DataServiceUri"]; _hibernateServiceUri = _settings["NHibernateServiceUri"]; _referenceDataServiceUri = _settings["ReferenceDataServiceUri"]; }
public AdapterRepository() { NameValueCollection settings = ConfigurationManager.AppSettings; _settings = new ServiceSettings(); _settings.AppendSettings(settings); _proxyHost = _settings["ProxyHost"]; _proxyPort = _settings["ProxyPort"]; _adapterServiceUri = _settings["AdapterServiceUri"]; if (_adapterServiceUri.EndsWith("/")) { _adapterServiceUri = _adapterServiceUri.Remove(_adapterServiceUri.Length - 1); } _dataServiceUri = _settings["DataServiceUri"]; if (_dataServiceUri.EndsWith("/")) { _dataServiceUri = _dataServiceUri.Remove(_dataServiceUri.Length - 1); } _hibernateServiceUri = _settings["HibernateServiceUri"]; if (_hibernateServiceUri.EndsWith("/")) { _hibernateServiceUri = _hibernateServiceUri.Remove(_hibernateServiceUri.Length - 1); } _referenceDataServiceUri = _settings["RefDataServiceUri"]; if (_referenceDataServiceUri.EndsWith("/")) { _referenceDataServiceUri = _referenceDataServiceUri.Remove(_referenceDataServiceUri.Length - 1); } if (!string.IsNullOrEmpty(_settings["BaseDirectoryPath"]) && _settings["BaseDirectoryPath"].Contains("Applications")) { _servicesBasePath = _settings["BaseDirectoryPath"].Replace("Applications", "Services"); } }
public Program() { //Adapter Service does all this... Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); file = new System.IO.StreamWriter(_fileName); NameValueCollection appSettings = System.Configuration.ConfigurationManager.AppSettings; ServiceSettings settings = new ServiceSettings(); settings.AppendSettings(appSettings); //This is how DataLayers should use settings... WebProxyCredentials webProxyCredentials = settings.GetWebProxyCredentials(); _widgetServiceClient = new WebHttpClient(settings["WidgetServiceUri"], webProxyCredentials.userName, webProxyCredentials.password, webProxyCredentials.domain, webProxyCredentials.proxyHost, webProxyCredentials.proxyPort); //In a DataLayer this is automatic and is not required _widgetServiceClient.AccessToken = settings["AccessToken"]; }
public RefDataRepository() { NameValueCollection settings = ConfigurationManager.AppSettings; ServiceSettings _settings = new ServiceSettings(); _settings.AppendSettings(settings); #region initialize webHttpClient for converting old mapping string proxyHost = _settings["ProxyHost"]; string proxyPort = _settings["ProxyPort"]; string referenceDataServiceUri = _settings["RefDataServiceUri"]; if (!String.IsNullOrEmpty(proxyHost) && !String.IsNullOrEmpty(proxyPort)) { WebProxy webProxy = _settings.GetWebProxyCredentials().GetWebProxy() as WebProxy; _referenceDataServiceClient = new WebHttpClient(referenceDataServiceUri, null, webProxy); } else { _referenceDataServiceClient = new WebHttpClient(referenceDataServiceUri); } #endregion }