Exemple #1
0
        internal SettingsService(IPluginSettingRepository pluginSettingRepository)
        {
            var pluginInfo = new PluginInfo {
                Guid = Guid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff"), Name = "Artemis Core"
            };

            _pluginSettings = new PluginSettings(pluginInfo, pluginSettingRepository);
        }
Exemple #2
0
        internal PluginSetting(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository, PluginSettingEntity pluginSettingEntity)
        {
            _pluginInfo = pluginInfo;
            _pluginSettingRepository = pluginSettingRepository;
            _pluginSettingEntity     = pluginSettingEntity;

            Name  = pluginSettingEntity.Name;
            Value = JsonConvert.DeserializeObject <T>(pluginSettingEntity.Value);
        }
Exemple #3
0
        internal PluginSetting(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository, PluginSettingEntity pluginSettingEntity)
        {
            _pluginInfo = pluginInfo;
            _pluginSettingRepository = pluginSettingRepository;
            _pluginSettingEntity     = pluginSettingEntity;

            Name = pluginSettingEntity.Name;
            try
            {
                Value = JsonConvert.DeserializeObject <T>(pluginSettingEntity.Value);
            }
            catch (JsonReaderException)
            {
                Value = default;
            }
        }
Exemple #4
0
 internal PluginSettings(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository)
 {
     _pluginInfo = pluginInfo;
     _pluginSettingRepository = pluginSettingRepository;
     _settingEntities         = pluginSettingRepository.GetByPluginGuid(_pluginInfo.Guid).ToDictionary(se => se.Name);
 }
Exemple #5
0
 internal PluginSettingsProvider(IPluginSettingRepository pluginSettingRepository)
 {
     _pluginSettingRepository = pluginSettingRepository;
 }
Exemple #6
0
 internal PluginSettings(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository)
 {
     _pluginInfo = pluginInfo;
     _pluginSettingRepository = pluginSettingRepository;
     _settingEntities         = new Dictionary <string, object>();
 }