protected override void Context() { AccountService = MockRepository.GenerateStub<IAccountService>(); Identity = new FakeIdentity(Username); _user = new FakePrincipal(Identity, null); HttpRequest = MockRepository.GenerateStub<HttpRequestBase>(); HttpContext = MockRepository.GenerateStub<HttpContextBase>(); HttpContext.Stub(x => x.Request).Return(HttpRequest); HttpContext.User = _user; _httpResponse = MockRepository.GenerateStub<HttpResponseBase>(); _httpResponse.Stub(x => x.Cookies).Return(new HttpCookieCollection()); HttpContext.Stub(x => x.Response).Return(_httpResponse); Logger = MockRepository.GenerateStub<ILogger>(); WebAuthenticationService = MockRepository.GenerateStub<IWebAuthenticationService>(); MappingEngine = MockRepository.GenerateStub<IMappingEngine>(); AccountCreator = MockRepository.GenerateStub<IAccountCreator>(); AccountController = new AccountController(AccountService, Logger, WebAuthenticationService, MappingEngine, null, AccountCreator); AccountController.ControllerContext = new ControllerContext(HttpContext, new RouteData(), AccountController); }
public MultiServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager userActionAssetManager, IFileTransferManager fileTransferManager) { _connectionManager = connectionManager; _logger = logger; _localAssetManager = userActionAssetManager; _fileTransferManager = fileTransferManager; }
public SendMessageRequestHandler(BrokerController brokerController) { _brokerController = brokerController; _messageService = ObjectContainer.Resolve<IMessageService>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
/// <summary> /// Initializes a new instance of the <see cref="RetryHandler" /> class. /// </summary> /// <param name="innerHandler">The inner handler. (Usually new HttpClientHandler())</param> /// <param name="maxRetries">The maximum retries.</param> /// <param name="retryDelayMilliseconds">The retry delay milliseconds.</param> /// <param name="logger">The optional logger to log error messages to.</param> /// <remarks> /// When only the auth0 token provider is injected, the auth0 token provider should try to extract the client id from the 401 response header. /// </remarks> public RetryHandler(HttpMessageHandler innerHandler, uint maxRetries = 1, uint retryDelayMilliseconds = 500, ILogger logger = null) : base(innerHandler) { this.maxRetries = maxRetries; this.retryDelayMilliseconds = retryDelayMilliseconds; this.logger = logger; }
public DefaultMessageManager( IMessageEventHandler messageEventHandler, IEnumerable<IMessagingChannel> channels) { _messageEventHandler = messageEventHandler; _channels = channels; Logger = NullLogger.Instance; }
public CollectionManager(ILibraryManager libraryManager, IFileSystem fileSystem, ILibraryMonitor iLibraryMonitor, ILogger logger) { _libraryManager = libraryManager; _fileSystem = fileSystem; _iLibraryMonitor = iLibraryMonitor; _logger = logger; }
public DoubanOAuthService(IEncryptionService oauthHelper, IQuickLogOnService quickLogOnService) { _quickLogOnService = quickLogOnService; _oauthHelper = oauthHelper; T = NullLocalizer.Instance; Logger = NullLogger.Instance; }
public WebSocketSharpListener(ILogger logger, Action<string> endpointListener, string certificatePath) { _logger = logger; _endpointListener = endpointListener; _certificatePath = certificatePath; }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public WebApplicationComponent(IWebAppEndpoint endpoint, Auto<ILogger> logger, IComponentContext componentContext) { _app = endpoint.Contract; _address = endpoint.Address; _logger = logger.Instance; _container = (ILifetimeScope)componentContext; }
public AccountController(IConfigurationRoot appSettings, UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, ILoggerFactory loggerFactory) { _appSettings = appSettings; _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger<AccountController>(); }
/// <summary> /// Creates a deployer instance based on settings in <see cref="DeploymentParameters"/>. /// </summary> /// <param name="deploymentParameters"></param> /// <param name="logger"></param> /// <returns></returns> public static IApplicationDeployer Create(DeploymentParameters deploymentParameters, ILogger logger) { if (deploymentParameters == null) { throw new ArgumentNullException(nameof(deploymentParameters)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (deploymentParameters.RuntimeFlavor == RuntimeFlavor.Mono) { return new MonoDeployer(deploymentParameters, logger); } switch (deploymentParameters.ServerType) { case ServerType.IISExpress: return new IISExpressDeployer(deploymentParameters, logger); #if NET451 case ServerType.IIS: return new IISDeployer(deploymentParameters, logger); #endif case ServerType.WebListener: case ServerType.Kestrel: return new SelfHostDeployer(deploymentParameters, logger); default: throw new NotSupportedException( string.Format("Found no deployers suitable for server type '{0}' with the current runtime.", deploymentParameters.ServerType) ); } }
public ConnectInfoForm() { XmlConfigurator.Configure(); var settings = new NinjectSettings() { LoadExtensions = false }; this.mKernel = new StandardKernel( settings, new Log4NetModule(), new ReportServerRepositoryModule()); //this.mKernel.Load<FuncModule>(); this.mLoggerFactory = this.mKernel.Get<ILoggerFactory>(); this.mFileSystem = this.mKernel.Get<IFileSystem>(); this.mLogger = this.mLoggerFactory.GetCurrentClassLogger(); InitializeComponent(); this.LoadSettings(); // Create the DebugForm and hide it if debug is False this.mDebugForm = new DebugForm(); this.mDebugForm.Show(); if (!this.mDebug) this.mDebugForm.Hide(); }
public MessageListViewModel( MessageRepository messageRepository, [NotNull] MessageWatcher messageWatcher, MimeMessageLoader mimeMessageLoader, IPublishEvent publishEvent, ILogger logger) { if (messageRepository == null) throw new ArgumentNullException(nameof(messageRepository)); if (messageWatcher == null) throw new ArgumentNullException(nameof(messageWatcher)); if (mimeMessageLoader == null) throw new ArgumentNullException(nameof(mimeMessageLoader)); if (publishEvent == null) throw new ArgumentNullException(nameof(publishEvent)); _messageRepository = messageRepository; _messageWatcher = messageWatcher; _mimeMessageLoader = mimeMessageLoader; _publishEvent = publishEvent; _logger = logger; SetupMessages(); RefreshMessageList(); }
public RootContext(ITheaterApplicationHost appHost, INavigator navigator, ISessionManager sessionManager, ILogManager logManager) : base(appHost) { _appHost = appHost; _navigator = navigator; _sessionManager = sessionManager; _logger = logManager.GetLogger("RootContext"); // create root navigation bindings Binder.Bind<LoginPath, LoginContext>(); Binder.Bind<HomePath, HomeContext>(); Binder.Bind<SideMenuPath, SideMenuContext>(); Binder.Bind<FullScreenPlaybackPath, FullScreenPlaybackContext>(); Binder.Bind<ItemListPath>(async path => { var context = appHost.CreateInstance(typeof (ItemListContext)) as ItemListContext; context.Parameters = path.Parameter; return context; }); Binder.Bind<ItemPath>(async path => { var context = appHost.CreateInstance(typeof (ItemDetailsContext)) as ItemDetailsContext; context.Item = path.Parameter; return context; }); }
public InstallWalker(IPackageRepository localRepository, IPackageRepository sourceRepository, IPackageConstraintProvider constraintProvider, FrameworkName targetFramework, ILogger logger, bool ignoreDependencies, bool allowPrereleaseVersions) : base(targetFramework) { if (sourceRepository == null) { throw new ArgumentNullException("sourceRepository"); } if (localRepository == null) { throw new ArgumentNullException("localRepository"); } if (logger == null) { throw new ArgumentNullException("logger"); } Repository = localRepository; Logger = logger; SourceRepository = sourceRepository; _ignoreDependencies = ignoreDependencies; ConstraintProvider = constraintProvider; _operations = new OperationLookup(); _allowPrereleaseVersions = allowPrereleaseVersions; }
public EncodingJobFactory(ILogger logger, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager, IConfigurationManager config) { _logger = logger; _libraryManager = libraryManager; _mediaSourceManager = mediaSourceManager; _config = config; }
public TelegramWorker(string botTokenKey) { _botTokenKey = botTokenKey; _telegramApi = new Api(_botTokenKey); _logger = FullLogger.Init(); _dialogManager = DialogManager.Init(); }
public SensorTelemetry(ILogger logger, IDevice device, AbstractSensor sensor) { this._logger = logger; this._deviceId = device.DeviceID; this._sensor = sensor; this.TelemetryActive = !string.IsNullOrWhiteSpace(device.HostName) && !string.IsNullOrWhiteSpace(device.PrimaryAuthKey); }
public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger) { _applicationHost = applicationHost; _httpClient = httpClient; _userManager = userManager; _logger = logger; }
public CommandActionsEntryPoint(ICommandManager commandManager, IPresentationManager presentationManager, IPlaybackManager playbackManager, INavigationService navigationService, IScreensaverManager screensaverManager, ILogManager logManager) { _commandManager = commandManager; _defaultCommandActionMap = new DefaultCommandActionMap(presentationManager, playbackManager, navigationService, screensaverManager, logManager); _logger = logManager.GetLogger(GetType().Name); }
/// <summary> /// Initializes a new instance of the <see cref="ProgressiveStreamWriter" /> class. /// </summary> /// <param name="path">The path.</param> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> public ProgressiveStreamWriter(string path, ILogger logger, IFileSystem fileSystem, TranscodingJob job) { Path = path; Logger = logger; _fileSystem = fileSystem; _job = job; }
public SqsQueueDynamoDbCircuitBreaker(IAmazonSQS queueClient, string queueName, int breakerTripQueueSize, ILogger structuredLogger) { this.structuredLogger = structuredLogger; this.breakerTripQueueSize = breakerTripQueueSize; this.queueClient = queueClient; this.queueName = queueName; }
public SerializationProcessor(string signKeyFile, List<string> references, List<AssemblyDefinition> memoryReferences, ILogger log) { SignKeyFile = signKeyFile; References = references; MemoryReferences = memoryReferences; Log = log; }
/// <summary> /// Logs the response. /// </summary> /// <param name="logger">The logger.</param> /// <param name="statusCode">The status code.</param> /// <param name="url">The URL.</param> /// <param name="endPoint">The end point.</param> /// <param name="duration">The duration.</param> public static void LogResponse(ILogger logger, int statusCode, string url, string endPoint, TimeSpan duration) { var durationMs = duration.TotalMilliseconds; var logSuffix = durationMs >= 1000 ? "ms (slow)" : "ms"; logger.Info("HTTP Response {0} to {1}. Time: {2}{3}. {4}", statusCode, endPoint, Convert.ToInt32(durationMs).ToString(CultureInfo.InvariantCulture), logSuffix, url); }
public ApplicationController(ITokenHandler tokenStore) { TokenStore = tokenStore; Logger = new NLogger(); //initialize this ViewBag.CurrentUser = CurrentUser ?? new { Email = "" }; }
/// <summary> /// Initializes a new instance of the <see cref="ImageSaver" /> class. /// </summary> /// <param name="config">The config.</param> /// <param name="libraryMonitor">The directory watchers.</param> /// <param name="fileSystem">The file system.</param> /// <param name="logger">The logger.</param> public ImageSaver(IServerConfigurationManager config, ILibraryMonitor libraryMonitor, IFileSystem fileSystem, ILogger logger) { _config = config; _libraryMonitor = libraryMonitor; _fileSystem = fileSystem; _logger = logger; }
public SessionHandler(ILogger<SessionHandler> logger, IEnvironment environment, IFileSystem fileSystem, IKeyValueStore keyValueStore, IMessageBus messageBus, ISession session, ITorrentInfoRepository torrentInfoRepository, ITorrentMetadataRepository metadataRepository) { if (logger == null) throw new ArgumentNullException("logger"); if (environment == null) throw new ArgumentNullException("environment"); if (fileSystem == null) throw new ArgumentNullException("fileSystem"); if (keyValueStore == null) throw new ArgumentNullException("keyValueStore"); if (messageBus == null) throw new ArgumentNullException("messageBus"); if (session == null) throw new ArgumentNullException("session"); if (torrentInfoRepository == null) throw new ArgumentNullException("torrentInfoRepository"); if (metadataRepository == null) throw new ArgumentNullException("metadataRepository"); _logger = logger; _environment = environment; _fileSystem = fileSystem; _keyValueStore = keyValueStore; _messageBus = messageBus; _session = session; _torrentInfoRepository = torrentInfoRepository; _metadataRepository = metadataRepository; _muted = new List<string>(); _alertsThread = new Thread(ReadAlerts); }
public PaymentPayPalStandardController(IWorkContext workContext, IStoreService storeService, ISettingService settingService, IPaymentService paymentService, IOrderService orderService, IOrderProcessingService orderProcessingService, ILocalizationService localizationService, IStoreContext storeContext, ILogger logger, IWebHelper webHelper, PaymentSettings paymentSettings, PayPalStandardPaymentSettings payPalStandardPaymentSettings) { this._workContext = workContext; this._storeService = storeService; this._settingService = settingService; this._paymentService = paymentService; this._orderService = orderService; this._orderProcessingService = orderProcessingService; this._localizationService = localizationService; this._storeContext = storeContext; this._logger = logger; this._webHelper = webHelper; this._paymentSettings = paymentSettings; this._payPalStandardPaymentSettings = payPalStandardPaymentSettings; }
public ApplyMaximumsTask(IRepository<AUMaxBidJobControlRecord> maxbidjobcontrolRepo, IRepository<AUMaxBidRecord> maxbidRepo, IRepository<AULotLastBidChangeRecord> lotlastbidchangeRepo, ILogger logger, IConsignorService consignorService, ICustomerService customerService, IQueuedEmailService queuedEmailService, IEmailAccountService emailAccountService, EmailAccountSettings emailAccountSettings, IAUCatalogService AUcatalogService, ILotService lotService) { //this._customerService = customerService; this._logger = logger; this._maxbidjobcontrolRepo = maxbidjobcontrolRepo; this._maxbidRepo = maxbidRepo; this._lotlastbidchangeRepo = lotlastbidchangeRepo; this._consignorService = consignorService; this._customerService = customerService; this._queuedEmailService = queuedEmailService; this._emailAccountService = emailAccountService; this._emailAccountSettings = emailAccountSettings; this._AUcatalogService = AUcatalogService; this._lotService = lotService; }
/// <summary> /// Initializes a new instance of the <see cref="RazorViewEngine" />. /// </summary> public RazorViewEngine( IRazorPageFactoryProvider pageFactory, IRazorPageActivator pageActivator, HtmlEncoder htmlEncoder, IOptions<RazorViewEngineOptions> optionsAccessor, ILoggerFactory loggerFactory) { _options = optionsAccessor.Value; if (_options.ViewLocationFormats.Count == 0) { throw new ArgumentException( Resources.FormatViewLocationFormatsIsRequired(nameof(RazorViewEngineOptions.ViewLocationFormats)), nameof(optionsAccessor)); } if (_options.AreaViewLocationFormats.Count == 0) { throw new ArgumentException( Resources.FormatViewLocationFormatsIsRequired(nameof(RazorViewEngineOptions.AreaViewLocationFormats)), nameof(optionsAccessor)); } _pageFactory = pageFactory; _pageActivator = pageActivator; _htmlEncoder = htmlEncoder; _logger = loggerFactory.CreateLogger<RazorViewEngine>(); ViewLookupCache = new MemoryCache(new MemoryCacheOptions { CompactOnMemoryPressure = false }); }
public ManagerController(DbRepository dbRepo, ILoggerFactory loggerFactory) { _dbRepo = dbRepo; _logger = loggerFactory.CreateLogger("ManagerLogger"); }
public LogRepository(ILogger<LogRepository> logger, IHttpContextAccessor httpContextAccessor, ISSOUser sSOUser) { _logger = logger; _httpContextAccessor = httpContextAccessor; _ssoUser = sSOUser; }
public PrivacyModel(ILogger<PrivacyModel> logger) { _logger = logger; }
public WeatherForecastController(ILogger<WeatherForecastController> logger) { _logger = logger; }
public GlobalExceptionFilter(ILogger <GlobalExceptionFilter> logger) { _logger = logger; }
public ErrorModel(ILogger <ErrorModel> logger) { _logger = logger; }
public IndexModel(ILogger <IndexModel> logger) { _logger = logger; }
private static void SafeSetEnvironmentVariable(string key, string value, EnvironmentVariableTarget target, ILogger logger) { try { Environment.SetEnvironmentVariable(key, value, target); } catch (System.Security.SecurityException) { logger.LogWarning("Test setup error: user running the test doesn't have the permissions to set the environment variable. Key: {0}, value: {1}, target: {2}", key, value, target); } }
public HomeController(ILogger <HomeController> logger) { _logger = logger; }
public DialogBot(ConversationState conversationState, UserState userState, T dialog, ILogger<DialogBot<T>> logger) { ConversationState = conversationState; UserState = userState; Dialog = dialog; Logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="GatewayProviderRepository"/> class. /// </summary> /// <param name="work"> /// The work. /// </param> /// <param name="cache"> /// The cache. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="sqlSyntax"> /// The SQL syntax. /// </param> public GatewayProviderRepository(IDatabaseUnitOfWork work, IRuntimeCacheProvider cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) : base(work, cache, logger, sqlSyntax) { }
public DefaultCalculator(ILoggerFactory loggerFactory) { _logger = loggerFactory.Create(typeof(DefaultCalculator).FullName); }
public Configuration(ILogger logger) { var settings = ConfigurationManager.ConnectionStrings["RabbitMQ"]; if (settings != null) { RabbitMqConnectionString = settings.ConnectionString; } RabbitMqClusterHosts = GetValue(nameof(RabbitMqClusterHosts)); if (String.IsNullOrWhiteSpace(RabbitMqClusterHosts)) { RabbitMqClusterHosts = null; } RabbitMqAutomaticRecoveryEnabled = true; if (Boolean.TryParse(GetValue(nameof(RabbitMqAutomaticRecoveryEnabled)), out var tmpBool)) { RabbitMqAutomaticRecoveryEnabled = tmpBool; } QueueExpiration = TimeSpan.FromSeconds(10); if (TimeSpan.TryParse(GetValue(nameof(QueueExpiration)), out var tmpTimeSpan)) { QueueExpiration = tmpTimeSpan; } RequestExpiration = TimeSpan.FromSeconds(10); if (TimeSpan.TryParse(GetValue(nameof(RequestExpiration)), out tmpTimeSpan)) { RequestExpiration = tmpTimeSpan; } OnPremiseConnectorCallbackTimeout = TimeSpan.FromSeconds(30); if (TimeSpan.TryParse(GetValue(nameof(OnPremiseConnectorCallbackTimeout)), out tmpTimeSpan)) { OnPremiseConnectorCallbackTimeout = tmpTimeSpan; } TraceFileDirectory = GetPathValue(nameof(TraceFileDirectory), logger) ?? "tracefiles"; LinkPasswordLength = 100; if (Int32.TryParse(GetValue(nameof(LinkPasswordLength)), out var tmpInt)) { LinkPasswordLength = tmpInt; } DisconnectTimeout = 6; if (Int32.TryParse(GetValue(nameof(DisconnectTimeout)), out tmpInt)) { DisconnectTimeout = tmpInt; } ConnectionTimeout = 5; if (Int32.TryParse(GetValue(nameof(ConnectionTimeout)), out tmpInt)) { ConnectionTimeout = tmpInt; } KeepAliveInterval = DisconnectTimeout / 3; if (Int32.TryParse(GetValue(nameof(KeepAliveInterval)), out tmpInt) && tmpInt >= KeepAliveInterval) { KeepAliveInterval = tmpInt; } UseInsecureHttp = false; if (Boolean.TryParse(GetValue(nameof(UseInsecureHttp)), out tmpBool)) { UseInsecureHttp = tmpBool; } EnableManagementWeb = ModuleBinding.True; if (Enum.TryParse(GetValue(nameof(EnableManagementWeb)), true, out ModuleBinding tmpModuleBinding)) { EnableManagementWeb = tmpModuleBinding; } EnableRelaying = ModuleBinding.True; if (Enum.TryParse(GetValue(nameof(EnableRelaying)), true, out tmpModuleBinding)) { EnableRelaying = tmpModuleBinding; } EnableOnPremiseConnections = ModuleBinding.True; if (Enum.TryParse(GetValue(nameof(EnableOnPremiseConnections)), true, out tmpModuleBinding)) { EnableOnPremiseConnections = tmpModuleBinding; } HostName = GetValue(nameof(HostName)) ?? "+"; Port = UseInsecureHttp ? 20000 : 443; if (Int32.TryParse(GetValue(nameof(Port)), out tmpInt)) { Port = tmpInt; } ManagementWebLocation = GetPathValue(nameof(ManagementWebLocation), logger); if (String.IsNullOrWhiteSpace(ManagementWebLocation)) { ManagementWebLocation = "ManagementWeb"; } TemporaryRequestStoragePath = GetPathValue(nameof(TemporaryRequestStoragePath), logger); if (String.IsNullOrWhiteSpace(TemporaryRequestStoragePath)) { TemporaryRequestStoragePath = null; } TemporaryRequestStoragePeriod = OnPremiseConnectorCallbackTimeout + OnPremiseConnectorCallbackTimeout; if (TimeSpan.TryParse(GetValue(nameof(TemporaryRequestStoragePeriod)), out tmpTimeSpan) && tmpTimeSpan >= TemporaryRequestStoragePeriod) { TemporaryRequestStoragePeriod = tmpTimeSpan; } ActiveConnectionTimeout = TimeSpan.FromMinutes(2); if (TimeSpan.TryParse(GetValue(nameof(ActiveConnectionTimeout)), out tmpTimeSpan)) { ActiveConnectionTimeout = tmpTimeSpan; } CustomCodeAssemblyPath = GetPathValue(nameof(CustomCodeAssemblyPath), logger); if (String.IsNullOrWhiteSpace(CustomCodeAssemblyPath)) { CustomCodeAssemblyPath = null; } else if (!File.Exists(CustomCodeAssemblyPath)) { logger?.Warning("A custom code assembly has been configured, but it is not available at the configured path. assembly-path={CustomCodeAssemblyPath}", CustomCodeAssemblyPath); CustomCodeAssemblyPath = null; } SharedSecret = GetValue(nameof(SharedSecret)); OAuthCertificate = GetValue(nameof(OAuthCertificate)); if (String.IsNullOrEmpty(SharedSecret) && String.IsNullOrEmpty(OAuthCertificate)) { if (String.IsNullOrEmpty(TemporaryRequestStoragePath)) // assume Multi-Server operation mode when this folder is configured { logger?.Warning("No SharedSecret or OAuthCertificate is configured. Please configure one of them. Continuing with a random value which will make all tokens invalid on restart."); SharedSecret = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); } else { var message = "No SharedSecret or OAuthCertificate is configured, and RelayServer is set up for Multi-Server operation. You need to configure either SharedSecret or OAuthCertificate before starting RelayServer."; logger?.Error(message); throw new ConfigurationErrorsException(message); } } HstsHeaderMaxAge = TimeSpan.FromDays(365); if (TimeSpan.TryParse(GetValue(nameof(HstsHeaderMaxAge)), out tmpTimeSpan)) { HstsHeaderMaxAge = tmpTimeSpan; } HstsIncludeSubdomains = false; if (Boolean.TryParse(GetValue(nameof(HstsIncludeSubdomains)), out tmpBool)) { HstsIncludeSubdomains = tmpBool; } IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Default; if (Enum.TryParse(GetValue(nameof(IncludeErrorDetailPolicy)), true, out IncludeErrorDetailPolicy tmpIncludeErrorDetailPolicy)) { IncludeErrorDetailPolicy = tmpIncludeErrorDetailPolicy; } MaxFailedLoginAttempts = 5; if (Int32.TryParse(GetValue(nameof(MaxFailedLoginAttempts)), out tmpInt)) { MaxFailedLoginAttempts = tmpInt; } FailedLoginLockoutPeriod = TimeSpan.FromMinutes(15); if (TimeSpan.TryParse(GetValue(nameof(FailedLoginLockoutPeriod)), out tmpTimeSpan)) { FailedLoginLockoutPeriod = tmpTimeSpan; } SecureClientController = false; if (Boolean.TryParse(GetValue(nameof(SecureClientController)), out tmpBool)) { SecureClientController = tmpBool; } AccessTokenLifetime = TimeSpan.FromDays(365); if (TimeSpan.TryParse(GetValue(nameof(AccessTokenLifetime)), out tmpTimeSpan)) { AccessTokenLifetime = tmpTimeSpan; } LogSensitiveData = true; if (Boolean.TryParse(GetValue(nameof(LogSensitiveData)), out tmpBool)) { LogSensitiveData = tmpBool; } LinkTokenRefreshWindow = TimeSpan.FromMinutes(1); if (TimeSpan.TryParse(GetValue(nameof(LinkTokenRefreshWindow)), out tmpTimeSpan) && tmpTimeSpan < AccessTokenLifetime) { LinkTokenRefreshWindow = tmpTimeSpan; } LinkReconnectMinWaitTime = TimeSpan.FromSeconds(2); if (TimeSpan.TryParse(GetValue(nameof(LinkReconnectMinWaitTime)), out tmpTimeSpan)) { LinkReconnectMinWaitTime = tmpTimeSpan; } LinkReconnectMaxWaitTime = TimeSpan.FromSeconds(30); if (TimeSpan.TryParse(GetValue(nameof(LinkReconnectMaxWaitTime)), out tmpTimeSpan) && tmpTimeSpan > LinkReconnectMinWaitTime) { LinkReconnectMaxWaitTime = tmpTimeSpan; } else if (LinkReconnectMaxWaitTime < LinkReconnectMinWaitTime) { // something is fishy in the config LinkReconnectMaxWaitTime = LinkReconnectMinWaitTime + TimeSpan.FromSeconds(30); } LinkAbsoluteConnectionLifetime = null; if (TimeSpan.TryParse(GetValue(nameof(LinkAbsoluteConnectionLifetime)), out tmpTimeSpan)) { LinkAbsoluteConnectionLifetime = tmpTimeSpan; } LinkSlidingConnectionLifetime = null; if (TimeSpan.TryParse(GetValue(nameof(LinkSlidingConnectionLifetime)), out tmpTimeSpan)) { LinkSlidingConnectionLifetime = tmpTimeSpan; } LogSettings(logger); }
public Repository(ILogger<Repository> logger, SettingsProvider settingsProvider, ILogger<StorageContext> storageContextLogger) { _logger = logger; _settingsProvider = settingsProvider; _storageContextLogger = storageContextLogger; }
public SnsOperations(ISqsOperations sqsOperations, ILogger logger) { _sqsOperations = sqsOperations; _logger = logger; }
public ScopedProcessingService(DatabaseContext context, ILogger<ScopedProcessingService> logger) { this.context = context; this.logger = logger; }
public static void WriteSummaryReport(AnalysisConfig config, ProjectInfoAnalysisResult result, ILogger logger) { if (config == null) { throw new ArgumentNullException("config"); } if (result == null) { throw new ArgumentNullException("result"); } if (logger == null) { throw new ArgumentNullException("logger"); } var builder = new ProjectInfoReportBuilder(config, result, logger); builder.Generate(); }
public LoginWithRecoveryCodeModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWithRecoveryCodeModel> logger) { _signInManager = signInManager; _logger = logger; }
/// <summary> /// HttpReaderBase /// </summary> /// <param name="indexUri">URI of the feed service index.</param> public HttpReaderBase(Uri indexUri, TimeSpan cacheTimeout, ILogger log) : this(indexUri, httpSource : null, cacheContext : null, cacheTimeout : cacheTimeout, log : log) { }
private ProjectInfoReportBuilder(AnalysisConfig config, ProjectInfoAnalysisResult result, ILogger logger) { this.config = config; analysisResult = result; this.logger = logger; sb = new StringBuilder(); }
public ObsController(ILogger<ObsController> logger, Settings settings, OBSWebsocket obs) { this.logger = logger; this.settings = settings; this.obs = obs; }
public ValidationCollectorFactory(ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; _logger = _loggerFactory.CreateLogger <ValidationCollectorFactory>(); }
public RoleController(RoleManager <ApplicationRole> roleManager, ILogger <RoleController> logger) { _roleManager = roleManager; _logger = logger; }
/// <summary> /// HttpReaderBase /// </summary> /// <param name="indexUri">URI of the feed service index.</param> /// <param name="httpSource">Custom HttpSource.</param> public HttpReaderBase(Uri indexUri, HttpSource httpSource, SourceCacheContext cacheContext, TimeSpan cacheTimeout, ILogger log) { _indexUri = indexUri ?? throw new ArgumentNullException(nameof(indexUri)); _log = log ?? NullLogger.Instance; _sourceCacheContext = cacheContext ?? new SourceCacheContext(); _httpSource = httpSource; // TODO: what should retry be? _cacheContext = HttpSourceCacheContext.Create(_sourceCacheContext, 5); if (_sourceCacheContext == null) { var sourceCacheContext = new SourceCacheContext() { MaxAge = DateTimeOffset.UtcNow.Subtract(cacheTimeout), }; _cacheContext = HttpSourceCacheContext.Create(sourceCacheContext, 5); } }
public LogoutModel(SignInManager <IdentityUser> signInManager, ILogger <LogoutModel> logger) { _signInManager = signInManager; _logger = logger; }
public HomeController(ILogger<HomeController> logger, AzureBlobHelper azureBlobHelper) { _logger = logger; this.azureBlobHelper = azureBlobHelper; }
/// <summary> /// FacilityLogisticsConfigurationController /// </summary> /// <param name="business"></param> /// <param name="accessor"></param> /// <param name="logger"></param> public FacilityLogisticsConfigurationController(IFacilityLogisticsConfiguration business, IExecutionContextAccessor accessor, ILogger<FacilityLogisticsConfigurationController> logger) { _accessor = accessor; _logger = logger; _business = business; }
public TripItAuthenticationHandler(HttpClient httpClient, ILogger logger) { _httpClient = httpClient; _logger = logger; }
/// <summary> /// Creates a new instance of a PropertyTypeService, and initializes it with the specified arguments. /// </summary> /// <param name="dbContext"></param> /// <param name="user"></param> /// <param name="service"></param> /// <param name="logger"></param> public PropertyTypeService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger<PropertyTypeService> logger) : base(dbContext, user, service, logger) { }
public PointsOfInterestController(ILogger <PointsOfInterestController> logger) { _logger = logger; //HttpContext.RequestServices.GetService() }