public NBlinkService(IServiceProvider provider) { _appLifetime = provider.GetRequiredService <IApplicationLifetime>(); _logger = provider.GetRequiredService <ILoggerFactory>() .CreateLogger(this.GetType().Name); _settings = provider.GetRequiredService <IOptions <NBlinkSettings> >() .Value; _dispatcher = provider.GetRequiredService <IBlinkDispatcher>(); _browser = provider.GetRequiredService <IBrowser>(); Initialise(provider); }
public NBlinkHttpService(ILoggerFactory loggerFactory, IOptions <NBlinkSettings> settings) { if (!HttpListener.IsSupported) { throw new ApplicationException( "Windows XP SP2 or Server 2003 is required to use the HttpListener class."); } _logger = loggerFactory.CreateLogger(this.GetType().Name); _settings = settings.Value; _rootPath = GetRootPath(); if (!Directory.Exists(_rootPath)) { throw new ApplicationException($"{_rootPath} don't exist"); } _rootPrefix = GetHostAddress(); }
public BrowserBase(ILoggerFactory loggerFactory, IOptions <NBlinkSettings> settings, IBlinkDispatcher dispatcher) { _logger = loggerFactory.CreateLogger(this.GetType().Name); _settings = settings.Value; Dispatcher = dispatcher; }