public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer, ITracer tracer, ITracerContextManager tracerContextManager) { IUnityContainer container = new UnityContainer(); var massProcessors = new IMassProcessor[] { new TaskServiceJobsMassProcessor(container), }; var storageSettings = settingsContainer.AsSettings <ISqlStoreSettingsAspect>(); container.RegisterContexts() .AttachQueryableContainerExtension() .UseParameterResolvers(ParameterResolvers.Defaults) .ConfigureMetadata() .ConfigureSettingsAspects(settingsContainer) .ConfigureTracing(tracer, tracerContextManager) .ConfigureSecurityAspects() .ConfigureQuartz() .ConfigureIdentityInfrastructure() .ConfigureWcf() .ConfigureOperationsProcessing() .ConfigureStorage(storageSettings, EntryPointSpecificLifetimeManagerFactory) .ConfigureReplication(EntryPointSpecificLifetimeManagerFactory); ReplicationRoot.Instance.PerformTypesMassProcessing(massProcessors, true, typeof(object)); return(container); }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer) { IUnityContainer container = new UnityContainer(); container.AttachQueryableContainerExtension() .UseParameterResolvers(new ParameterResolver[] { OperationServicesDependencyResolver } .Concat(AggregatesLayerParameterResolvers.Defaults) .Concat(ParameterResolvers.Defaults)); var massProcessors = new IMassProcessor[] { new AggregatesLayerMassProcessor(container, x => null), new EFDbModelMassProcessor(container) }; container .ConfigureSettingsAspects(settingsContainer) .ConfigureIndentityInfrastructure(EntryPointSpecificLifetimeManagerFactory) .ConfigureStorageLayer(EntryPointSpecificLifetimeManagerFactory) .ConfigureSecurityInfrastructure(); SampleAppRoot.Instance.PerformTypesMassProcessing(massProcessors, true, typeof(object)); SampleAppRoot.Instance.PerformTypesMassProcessing(massProcessors, false, typeof(object)); return container; }
public WithBackupSettingsFileExpoter( string targetFilePath, ISettingsContainer container, ISettingsSerializer serializer) : this(targetFilePath, targetFilePath + ".bak", container, serializer) { }
private ProxySettingsContainer( ISettingsContainer parent, string tag, string parentTagPrefix) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (tag == null) { throw new ArgumentNullException(nameof(tag)); } if (parentTagPrefix == null) { throw new ArgumentNullException(nameof(parentTagPrefix)); } ParentContainer = parent; Tag = tag.Replace("\\", "-"); ParentTagPrefix = parentTagPrefix; ParentContainer.SettingChanging += ParentContainer_SettingChanging; ParentContainer.SettingChanged += ParentContainer_SettingChanged; }
private static string SettingsToText(ISettingsContainer settings) { var lines = settings.KeyValuePairs.ToList().ConvertAll(pair => pair.Key + "=" + pair.Value.Value); lines.Sort(); return(string.Join("\n", lines)); }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer, ITracer tracer) { IUnityContainer container = new UnityContainer(); var massProcessors = new IMassProcessor[] { new TaskServiceJobsMassProcessor(container), }; var storageSettings = settingsContainer.AsSettings <ISqlStoreSettingsAspect>(); var connectionStringSettings = settingsContainer.AsSettings <IConnectionStringSettings>(); var environmentSettings = settingsContainer.AsSettings <IEnvironmentSettings>(); container.AttachQueryableContainerExtension() .UseParameterResolvers(ParameterResolvers.Defaults) .ConfigureMetadata() .ConfigureSettingsAspects(settingsContainer) .ConfigureTracing(tracer) .ConfigureSecurityAspects() .ConfigureQuartz() .ConfigureOperationsProcessing(connectionStringSettings, environmentSettings) .ConfigureStorage(storageSettings, EntryPointSpecificLifetimeManagerFactory) .ConfigureReplication(EntryPointSpecificLifetimeManagerFactory); ReplicationRoot.Instance.PerformTypesMassProcessing(massProcessors, true, typeof(object)); LinqToDB.Common.Configuration.Linq.OptimizeJoins = false; return(container); }
public WithBackupSettingsFileExpoter( string targetFilePath, string tempFilePath, ISettingsContainer container, ISettingsSerializer serializer) { if (targetFilePath == null) { throw new ArgumentNullException(nameof(targetFilePath)); } if (tempFilePath == null) { throw new ArgumentNullException(nameof(tempFilePath)); } if (container == null) { throw new ArgumentNullException(nameof(container)); } if (serializer == null) { throw new ArgumentNullException(nameof(serializer)); } TargetFilePath = targetFilePath; TempFilePath = tempFilePath; Container = container; Serializer = serializer; }
public void Serialize(Stream stream, ISettingsContainer container) { var serializationInfoArray = container.Settings .Select(SerializeKeyValuePair) .ToArray(); var serializer = new DataContractSerializer(typeof(KeyValueSerializationInfo[])); serializer.WriteObject(stream, serializationInfoArray); }
public LibraryContainer(IAuthorContainer authors, IBookContainer books, ICategoryContainer categories, IUserContainer users, IBorrowedContainer borrowed, ISettingsContainer settings) { this.authors = authors; this.books = books; this.categories = categories; this.users = users; this.borrowed = borrowed; this.settings = settings; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="settingsContainer">設定インスタンス</param> /// <param name="dispatcher">ディスパッチャ</param> protected SettingsBase( ISettingsContainer settingsContainer, IDispatcher dispatcher = null) : base(dispatcher) { this.SettingsContainer = settingsContainer ?? throw new ArgumentNullException(nameof(settingsContainer)); this.SettingsContainer.SettingChanging += this.SettingsContainer_SettingChanging; this.SettingsContainer.SettingChanged += this.SettingsContainer_SettingChanged; }
private void LoadControllerSettings() { Settings = new SettingsContainer(StoragePath.WithFilename("Settings.json")); Settings.SetValue("Name", "HA4IoT Controller"); Settings.SetValue("Description", "The HA4IoT controller which is responsible for this house."); Settings.Load(); }
public SettingsViewModel(ISettingsContainer settingsContainer) { this.Latitude = "undefined"; this.Longitude = "undefined"; this._settingsContainer = settingsContainer; this._settingsContainer.LocationChanged += this.OnLocationChanged; this.Title = "Settings"; }
public AreaSettingsWrapper(ISettingsContainer settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } Settings = settings; Settings.SetValue("appSettings", new JsonObject()); }
public EventsViewModel(INavigator navigator, IEventService service, IDataService localDataService, ISettingsContainer settingsContainer) { this._navigator = navigator; this._service = service; this._localDataService = localDataService; this._settingsContainer = settingsContainer; this.LocalEvents = this._localDataService.GetItems <Event>(); this.Title = "Events"; this._hasEvents = true; this._settingsContainer.LocationChanged += this._settingsContainer_LocationChanged; }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer) { var container = new UnityContainer() .ConfigureSettingsAspects(settingsContainer) .ConfigureMetadata() .ConfigureStoreModel() .ConfigureWebApiOData() .ConfigureTracer(settingsContainer.AsSettings <IEnvironmentSettings>(), settingsContainer.AsSettings <IConnectionStringSettings>()) .ConfigureWebApiTracer(); return(container); }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer) { var container = new UnityContainer() .ConfigureTracer(settingsContainer.AsSettings <IEnvironmentSettings>(), settingsContainer.AsSettings <IConnectionStringSettings>()) .ConfigureSettingsAspects(settingsContainer) .ConfigureMetadata() .ConfigureEdmModels() .ConfigureStorage(EntryPointSpecificLifetimeManagerFactory) .ConfigureWebApiOData(); return(container); }
public ComponentSettingsWrapper(ISettingsContainer settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } Settings = settings; IsEnabled = true; Settings.SetValue("appSettings", new JsonObject()); }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer) { var container = new UnityContainer() .ConfigureTracer(settingsContainer.AsSettings<IEnvironmentSettings>(), settingsContainer.AsSettings<IConnectionStringSettings>()) .ConfigureSettingsAspects(settingsContainer) .ConfigureMetadata() .ConfigureEdmModels() .ConfigureStorage(EntryPointSpecificLifetimeManagerFactory) .ConfigureWebApiOData(); return container; }
/// <summary> /// Constructor /// </summary> /// <param name="container">Instance of ISettingsContainer</param> /// <param name="dispatcher">Dispatcher to associate</param> protected SettingsBase( ISettingsContainer container, IDispatcher dispatcher = null) : base(dispatcher) { if (container == null) { throw new ArgumentNullException("settings"); } Container = container; Container.SettingChanged += Container_SettingChanged; }
public RollerShutterAutomationSettingsWrapper(ISettingsContainer settings) : base(settings) { SkipBeforeTimestampIsEnabled = false; SkipBeforeTimestamp = TimeSpan.Parse("07:15"); AutoCloseIfTooHotIsEnabled = false; AutoCloseIfTooHotTemperaure = 25; SkipIfFrozenIsEnabled = false; SkipIfFrozenTemperature = 2; OpenOnSunriseOffset = TimeSpan.FromMinutes(-30); CloseOnSunsetOffset = TimeSpan.FromMinutes(30); }
private static bool TryStoreSettings(ISettingsContainer settings, string file) { lock (settingsFileLock) { try { File.WriteAllText(file, SettingsToText(settings), Encoding.UTF8); return(true); } catch (Exception) { return(false); } } }
private static void TextToSettings(string text, ISettingsContainer settings) { using (StringReader reader = new StringReader(text)) { string line; while ((line = reader.ReadLine()) != null) { var pair = line.Split(new char[] { '=' }, 2); if (pair.Length == 2) { settings.SetValue(pair[0], pair[1]); } } } }
public void Deserialize(Stream stream, ISettingsContainer container) { var serializer = new DataContractSerializer(typeof(KeyValueSerializationInfo[])); var serializationInfoArray = (KeyValueSerializationInfo[])serializer.ReadObject(stream); container.Clear(); if (serializationInfoArray != null) { var settings = serializationInfoArray.Select(DeserializeKeyValuePair); foreach (var setting in settings) { container.Set(setting.Key, setting.Value); } } }
public SettingsContainerApiDispatcher(ISettingsContainer settingsContainer, string relativeUri, IApiController apiController) { if (settingsContainer == null) { throw new ArgumentNullException(nameof(settingsContainer)); } if (relativeUri == null) { throw new ArgumentNullException(nameof(relativeUri)); } if (apiController == null) { throw new ArgumentNullException(nameof(apiController)); } _settingsContainer = settingsContainer; _apiController = apiController; _relativeUri = relativeUri; }
public void Initialize() { authors = new AuthorContainer(new List <IAuthor>()); books = new BookContainer(new List <IBook>()); categories = new CategoryContainer(new List <string>()); users = new UserContainer(new List <IUser>()); borrowed = new BorrowedContainer(new List <IBookBorrowed>()); settings = new SettingsContainer(new Settings()); try { authors.UpdateSerializedData(); books.UpdateSerializedData(); categories.UpdateSerializedData(); users.UpdateSerializedData(); borrowed.UpdateSerializedData(); settings.UpdateSerializedData(); } catch { } }
/// <summary> /// Register a settings container /// </summary> /// <param name="settingsContainer">The settings container</param> private void Add(ISettingsContainer settingsContainer) { _containers.Add(settingsContainer); }
/// <summary> /// Sets the parent setting object, which is accessed when a setting is not found in the dictionary. /// </summary> /// <param name="parent"></param> public void SetParent(ISettingsContainer parent) { parentSettingsContainer = parent; }
public Settings(ISettingsContainer settings) : base(settings) { }
public RollerShutterSettingsWrapper(ISettingsContainer settings) : base(settings) { MaxPosition = 20000; AutoOffTimeout = TimeSpan.FromSeconds(22); }
public ProxySettingsContainer( ISettingsContainer parent, string tag) : this(parent, tag, parent.Tag) { }
public SendMailAction(ISettingsContainer settings) { _settings = settings; }
public ButtonSettingsWrapper(ISettingsContainer settings) : base(settings) { PressedLongDuration = TimeSpan.FromSeconds(1.5); }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer, ITracer tracer, ITracerContextManager tracerContextManager) { IUnityContainer container = new UnityContainer(); var massProcessors = new IMassProcessor[] { new TaskServiceJobsMassProcessor(container), }; var storageSettings = settingsContainer.AsSettings<ISqlStoreSettingsAspect>(); container.RegisterContexts() .AttachQueryableContainerExtension() .UseParameterResolvers(ParameterResolvers.Defaults) .ConfigureMetadata() .ConfigureSettingsAspects(settingsContainer) .ConfigureTracing(tracer, tracerContextManager) .ConfigureSecurityAspects() .ConfigureQuartz() .ConfigureIdentityInfrastructure() .ConfigureWcf() .ConfigureOperationsProcessing() .ConfigureStorage(storageSettings, EntryPointSpecificLifetimeManagerFactory) .ConfigureReplication(EntryPointSpecificLifetimeManagerFactory); ReplicationRoot.Instance.PerformTypesMassProcessing(massProcessors, true, typeof(object)); return container; }
public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer) { var container = new UnityContainer() .ConfigureSettingsAspects(settingsContainer) .ConfigureMetadata() .ConfigureStoreModel() .ConfigureWebApiOData() .ConfigureTracer(settingsContainer.AsSettings<IEnvironmentSettings>(), settingsContainer.AsSettings<IConnectionStringSettings>()) .ConfigureWebApiTracer(); return container; }
public TurnOnAndOffAutomationSettingsWrapper(ISettingsContainer settingsContainer) : base(settingsContainer) { Duration = TimeSpan.FromSeconds(60); }