public FintoService( IContextManager contextManager, ITranslationEntity translationEntToVm, ITranslationViewModel translationVmToEntity, IPublishingStatusCache publishingStatusCache, AnnotationServiceProvider annotationProvider, IUserOrganizationChecker userOrganizationChecker) : base(translationEntToVm, translationVmToEntity, publishingStatusCache, userOrganizationChecker) { this.contextManager = contextManager; this.annotationProvider = annotationProvider; }
public HealthChecker(IOptions <ProxyServerSettings> proxySettings, IOptions <TestAccessUrlConfiguration> testAccessUrlConfiguration, MapServiceProvider mapServiceProvider, AnnotationServiceProvider annotationServiceProvider, IContextManager contextManager, ILogger <HealthChecker> logger) { initialized = true; this.proxySettings = proxySettings.Value; this.testAccessUrlConfiguration = testAccessUrlConfiguration.Value; this.mapServiceProvider = mapServiceProvider; this.annotationServiceProvider = annotationServiceProvider; this.contextManager = contextManager; this.logger = logger; if (!string.IsNullOrEmpty(this.proxySettings.Address) && !string.IsNullOrEmpty(this.proxySettings.Port)) { try { string address = this.proxySettings.Address.ToLower(); string httpPrefix = "http://"; string httpsPrefix = "https://"; if (address.StartsWith(httpPrefix)) { address = address.Remove(0, httpPrefix.Length); } else if (address.StartsWith(httpsPrefix)) { address = address.Remove(0, httpsPrefix.Length); } if (address.EndsWith("/")) { address = address.Remove(address.Length - 1, 1); } proxyPureAddress = address; int.TryParse(this.proxySettings.Port, out proxyPort); proxyFullUri = string.Format("{0}:{1}", this.proxySettings.Address, this.proxySettings.Port); var testProxy = new WebProxy(proxyFullUri); } catch (Exception e) { initialized = false; logger.LogError(e.Message); } } proxyConfigured = !string.IsNullOrEmpty(proxyPureAddress) && (proxyPort != 0); }