/// <summary> /// Initializes a new instance of the <see cref="BuildTracker" /> class. /// </summary> /// <param name="connectionPool">The connection pool.</param> /// <param name="appSettingsFactory">The app settings factory.</param> /// <param name="logService">The log service.</param> public BuildTracker(IConnectionPool connectionPool, IAppSettingsFactory appSettingsFactory, ILogService logService) { Ensure.That(connectionPool).IsNotNull(); Ensure.That(appSettingsFactory).IsNotNull(); Ensure.That(logService).IsNotNull(); _appSettingsFactory = appSettingsFactory; _logService = logService; _connections = new Dictionary <Guid, IConnection>(); _subscription = connectionPool.Subscribe(this); }
public HttpResponseMessage GetAppSettings() { try { IAppSettingsFactory _factory = AppSettingsFactory.GetInstance(); IAppSettingsManager _manager = _factory.GetManager(); var _appSettings = _manager.GetAppSettings(); return(Request.CreateResponse(HttpStatusCode.OK, _appSettings)); } catch (Exception _ex) { var _message = string.Format("There was an error processing the request. {0}", _ex.Message); Log.Error("AppSettingsController.GetAppSettings", "There was an error processing the request. Exception: {0}", _ex); HttpResponseMessage _response = Request.CreateResponse(HttpStatusCode.InternalServerError, _message); throw new HttpResponseException(_response); } }
/// <summary> /// Configures language. /// </summary> /// <param name="appSettingsFactory">The app settings factory.</param> public static void Configure(IAppSettingsFactory appSettingsFactory) { Ensure.That(appSettingsFactory).IsNotNull(); Configure(appSettingsFactory.Create()); }
/// <summary> /// Initializes a new instance of the <see cref="EditSettingsViewModel" /> class. /// </summary> /// <param name="application">The application.</param> /// <param name="platformProvider">The platform provider.</param> /// <param name="appSettingsFactory">The app settings factory.</param> public EditSettingsViewModel(IApp application, IPlatformProvider platformProvider, IAppSettingsFactory appSettingsFactory) : base(platformProvider) { Ensure.That(application).IsNotNull(); Ensure.That(appSettingsFactory).IsNotNull(); _application = application; _validator = new EditSettingsViewModelValidator(); var appSettings = appSettingsFactory.Create(); _appSettings = appSettings; _interval = appSettings.Interval; _cultureName = appSettings.CultureName; DisplayName = Properties.Resources.EditSettings_View; }