-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColorFilter #66
base: main
Are you sure you want to change the base?
ColorFilter #66
Conversation
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
tests/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.Tests.ps1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
$colorFilterSetting = (Get-ItemProperty @FilterStatusArgs).Active | ||
return ($colorFilterSetting -eq ([ColorFilter]::AccessibilityStatusValue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You get the property value for "Active" which is either 0 or 1, but you compare it with a string "colorfiltering".
$FilterColorArgs = @{ Path = $global:ColorFilteringRegistryPath; Name = ([ColorFilter]::FilterColorProperty)} | ||
if (-not(DoesRegistryKeyPropertyExist @FilterColorArgs)) | ||
{ | ||
return $false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you be returning the enum value of the default filter rather than $false?
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1
Outdated
Show resolved
Hide resolved
|
||
if ($null -ne $this.HotkeyEnabled) | ||
{ | ||
$KeyboardShortcutStatusArgs = @{ Path = $global:ColorFilteringRegistryPath; Name = ([ColorFilter]::HotkeyEnabledProperty); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that in this scenario, creating a variable that you use once make it less readable. It makes sense in the Get() method above because you are reusing to check the existence of the key. But here it makes it more confusing and adds 2 unnecessary lines.
Set-ItemProperty -Path $global:ColorFilteringRegistryPath -Name [ColorFilter]::HotkeyEnabledProperty -Value $ColorFilterValue
Please fix this and the other areas that do this.
This isn't complete, due to excessive PR approval volume, but the Get method is at least functional.