mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Code style - Use file scoped namespaces
Code style - Ran code cleanup
This commit is contained in:
1 parent
e68e16df4d
commit
f6090dc296
691 files changed
+37301
-38119
No files matched your search
@@ -1,47 +1,46 @@
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
namespace Artemis.Core.Services;
|
||||
|
||||
/// <inheritdoc />
|
||||
internal class SettingsService : ISettingsService
|
||||
{
|
||||
/// <inheritdoc />
|
||||
internal class SettingsService : ISettingsService
|
||||
private readonly PluginSettings _pluginSettings;
|
||||
|
||||
public SettingsService(IPluginRepository pluginRepository)
|
||||
{
|
||||
private readonly PluginSettings _pluginSettings;
|
||||
|
||||
public SettingsService(IPluginRepository pluginRepository)
|
||||
{
|
||||
_pluginSettings = new PluginSettings(Constants.CorePlugin, pluginRepository);
|
||||
}
|
||||
|
||||
public PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default)
|
||||
{
|
||||
return _pluginSettings.GetSetting(name, defaultValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SaveAllSettings()
|
||||
{
|
||||
_pluginSettings.SaveAllSettings();
|
||||
}
|
||||
_pluginSettings = new PluginSettings(Constants.CorePlugin, pluginRepository);
|
||||
}
|
||||
|
||||
public PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default)
|
||||
{
|
||||
return _pluginSettings.GetSetting(name, defaultValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SaveAllSettings()
|
||||
{
|
||||
_pluginSettings.SaveAllSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>A wrapper around plugin settings for miscellaneous use outside plugins</para>
|
||||
/// <para>Do not inject into a plugin, for plugins inject <see cref="PluginSettings" /> instead.</para>
|
||||
/// </summary>
|
||||
public interface ISettingsService : IProtectedArtemisService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the setting with the provided name. If the setting does not exist yet, it is created.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the setting, can be any serializable type</typeparam>
|
||||
/// <param name="name">The name of the setting</param>
|
||||
/// <param name="defaultValue">The default value to use if the setting does not exist yet</param>
|
||||
/// <returns></returns>
|
||||
PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default);
|
||||
|
||||
/// <summary>
|
||||
/// <para>A wrapper around plugin settings for miscellaneous use outside plugins</para>
|
||||
/// <para>Do not inject into a plugin, for plugins inject <see cref="PluginSettings" /> instead.</para>
|
||||
/// Saves all settings, obviously
|
||||
/// </summary>
|
||||
public interface ISettingsService : IProtectedArtemisService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the setting with the provided name. If the setting does not exist yet, it is created.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the setting, can be any serializable type</typeparam>
|
||||
/// <param name="name">The name of the setting</param>
|
||||
/// <param name="defaultValue">The default value to use if the setting does not exist yet</param>
|
||||
/// <returns></returns>
|
||||
PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default);
|
||||
|
||||
/// <summary>
|
||||
/// Saves all settings, obviously
|
||||
/// </summary>
|
||||
void SaveAllSettings();
|
||||
}
|
||||
void SaveAllSettings();
|
||||
}
|
||||
Reference in new issue
Block a user