public ConfigContainer(ICacheHandler cacheHandler, IConfigStorage storage, IModuleCollection moduleCollection, ILogger <ConfigContainer> logger) { _cacheHandler = cacheHandler; _storage = storage; _moduleCollection = moduleCollection; _logger = logger; }
public override void LoadFrom(IConfigStorage from) { object res = from.ReadVal <string>(Name); Value = res != null ? (string)res :_def; _saved = Value; }
/// <summary> /// Loads all currently registered values from a config storage. /// </summary> public void LoadFrom(IConfigStorage from) { foreach (ConfValue v in _values) { v.LoadFrom(from); } }
public void Inject(IContainer container) { _configStorage = container.Get <IConfigStorage>(); _eventManager = container.Get <IUnityEventManager>(); _prefabsPoolingService = container.Get <IPrefabsPoolingService>(); // container.Get<ICharacterManager>().HandleExplosion }
public void Inject(IContainer container) { _playerTargetingService = container.Get <IPlayerTargetingService>(); _playerMovementService = container.Get <IPlayerMovementService>(); _playerCollisionService = container.Get <IPlayerCollisionService>(); _gameStateManager = container.Get <IGameStateManager>(); _configStorage = container.Get <IConfigStorage>(); }
/// <summary> /// Saves all handled values to a config storage /// </summary> public void SaveTo(IConfigStorage to) { foreach (ConfValue v in _values) { v.SaveTo(to); } to.Save(); }
public void testSavingThroughEvents() { AssertEquals(paperCount.Value, 10); AssertEquals(lunchType.Value, LunchType.luBreakfast); IConfigStorage temp = cfg; paperCount.Value = 2; lunchType.Value = LunchType.luMeal; ConfValuesManager.GetInstance().SaveTo(temp); paperCount.Value = 3; lunchType.Value = LunchType.luDinner; ConfValuesManager.GetInstance().LoadFrom(temp); AssertEquals(paperCount.Value, 2); AssertEquals(lunchType.Value, LunchType.luMeal); AssertEquals(bearName.Value, "Teddy"); }
public PCLocalService(IConfigStorage configStorage, ILoggerFactory logfac, VirtualFileSystem fileSystem, string extraWebPath) { ExtraWebPath = extraWebPath; ConfigStorage = configStorage; FileSystem = fileSystem; loggerFactory = logfac; #pragma warning disable CA1062 // Validate arguments of public methods logger = loggerFactory.CreateLogger("PCLocalService"); #pragma warning restore CA1062 // Validate arguments of public methods KnownNodes = new Dictionary <string, NodeInfo>(); sharedPCs = new List <NodeShareInfo>(); httpclient = new HttpClient(); httpclient.Timeout = TimeSpan.FromSeconds(10); nodeDiscovery = new NodeDiscovery(logfac); nodeDiscovery.OnNodeAdded += NodeDiscovery_OnNodeAdded; nodeDiscovery.OnError += (o, e) => OnError?.Invoke(this, new ServiceErrorEventArgs(e)); fetchQueue = new List <FetchQueueItem>(); var cfg = LoadConfiguration(); ServerPort = cfg.Port; #pragma warning disable CA1305 // Specify IFormatProvider NodeId = cfg.Id.ToString("N"); #pragma warning restore CA1305 // Specify IFormatProvider LoadPCList(); foreach (var item in _PersonalClouds) { item.ResyncClientList(); } fetchCloudInfo = new ActionBlock <NodeInfo>(GetNodeClodeInfo, new ExecutionDataflowBlockOptions() { MaxDegreeOfParallelism = 3 }); InitWebServer(); }
public CustomConfig(ConfigMode mode, IConfigSource defaultSource, IConfigStorage storage) { _mode = mode; _default = defaultSource; _storage = storage; }
public void Inject(IContainer container) { _gameStateManager = container.Get <IGameStateManager>(); _configs = container.Get <IConfigStorage>(); }
public SafeConfigStorage(IConfigStorage origin) { _origin = origin; }
public void Inject(IContainer container) { _configStorage = container.Get <IConfigStorage>(); }
/// <summary> /// Implement this method to provide a way to save the value to a IConfigStorage /// </summary> /// <param name="to">The storage to write this value to </param> public abstract void SaveTo(IConfigStorage to);
public ConfigContainer(ICacheHandler cacheHandler, IConfigStorage storage) { _cacheHandler = cacheHandler; _storage = storage; }
public ValidatedConfigStorage(IConfigStorage origin) { _origin = origin; }
/// <summary> /// Sets a IConfigStorage instance to use to load values of newly created variables from. /// </summary> public void SetStorage(IConfigStorage a) { _savedStorage = a; }
public void TestInitialize() { _default = Substitute.For <IConfigSource>(); _storage = Substitute.For <IConfigStorage>(); }
public override void SaveTo(IConfigStorage to) { to.WriteVal(Name, val); _saved = val; }
/// <summary> /// Implement this method to provide a way to load the value of this class from a storage /// </summary> /// <param name="from">The storage to read this value from</param> public abstract void LoadFrom(IConfigStorage from);
public override void SaveTo(IConfigStorage to) { to.WriteVal(Name, Value); _saved = Value; }
public void Inject(IContainer container) { _configStorage = container.Get <IConfigStorage>(); _eventManager = container.Get <IUnityEventManager>(); _prefabsPoolingService = container.Get <IPrefabsPoolingService>(); }
public void TestInitialize() { _origin = Substitute.For <IConfigStorage>(); }
public MemoryStorage(IConfigStorage parent = null) { Parent = parent; }