|
10 | 10 | using Kamishibai; |
11 | 11 | using Microsoft.Extensions.Configuration; |
12 | 12 | using Microsoft.Extensions.DependencyInjection; |
| 13 | +using Microsoft.Extensions.Logging; |
13 | 14 | using Microsoft.Extensions.Options; |
14 | 15 | using Microsoft.Win32; |
15 | 16 | using PropertyTools.DataAnnotations; |
@@ -46,6 +47,7 @@ sealed partial class AllSettingsViewModel : ObservableObject, IDisposable |
46 | 47 | private readonly IAutoTargetStore autoTargetStore; |
47 | 48 | private readonly IEnumerable<ITargetSettingsValidator> validators; |
48 | 49 | private readonly IMainWindowModule mainWindowModule; |
| 50 | + private readonly ILogger<AllSettingsViewModel> logger; |
49 | 51 | private readonly IConfigurationRoot? rootConfig; |
50 | 52 | private readonly string target; |
51 | 53 | [ObservableProperty] |
@@ -109,6 +111,7 @@ public AllSettingsViewModel( |
109 | 111 | [Inject] IConfiguration config, |
110 | 112 | [Inject] IEnumerable<ITargetSettingsValidator> validators, |
111 | 113 | [Inject] IMainWindowModule mainWindowModule, |
| 114 | + [Inject] ILogger<AllSettingsViewModel> logger, |
112 | 115 | string target, |
113 | 116 | bool? applyMode = null) |
114 | 117 | { |
@@ -147,6 +150,7 @@ public AllSettingsViewModel( |
147 | 150 | this.autoTargetStore = autoTargetStore; |
148 | 151 | this.validators = validators; |
149 | 152 | this.mainWindowModule = mainWindowModule; |
| 153 | + this.logger = logger; |
150 | 154 | this.target = target; |
151 | 155 | this.rootConfig = config as IConfigurationRoot; |
152 | 156 | this.updateChecker.UpdateAvailable += UpdateChecker_UpdateAvailable; |
@@ -277,6 +281,7 @@ public async Task SaveAsync(object window) |
277 | 281 | { |
278 | 282 | return; |
279 | 283 | } |
| 284 | + this.logger.LogWarning("Settings are invalid, but user chose to save them anyway."); |
280 | 285 | } |
281 | 286 |
|
282 | 287 | // 値の保存 |
|
0 commit comments