/// <summary> /// Static method to create an instance of SettingsManager /// </summary> /// <param name="storage"></param> /// <param name="settingCollections"></param> /// <returns>An initialized SettingsManager object, with all latest values from storage</returns> public static SettingsManager CreateSettingsManager(ISettingsStorage storage, List <SettingsCollectionBase> settingCollections) { if (_storage == null) { // ToDo : If lock is needed here ? _storage = storage; } if (_settingsCollections == null) { // ToDo : If lock is needed here ? _settingsCollections = new List <SettingsCollectionBase>(); } var mgr = new SettingsManager(storage, settingCollections); // Perform the loading of settings from storage for existing if (storage.IsReady()) { mgr.GenerateCollectionsFromDTOs(storage.ReadAll()); } return(mgr); }