コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: NBlinkHttpService.cs プロジェクト: anixati/NBlink
        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();
        }
コード例 #3
0
ファイル: BrowserBase.cs プロジェクト: anixati/NBlink
 public BrowserBase(ILoggerFactory loggerFactory, IOptions <NBlinkSettings> settings, IBlinkDispatcher dispatcher)
 {
     _logger    = loggerFactory.CreateLogger(this.GetType().Name);
     _settings  = settings.Value;
     Dispatcher = dispatcher;
 }