diff --git a/AudioCuesheetEditor/Data/Options/ILocalStorageOptionsProvider.cs b/AudioCuesheetEditor/Data/Options/ILocalStorageOptionsProvider.cs
new file mode 100644
index 00000000..938d0b4c
--- /dev/null
+++ b/AudioCuesheetEditor/Data/Options/ILocalStorageOptionsProvider.cs
@@ -0,0 +1,28 @@
+//This file is part of AudioCuesheetEditor.
+
+//AudioCuesheetEditor is free software: you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation, either version 3 of the License, or
+//(at your option) any later version.
+
+//AudioCuesheetEditor is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+
+//You should have received a copy of the GNU General Public License
+//along with Foobar. If not, see
+//.
+using AudioCuesheetEditor.Model.Options;
+using System.Linq.Expressions;
+
+namespace AudioCuesheetEditor.Data.Options
+{
+ public interface ILocalStorageOptionsProvider
+ {
+ event EventHandler? OptionSaved;
+ Task GetOptions() where T : IOptions;
+ Task SaveOptions(IOptions options);
+ Task SaveOptionsValue(Expression> propertyExpression, object value) where T : class, IOptions, new();
+ }
+}
diff --git a/AudioCuesheetEditor/Data/Options/LocalStorageOptionsProvider.cs b/AudioCuesheetEditor/Data/Options/LocalStorageOptionsProvider.cs
index 62cd9f52..743a4cf1 100644
--- a/AudioCuesheetEditor/Data/Options/LocalStorageOptionsProvider.cs
+++ b/AudioCuesheetEditor/Data/Options/LocalStorageOptionsProvider.cs
@@ -22,7 +22,7 @@
namespace AudioCuesheetEditor.Data.Options
{
- public class LocalStorageOptionsProvider(IJSRuntime jsRuntime)
+ public class LocalStorageOptionsProvider(IJSRuntime jsRuntime): ILocalStorageOptionsProvider
{
public event EventHandler? OptionSaved;
diff --git a/AudioCuesheetEditor/Extensions/WebAssemblyHostExtension.cs b/AudioCuesheetEditor/Extensions/WebAssemblyHostExtension.cs
index 0c68e392..bdba0ae4 100644
--- a/AudioCuesheetEditor/Extensions/WebAssemblyHostExtension.cs
+++ b/AudioCuesheetEditor/Extensions/WebAssemblyHostExtension.cs
@@ -24,7 +24,7 @@ public static class WebAssemblyHostExtension
{
public async static Task SetDefaultCulture(this WebAssemblyHost host)
{
- var localStorageOptionsProvider = host.Services.GetRequiredService();
+ var localStorageOptionsProvider = host.Services.GetRequiredService();
var options = await localStorageOptionsProvider.GetOptions();
CultureInfo.DefaultThreadCurrentCulture = options.Culture;
diff --git a/AudioCuesheetEditor/Pages/Index.razor b/AudioCuesheetEditor/Pages/Index.razor
index 7eb0dbd9..d3e38b67 100644
--- a/AudioCuesheetEditor/Pages/Index.razor
+++ b/AudioCuesheetEditor/Pages/Index.razor
@@ -22,7 +22,7 @@ along with Foobar. If not, see
@inject IJSRuntime _jsRuntime
@inject ITextLocalizer _localizer
@inject NavigationManager _navigationManager
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject ILogger _logger
@inject HotKeys _hotKeys
@inject HttpClient _httpClient
diff --git a/AudioCuesheetEditor/Pages/RecordControl.razor b/AudioCuesheetEditor/Pages/RecordControl.razor
index 3fded530..c4260bea 100644
--- a/AudioCuesheetEditor/Pages/RecordControl.razor
+++ b/AudioCuesheetEditor/Pages/RecordControl.razor
@@ -20,7 +20,7 @@ along with Foobar. If not, see
@inject SessionStateContainer _sessionStateContainer
@inject ITextLocalizer _localizer
@inject ITextLocalizerService _localizationService
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject HotKeys _hotKeys
@if (_sessionStateContainer.Cuesheet.IsRecording == true)
diff --git a/AudioCuesheetEditor/Pages/ViewModeImport.razor b/AudioCuesheetEditor/Pages/ViewModeImport.razor
index d3fb4ca3..493f95b8 100644
--- a/AudioCuesheetEditor/Pages/ViewModeImport.razor
+++ b/AudioCuesheetEditor/Pages/ViewModeImport.razor
@@ -20,7 +20,7 @@ along with Foobar. If not, see
@inject ITextLocalizer _localizer
@inject SessionStateContainer _sessionStateContainer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject ITextLocalizerService _localizationService
@inject HotKeys _hotKeys
@inject IJSRuntime _jsRuntime
diff --git a/AudioCuesheetEditor/Program.cs b/AudioCuesheetEditor/Program.cs
index faff2bd2..ca84b218 100644
--- a/AudioCuesheetEditor/Program.cs
+++ b/AudioCuesheetEditor/Program.cs
@@ -49,7 +49,7 @@
builder.Services.AddBlazorDownloadFile();
-builder.Services.AddScoped();
+builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddScoped();
diff --git a/AudioCuesheetEditor/Services/IO/ImportManager.cs b/AudioCuesheetEditor/Services/IO/ImportManager.cs
index 4674a40d..93622efd 100644
--- a/AudioCuesheetEditor/Services/IO/ImportManager.cs
+++ b/AudioCuesheetEditor/Services/IO/ImportManager.cs
@@ -34,10 +34,10 @@ public enum ImportFileType
Textfile,
Audiofile
}
- public class ImportManager(SessionStateContainer sessionStateContainer, LocalStorageOptionsProvider localStorageOptionsProvider, TextImportService textImportService, CuesheetImportService cuesheetImportService)
+ public class ImportManager(SessionStateContainer sessionStateContainer, ILocalStorageOptionsProvider localStorageOptionsProvider, TextImportService textImportService, CuesheetImportService cuesheetImportService)
{
private readonly SessionStateContainer _sessionStateContainer = sessionStateContainer;
- private readonly LocalStorageOptionsProvider _localStorageOptionsProvider = localStorageOptionsProvider;
+ private readonly ILocalStorageOptionsProvider _localStorageOptionsProvider = localStorageOptionsProvider;
private readonly TextImportService _textImportService = textImportService;
private readonly CuesheetImportService _cuesheetImportService = cuesheetImportService;
diff --git a/AudioCuesheetEditor/Services/UI/ApplicationOptionsTimeSpanParser.cs b/AudioCuesheetEditor/Services/UI/ApplicationOptionsTimeSpanParser.cs
index 2cead9b1..f6b16cd9 100644
--- a/AudioCuesheetEditor/Services/UI/ApplicationOptionsTimeSpanParser.cs
+++ b/AudioCuesheetEditor/Services/UI/ApplicationOptionsTimeSpanParser.cs
@@ -23,12 +23,12 @@ namespace AudioCuesheetEditor.Services.UI
{
public class ApplicationOptionsTimeSpanParser
{
- private readonly LocalStorageOptionsProvider _localStorageOptionsProvider;
+ private readonly ILocalStorageOptionsProvider _localStorageOptionsProvider;
private ApplicationOptions? applicationOptions;
private bool disposedValue;
- public ApplicationOptionsTimeSpanParser(LocalStorageOptionsProvider localStorageOptionsProvider)
+ public ApplicationOptionsTimeSpanParser(ILocalStorageOptionsProvider localStorageOptionsProvider)
{
_localStorageOptionsProvider = localStorageOptionsProvider;
_localStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
diff --git a/AudioCuesheetEditor/Shared/CultureSelector.razor b/AudioCuesheetEditor/Shared/CultureSelector.razor
index d8bb3c73..7d6566d2 100644
--- a/AudioCuesheetEditor/Shared/CultureSelector.razor
+++ b/AudioCuesheetEditor/Shared/CultureSelector.razor
@@ -21,7 +21,7 @@ along with Foobar. If not, see
@inject ITextLocalizerService _localizationService
@inject ITextLocalizer _localizer
@inject ILogger _logger
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
diff --git a/AudioCuesheetEditor/Shared/EditImportOptions.razor b/AudioCuesheetEditor/Shared/EditImportOptions.razor
index 38cb98ee..961e45be 100644
--- a/AudioCuesheetEditor/Shared/EditImportOptions.razor
+++ b/AudioCuesheetEditor/Shared/EditImportOptions.razor
@@ -21,7 +21,7 @@ along with Foobar. If not, see
@inject ITextLocalizerService _localizationService
@inject ITextLocalizer _localizer
@inject ITextLocalizer _validationMessageLocalizer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
diff --git a/AudioCuesheetEditor/Shared/EditRecordOptions.razor b/AudioCuesheetEditor/Shared/EditRecordOptions.razor
index 4414f1f0..e96e7037 100644
--- a/AudioCuesheetEditor/Shared/EditRecordOptions.razor
+++ b/AudioCuesheetEditor/Shared/EditRecordOptions.razor
@@ -18,7 +18,7 @@ along with Foobar. If not, see
@implements IDisposable
@inject ITextLocalizer _localizer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject ITextLocalizerService _localizationService
@inject ITextLocalizer _validationMessageLocalizer
diff --git a/AudioCuesheetEditor/Shared/EditTrackModal.razor b/AudioCuesheetEditor/Shared/EditTrackModal.razor
index 3f42c390..1829e4ee 100644
--- a/AudioCuesheetEditor/Shared/EditTrackModal.razor
+++ b/AudioCuesheetEditor/Shared/EditTrackModal.razor
@@ -21,7 +21,7 @@ along with Foobar. If not, see
@inject ITextLocalizer _localizer
@inject MusicBrainzDataProvider _musicBrainzDataProvider
@inject SessionStateContainer _sessionStateContainer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject TraceChangeManager _traceChangeManager
@inject HotKeys _hotKeys
@inject ITextLocalizer _validationMessageLocalizer
diff --git a/AudioCuesheetEditor/Shared/MainLayout.razor b/AudioCuesheetEditor/Shared/MainLayout.razor
index b79f7e52..7fc6d42d 100644
--- a/AudioCuesheetEditor/Shared/MainLayout.razor
+++ b/AudioCuesheetEditor/Shared/MainLayout.razor
@@ -27,7 +27,7 @@ along with Foobar. If not, see
@inject ILogger _logger
@inject IJSRuntime _jsRuntime
@inject HotKeys _hotKeys
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject SessionStateContainer _sessionStateContainer
@inject IBlazorDownloadFileService _blazorDownloadFileService
@inject ITextLocalizer _validationMessageLocalizer
diff --git a/AudioCuesheetEditor/Shared/ModalExportdialog.razor b/AudioCuesheetEditor/Shared/ModalExportdialog.razor
index 0d7fe465..271cb00c 100644
--- a/AudioCuesheetEditor/Shared/ModalExportdialog.razor
+++ b/AudioCuesheetEditor/Shared/ModalExportdialog.razor
@@ -20,7 +20,7 @@ along with Foobar. If not, see
@inject ITextLocalizer _localizer
@inject ILogger _logger
@inject ITextLocalizer _validationMessageLocalizer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject SessionStateContainer _sessionStateContainer
@inject IBlazorDownloadFileService _blazorDownloadFileService
@inject HotKeys _hotKeys
diff --git a/AudioCuesheetEditor/Shared/OptionsDialog.razor b/AudioCuesheetEditor/Shared/OptionsDialog.razor
index 94820ff4..fa7ea1bc 100644
--- a/AudioCuesheetEditor/Shared/OptionsDialog.razor
+++ b/AudioCuesheetEditor/Shared/OptionsDialog.razor
@@ -18,7 +18,7 @@ along with Foobar. If not, see
@implements IDisposable
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject ITextLocalizer _localizer
@inject ILogger _logger
@inject IJSRuntime _jsRuntime
diff --git a/AudioCuesheetEditor/Shared/TracksTable.razor b/AudioCuesheetEditor/Shared/TracksTable.razor
index 342dde26..61947058 100644
--- a/AudioCuesheetEditor/Shared/TracksTable.razor
+++ b/AudioCuesheetEditor/Shared/TracksTable.razor
@@ -20,7 +20,7 @@ along with Foobar. If not, see
@inject ITextLocalizer _localizer
@inject SessionStateContainer _sessionStateContainer
-@inject LocalStorageOptionsProvider _localStorageOptionsProvider
+@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
@inject TraceChangeManager _traceChangeManager
@inject ILogger _logger
@inject ITextLocalizerService _localizationService