Files
PowerToys/src/settings-ui/Settings.UI/ViewModels/PowerPreviewViewModel.cs
Jeremy Sinclair b2b2856e52 🚧 [Dev][Build] .NET 8 Upgrade (#28655)
* Upgraded projects to target .NET 8

* Updated .NET runtime package targets to use latest .NET 8 build

* Updated PowerToys Interop to target .NET 8

* Switch to use ArgumentNullException.ThrowIfNull

* ArgumentNullException.ThrowIfNull for CropAndLockViewModel

* Switching to ObjectDisposedException.ThrowIf

* Upgrade System.ComponentModel.Composition to 8.0

* ArgumentNullException.ThrowIfNull in Helper

* Switch to StartsWith using StringComparison.Ordinal

* Disabled CA1859, CA1716, SYSLIB1096 analyzers

* Update RIDs to reflect breaking changes in .NET 8

* Updated Microsoft NuGet packages to RC1

* Updated Analyzer package to latest .NET 8 preview package

* CA1854: Use TryGetValue instead of ContainsKey

* [Build] Update TFM to .NET 8 for publish profiles

* [Analyzers] Remove CA1309, CA1860-CA1865, CA1869, CA2208 from warning.

* [Analyzers] Fix for C26495

* [Analyzers] Disable CS1615, CS9191

* [CI] Target .NET 8 in YAML

* [CI] Add .NET preview version flag temporarily.

* [FileLocksmith] Update TFM to .NET 8

* [CI] Switch to preview agent

* [CI] Update NOTICE.md

* [CI] Update Release to target .NET 8 and use Preview agent

* [Analyzers] Disable CA1854

* Fix typo

* Updated Microsoft.CodeAnalysis.NetAnalyzers to latest preview

Updated packages to rc2

* [Analyzers][CPP] Turn off warning for 5271

* [Analyzers][CPP] Turn off warning for 26493

* [KeyboardListener] Add mutex include to resolve error

* [PT Run][Folder] Use static SearchValues to resolve CA1870

* [PowerLauncher] Fix TryGetValue

* [MouseJumpSettings] Use ArgumentNullException.ThrowIfNull

* [Build] Disable parallel dotnet tool restore

* [Build] No cache of dotnet tool packages

* [Build] Temporarily move .NET 8 SDK task before XAML formatting

* [Build][Temp] Try using .NET 7 prior to XAML formatting and then switch to .NET 8 after

* [Build] Use .NET 6 for XAML Styler

* [CI] Updated NOTICE.md

* [FancyZones] Update TFM to .NET 8

* [EnvVar] Update TFM to .NET 8 and update RID

* [EnvVar] Use ArgumentNullException.ThrowIfNull

* [Dev] Updated packages to .NET 8 RTM version

* [Dev] Updated Microsoft.CodeAnalysis.NetAnalyzers to latest

* [CI] Updated NOTICE.md with latest package versions

* Fix new utility target fameworks and runtimeids

* Don't use preview images anymore

* [CI] Add script to update VCToolsVersion environment variable

* [CI] Add Step to Verify VCToolsVersion

* [CI] Use latest flag for vswhere to set proper VCToolsVersion

* Add VCToolsVersion checking to release.yml

* Remove net publishing from local/ PR CI builds

* Revert "Remove net publishing from local/ PR CI builds"

This reverts commit f469778996.

* Only publish necessary projects

* Add verbosity to release pipelines builds of PowerTOys

* Set VCToolsVersion for publish.cmd when called from installer

* [Installer] Moved project publish logic to MSBuild Task

* [CI] Revert using publish.cmd

* [CI] Set VCToolsVersion and unset ClearDevCommandPromptEnvVars property

* Installer publishes for x64 too

* Revert "Add verbosity to release pipelines builds of PowerTOys"

This reverts commit 654d4a7f78.

* [Dev] Update CodeAnalysis library to non-preview package

* Remove unneeded warning removal

* Fix Notice.md

* Rename VCToolsVersion file and task name

* Remove unneeded mutex header include

---------

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2023-11-22 12:46:59 -05:00

730 lines
25 KiB
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.CompilerServices;
using global::PowerToys.GPOWrapper;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
using Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
public class PowerPreviewViewModel : Observable
{
private const string ModuleName = PowerPreviewSettings.ModuleName;
private PowerPreviewSettings Settings { get; set; }
private Func<string, int> SendConfigMSG { get; }
private string _settingsConfigFileFolder = string.Empty;
private GeneralSettings GeneralSettingsConfig { get; set; }
public PowerPreviewViewModel(ISettingsRepository<PowerPreviewSettings> moduleSettingsRepository, ISettingsRepository<GeneralSettings> generalSettingsRepository, Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
{
// Update Settings file folder:
_settingsConfigFileFolder = configFileSubfolder;
// To obtain the general Settings configurations of PowerToys
ArgumentNullException.ThrowIfNull(generalSettingsRepository);
GeneralSettingsConfig = generalSettingsRepository.SettingsConfig;
// To obtain the PowerPreview settings if it exists.
// If the file does not exist, to create a new one and return the default settings configurations.
ArgumentNullException.ThrowIfNull(moduleSettingsRepository);
Settings = moduleSettingsRepository.SettingsConfig;
// set the callback functions value to handle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
_svgRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredSvgPreviewEnabledValue();
if (_svgRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _svgRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_svgRenderEnabledStateIsGPOConfigured = true;
_svgRenderIsEnabled = _svgRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_svgRenderIsEnabled = Settings.Properties.EnableSvgPreview;
}
_svgBackgroundColorMode = Settings.Properties.SvgBackgroundColorMode.Value;
_svgBackgroundSolidColor = Settings.Properties.SvgBackgroundSolidColor.Value;
_svgBackgroundCheckeredShade = Settings.Properties.SvgBackgroundCheckeredShade.Value;
_svgThumbnailEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredSvgThumbnailsEnabledValue();
if (_svgThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _svgThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_svgThumbnailEnabledStateIsGPOConfigured = true;
_svgThumbnailIsEnabled = _svgThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_svgThumbnailIsEnabled = Settings.Properties.EnableSvgThumbnail;
}
_mdRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredMarkdownPreviewEnabledValue();
if (_mdRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _mdRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_mdRenderEnabledStateIsGPOConfigured = true;
_mdRenderIsEnabled = _mdRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_mdRenderIsEnabled = Settings.Properties.EnableMdPreview;
}
_monacoRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredMonacoPreviewEnabledValue();
if (_monacoRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _monacoRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_monacoRenderEnabledStateIsGPOConfigured = true;
_monacoRenderIsEnabled = _monacoRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_monacoRenderIsEnabled = Settings.Properties.EnableMonacoPreview;
}
_monacoWrapText = Settings.Properties.EnableMonacoPreviewWordWrap;
_monacoPreviewTryFormat = Settings.Properties.MonacoPreviewTryFormat;
_monacoMaxFileSize = Settings.Properties.MonacoPreviewMaxFileSize.Value;
_pdfRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredPdfPreviewEnabledValue();
if (_pdfRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _pdfRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_pdfRenderEnabledStateIsGPOConfigured = true;
_pdfRenderIsEnabled = _pdfRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_pdfRenderIsEnabled = Settings.Properties.EnablePdfPreview;
}
_gcodeRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredGcodePreviewEnabledValue();
if (_gcodeRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _gcodeRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_gcodeRenderEnabledStateIsGPOConfigured = true;
_gcodeRenderIsEnabled = _gcodeRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_gcodeRenderIsEnabled = Settings.Properties.EnableGcodePreview;
}
_qoiRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredQoiPreviewEnabledValue();
if (_qoiRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _qoiRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_qoiRenderEnabledStateIsGPOConfigured = true;
_qoiRenderIsEnabled = _qoiRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_qoiRenderIsEnabled = Settings.Properties.EnableQoiPreview;
}
_pdfThumbnailEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredPdfThumbnailsEnabledValue();
if (_pdfThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _pdfThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_pdfThumbnailEnabledStateIsGPOConfigured = true;
_pdfThumbnailIsEnabled = _pdfThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_pdfThumbnailIsEnabled = Settings.Properties.EnablePdfThumbnail;
}
_gcodeThumbnailEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredGcodeThumbnailsEnabledValue();
if (_gcodeThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _gcodeThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_gcodeThumbnailEnabledStateIsGPOConfigured = true;
_gcodeThumbnailIsEnabled = _gcodeThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_gcodeThumbnailIsEnabled = Settings.Properties.EnableGcodeThumbnail;
}
_stlThumbnailEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredStlThumbnailsEnabledValue();
if (_stlThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _stlThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_stlThumbnailEnabledStateIsGPOConfigured = true;
_stlThumbnailIsEnabled = _stlThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_stlThumbnailIsEnabled = Settings.Properties.EnableStlThumbnail;
}
_stlThumbnailColor = Settings.Properties.StlThumbnailColor.Value;
_qoiThumbnailEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredQoiThumbnailsEnabledValue();
if (_qoiThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _qoiThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
{
// Get the enabled state from GPO.
_qoiThumbnailEnabledStateIsGPOConfigured = true;
_qoiThumbnailIsEnabled = _qoiThumbnailEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
}
else
{
_qoiThumbnailIsEnabled = Settings.Properties.EnableQoiThumbnail;
}
}
private GpoRuleConfigured _svgRenderEnabledGpoRuleConfiguration;
private bool _svgRenderEnabledStateIsGPOConfigured;
private bool _svgRenderIsEnabled;
private int _svgBackgroundColorMode;
private string _svgBackgroundSolidColor;
private int _svgBackgroundCheckeredShade;
private GpoRuleConfigured _mdRenderEnabledGpoRuleConfiguration;
private bool _mdRenderEnabledStateIsGPOConfigured;
private bool _mdRenderIsEnabled;
private GpoRuleConfigured _monacoRenderEnabledGpoRuleConfiguration;
private bool _monacoRenderEnabledStateIsGPOConfigured;
private bool _monacoRenderIsEnabled;
private bool _monacoWrapText;
private bool _monacoPreviewTryFormat;
private int _monacoMaxFileSize;
private GpoRuleConfigured _pdfRenderEnabledGpoRuleConfiguration;
private bool _pdfRenderEnabledStateIsGPOConfigured;
private bool _pdfRenderIsEnabled;
private GpoRuleConfigured _gcodeRenderEnabledGpoRuleConfiguration;
private bool _gcodeRenderEnabledStateIsGPOConfigured;
private bool _gcodeRenderIsEnabled;
private GpoRuleConfigured _qoiRenderEnabledGpoRuleConfiguration;
private bool _qoiRenderEnabledStateIsGPOConfigured;
private bool _qoiRenderIsEnabled;
private GpoRuleConfigured _svgThumbnailEnabledGpoRuleConfiguration;
private bool _svgThumbnailEnabledStateIsGPOConfigured;
private bool _svgThumbnailIsEnabled;
private GpoRuleConfigured _pdfThumbnailEnabledGpoRuleConfiguration;
private bool _pdfThumbnailEnabledStateIsGPOConfigured;
private bool _pdfThumbnailIsEnabled;
private GpoRuleConfigured _gcodeThumbnailEnabledGpoRuleConfiguration;
private bool _gcodeThumbnailEnabledStateIsGPOConfigured;
private bool _gcodeThumbnailIsEnabled;
private GpoRuleConfigured _stlThumbnailEnabledGpoRuleConfiguration;
private bool _stlThumbnailEnabledStateIsGPOConfigured;
private bool _stlThumbnailIsEnabled;
private string _stlThumbnailColor;
private GpoRuleConfigured _qoiThumbnailEnabledGpoRuleConfiguration;
private bool _qoiThumbnailEnabledStateIsGPOConfigured;
private bool _qoiThumbnailIsEnabled;
public bool SVGRenderIsEnabled
{
get
{
return _svgRenderIsEnabled;
}
set
{
if (_svgRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _svgRenderIsEnabled)
{
_svgRenderIsEnabled = value;
Settings.Properties.EnableSvgPreview = value;
RaisePropertyChanged();
}
}
}
public int SVGRenderBackgroundColorMode
{
get
{
return _svgBackgroundColorMode;
}
set
{
if (value != _svgBackgroundColorMode)
{
_svgBackgroundColorMode = value;
Settings.Properties.SvgBackgroundColorMode.Value = value;
RaisePropertyChanged();
RaisePropertyChanged(nameof(IsSvgBackgroundColorVisible));
RaisePropertyChanged(nameof(IsSvgCheckeredShadeVisible));
}
}
}
public bool IsSvgBackgroundColorVisible
{
get
{
return (SvgPreviewColorMode)SVGRenderBackgroundColorMode == SvgPreviewColorMode.SolidColor;
}
}
public string SVGRenderBackgroundSolidColor
{
get
{
return _svgBackgroundSolidColor;
}
set
{
if (value != _svgBackgroundSolidColor)
{
_svgBackgroundSolidColor = value;
Settings.Properties.SvgBackgroundSolidColor = value;
RaisePropertyChanged();
}
}
}
public bool IsSvgCheckeredShadeVisible
{
get
{
return (SvgPreviewColorMode)SVGRenderBackgroundColorMode == SvgPreviewColorMode.Checkered;
}
}
public int SVGRenderBackgroundCheckeredShade
{
get
{
return _svgBackgroundCheckeredShade;
}
set
{
if (value != _svgBackgroundCheckeredShade)
{
_svgBackgroundCheckeredShade = value;
Settings.Properties.SvgBackgroundCheckeredShade.Value = value;
RaisePropertyChanged();
}
}
}
public bool IsSVGRenderEnabledGpoConfigured
{
get => _svgRenderEnabledStateIsGPOConfigured;
}
public bool SVGThumbnailIsEnabled
{
get
{
return _svgThumbnailIsEnabled;
}
set
{
if (_svgThumbnailEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _svgThumbnailIsEnabled)
{
_svgThumbnailIsEnabled = value;
Settings.Properties.EnableSvgThumbnail = value;
RaisePropertyChanged();
}
}
}
public bool IsSVGThumbnailEnabledGpoConfigured
{
get => _svgThumbnailEnabledStateIsGPOConfigured;
}
public bool MDRenderIsEnabled
{
get
{
return _mdRenderIsEnabled;
}
set
{
if (_mdRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _mdRenderIsEnabled)
{
_mdRenderIsEnabled = value;
Settings.Properties.EnableMdPreview = value;
RaisePropertyChanged();
}
}
}
public bool IsMDRenderEnabledGpoConfigured
{
get => _mdRenderEnabledStateIsGPOConfigured;
}
public bool MonacoRenderIsEnabled
{
get
{
return _monacoRenderIsEnabled;
}
set
{
if (_monacoRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _monacoRenderIsEnabled)
{
_monacoRenderIsEnabled = value;
Settings.Properties.EnableMonacoPreview = value;
RaisePropertyChanged();
}
}
}
public bool IsMonacoRenderEnabledGpoConfigured
{
get => _monacoRenderEnabledStateIsGPOConfigured;
}
public bool MonacoWrapText
{
get
{
return _monacoWrapText;
}
set
{
if (_monacoWrapText != value)
{
_monacoWrapText = value;
Settings.Properties.EnableMonacoPreviewWordWrap = value;
RaisePropertyChanged();
}
}
}
public bool MonacoPreviewTryFormat
{
get
{
return _monacoPreviewTryFormat;
}
set
{
if (_monacoPreviewTryFormat != value)
{
_monacoPreviewTryFormat = value;
Settings.Properties.MonacoPreviewTryFormat = value;
RaisePropertyChanged();
}
}
}
public int MonacoPreviewMaxFileSize
{
get
{
return _monacoMaxFileSize;
}
set
{
if (_monacoMaxFileSize != value)
{
_monacoMaxFileSize = value;
Settings.Properties.MonacoPreviewMaxFileSize.Value = value;
RaisePropertyChanged();
}
}
}
public bool PDFRenderIsEnabled
{
get
{
return _pdfRenderIsEnabled;
}
set
{
if (_pdfRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _pdfRenderIsEnabled)
{
_pdfRenderIsEnabled = value;
Settings.Properties.EnablePdfPreview = value;
RaisePropertyChanged();
}
}
}
public bool IsPDFRenderEnabledGpoConfigured
{
get => _pdfRenderEnabledStateIsGPOConfigured;
}
public bool PDFThumbnailIsEnabled
{
get
{
return _pdfThumbnailIsEnabled;
}
set
{
if (_pdfThumbnailEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _pdfThumbnailIsEnabled)
{
_pdfThumbnailIsEnabled = value;
Settings.Properties.EnablePdfThumbnail = value;
RaisePropertyChanged();
}
}
}
public bool IsPDFThumbnailEnabledGpoConfigured
{
get => _pdfThumbnailEnabledStateIsGPOConfigured;
}
public bool GCODERenderIsEnabled
{
get
{
return _gcodeRenderIsEnabled;
}
set
{
if (_gcodeRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _gcodeRenderIsEnabled)
{
_gcodeRenderIsEnabled = value;
Settings.Properties.EnableGcodePreview = value;
RaisePropertyChanged();
}
}
}
public bool IsGCODERenderEnabledGpoConfigured
{
get => _gcodeRenderEnabledStateIsGPOConfigured;
}
public bool GCODEThumbnailIsEnabled
{
get
{
return _gcodeThumbnailIsEnabled;
}
set
{
if (_gcodeThumbnailEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _gcodeThumbnailIsEnabled)
{
_gcodeThumbnailIsEnabled = value;
Settings.Properties.EnableGcodeThumbnail = value;
RaisePropertyChanged();
}
}
}
public bool IsGCODEThumbnailEnabledGpoConfigured
{
get => _gcodeThumbnailEnabledStateIsGPOConfigured;
}
public bool STLThumbnailIsEnabled
{
get
{
return _stlThumbnailIsEnabled;
}
set
{
if (_stlThumbnailEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _stlThumbnailIsEnabled)
{
_stlThumbnailIsEnabled = value;
Settings.Properties.EnableStlThumbnail = value;
RaisePropertyChanged();
}
}
}
public bool IsSTLThumbnailEnabledGpoConfigured
{
get => _stlThumbnailEnabledStateIsGPOConfigured;
}
public string STLThumbnailColor
{
get
{
return _stlThumbnailColor;
}
set
{
if (value != _stlThumbnailColor)
{
_stlThumbnailColor = value;
Settings.Properties.StlThumbnailColor.Value = value;
RaisePropertyChanged();
}
}
}
public bool QOIRenderIsEnabled
{
get
{
return _qoiRenderIsEnabled;
}
set
{
if (_qoiRenderEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _qoiRenderIsEnabled)
{
_qoiRenderIsEnabled = value;
Settings.Properties.EnableQoiPreview = value;
RaisePropertyChanged();
}
}
}
public bool IsQOIRenderEnabledGpoConfigured
{
get => _qoiRenderEnabledStateIsGPOConfigured;
}
public bool QOIThumbnailIsEnabled
{
get
{
return _qoiThumbnailIsEnabled;
}
set
{
if (_qoiThumbnailEnabledStateIsGPOConfigured)
{
// If it's GPO configured, shouldn't be able to change this state.
return;
}
if (value != _qoiThumbnailIsEnabled)
{
_qoiThumbnailIsEnabled = value;
Settings.Properties.EnableQoiThumbnail = value;
RaisePropertyChanged();
}
}
}
public bool IsQOIThumbnailEnabledGpoConfigured
{
get => _qoiThumbnailEnabledStateIsGPOConfigured;
}
public string GetSettingsSubPath()
{
return _settingsConfigFileFolder + "\\" + ModuleName;
}
public bool IsElevated
{
get
{
return GeneralSettingsConfig.IsElevated;
}
}
private void RaisePropertyChanged([CallerMemberName] string propertyName = null)
{
// Notify UI of property change
OnPropertyChanged(propertyName);
if (SendConfigMSG != null)
{
SndPowerPreviewSettings snd = new SndPowerPreviewSettings(Settings);
SndModuleSettings<SndPowerPreviewSettings> ipcMessage = new SndModuleSettings<SndPowerPreviewSettings>(snd);
SendConfigMSG(ipcMessage.ToJsonString());
}
}
}
}