예제 #1
0
        public async Task SetModuleState(string name, bool active)
        {
            if (!_data.Configuration.ModuleConfigurations.TryAdd(name, active))
            {
                _data.Configuration.ModuleConfigurations[name] = active;
            }

            Type target = GetModuleTypeByName(name);

            if (active)
            {
                await _commands.AddModuleAsync(target, _services);
            }
            else
            {
                await _commands.RemoveModuleAsync(target);
            }

            _data.SaveConfiguration();
        }
예제 #2
0
 public void Save()
 => _data.SaveConfiguration();