mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-18 21:48:12 +08:00
ArgumentNullException.ThrowIfNull for CropAndLockViewModel
This commit is contained in:
parent
c05270aafd
commit
575e49f70c
@ -26,28 +26,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
public CropAndLockViewModel(ISettingsUtils settingsUtils, ISettingsRepository<GeneralSettings> settingsRepository, ISettingsRepository<CropAndLockSettings> moduleSettingsRepository, Func<string, int> ipcMSGCallBackFunc)
|
||||
{
|
||||
if (settingsUtils == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(settingsUtils));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(settingsUtils);
|
||||
|
||||
SettingsUtils = settingsUtils;
|
||||
|
||||
// To obtain the general settings configurations of PowerToys Settings.
|
||||
if (settingsRepository == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(settingsRepository));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(settingsRepository);
|
||||
|
||||
GeneralSettingsConfig = settingsRepository.SettingsConfig;
|
||||
|
||||
InitializeEnabledValue();
|
||||
|
||||
// To obtain the settings configurations of CropAndLock.
|
||||
if (moduleSettingsRepository == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(moduleSettingsRepository));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(moduleSettingsRepository);
|
||||
|
||||
Settings = moduleSettingsRepository.SettingsConfig;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user