Compare commits

..

27 Commits

Author SHA1 Message Date
Samuel Chapleau
bf72adc942 wip 2022-12-08 22:12:32 -08:00
Jojo Zhou
60bf86825b [Peek] Add tooltip to File (#22640)
* Add tooltip to File

* Add placeholder text for no tooltip

* Address comments

* Use StringBuilder

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
2022-12-08 15:55:28 -08:00
sujessie
4ef3f23897 [Peek] Unsupported File Previewer - Setting Window Size (#22645)
* Adding setting for unsupported file window

* Fix
2022-12-08 15:44:42 -08:00
Robson
5bd9dd5935 [Peek] add extra logic to properly render PNG files with transparency (#22613)
* [Peek] added extra logic to render PNG files with proper transparency

* Moved logic to ThumbnailHelper
Cleanup

* Created a separated previewer for PNG to only load the preview image with thumbnail logic

* removed unused code

* Updated state loading change
2022-12-08 15:42:38 -08:00
Michael Salmon
5590eb9484 [Peek] New File Explorer tabs break Shell API to get selected files (#22641)
* fix FE tab bug

* remove unnecessary unsafe keyword
2022-12-08 15:39:14 -08:00
Jojo Zhou
6f06f76784 [Peek] Refine titlebar adaptive width (#22642)
* Adjust adaptive width of titlebar

* Remove visualstate setters for AppTitle_FileCount

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
2022-12-08 15:06:16 -08:00
Robson
5981d0e81e [Peek] add PDF viewing support (#22636)
* [Peek] add PDF viewing support

* Fixed issue which would redirect some HTML and PDF files to external browser

* Fixed refactored interface name
2022-12-08 13:41:02 -08:00
Michael Salmon
539a4e5678 [Peek] ImagePreviewer - Handle error states (#22637)
* add better preview state handling

* add error handling in imagepreviewer and better state handling

* fix error handling so exception is not bubbled up

* improve performance and hook up unsupported previewer on error

* remove commented code

* address pr comments
2022-12-08 11:25:29 -08:00
Daniel Chau
aea217ddca [Peek] Fix foregrounding (#22633)
* Fixing foregrounding

* Get window handle inside BringToForeground extension method

Co-authored-by: Daniel Chau <dancha@microsoft.com>
Co-authored-by: Samuel Chapleau <sachaple@microsoft.com>
2022-12-08 10:11:24 -08:00
sujessie
d001a4c0e0 [Peek] Unsupported File Previewer - Formatting string from resources (#22609)
* Moving to string resource usage

* Moving ReadableStringHelper to common project

* Fix comments
2022-12-08 09:49:00 -08:00
Samuel Chapleau
5712123598 Fix titlebar draggable region and interactive region (bump WinAppSdk to latest) 2022-12-07 22:57:45 -08:00
Samuel Chapleau
e504653323 Update titlebar filecount text 2022-12-07 20:47:35 -08:00
Esteban Margaron
b46b8d176f Make CurrentItemIndex setter private 2022-12-07 18:51:02 -08:00
Esteban Margaron
b98f233b75 Fix wrong thread exception 2022-12-07 18:45:11 -08:00
Samuel Chapleau
083ec27a45 Fix crash 2022-12-07 18:02:26 -08:00
Yawen Hou
bca780f886 [Peek] Add customized title bar (#22600)
* Add basic button UI

* Add function to get default app name and to open file in default app

* Correct error output

* Add filename to titlebar

* Remove titlebar text from Resw

* Add basic button UI

* Add function to get default app name and to open file in default app

* Add filename to titlebar

* Correct error output

* Remove titlebar text from Resw

* Add SetDragRectangles

* Correct logic, update function name

* Add localization

* Cleanup and adaptive width

* Add fileIndex/NumberOfFiles for multiple files activation

* Refine titlebar styles

* Update error message; Return HResult from native methods; Update variable initialisation and string null testing

* Titlebar height and adaptive width refinement

* Add fallback to launch app picker if fail to open default app

* Temp change to hide AppTitle_FileCount

* Update launch button to command; Add keyboard accelerator

* Update titlebar inactive background color

* Update tooltip to add keyboard accelerator

* Add comments to resw file

* Fix accidental deletion from previous merge

Co-authored-by: Jojo Zhou <yizzho@microsoft.com>
Co-authored-by: Yawen Hou <yawenhou@microsoft.com>
2022-12-07 16:56:01 -08:00
estebanm123
d4e618cdc9 [Peek] Add basic file querying and navigation (#22589)
* Refactor to facilitate file data initialization

* Extract file-related code to new FileManager class

* Add temp basic version

* Clean + add todo for cancellations

* Fix various nav-related issues

* Temp - start moving iteration-related code to bg thread

* Minor tweaks

* Add FEHelper todo

* Rename FileManager + various tweaks

* Add basic throttling

* Improve bg thread synchronization

* Clean

* Clean

* Rename based on feedback

* Rename FileQuery

* Rename properties

* Rename remaining fields

* Add todos for nav success/failures

Co-authored-by: Esteban Margaron <emargaron@microsoft.com>
2022-12-07 15:03:50 -08:00
Robson
e1cb01d188 [Peek] Add WebView2 integration (#22506)
* First commit with WIP logic to support WV2 in Peek module

* Minor code cleanup and try/catch block

* Added control to wrap WebView2 logic

* Cleanup

* Added logic to handle HTML previewing
Properly update FilePreview according to file type

* Code cleanup
Updated comments

* Updated comment

* Removed comment

* Code cleanup

* Improved opening of web browser preview to avoid "blank" or "seeing previous page" issue
Removed unused method
Added xaml fallback to guarantee default/starting state

* Removed folder

* Updated factory logic to match master

* address code review

* addressed PR review

* address PR review

* Address PR review

* address PR review

* Address PR review
2022-12-07 14:24:18 -08:00
sujessie
bddfe42d39 [Peek] Adding unsupported file previewer (#22598)
* Unsupported file previewer

* Fix file display info

* Fix property store calls

* Update TODO
2022-12-07 13:07:21 -08:00
Daniel Chau
30d346c93f [Peek] Enable PropertyStore for offline files (#22567)
* Enabling PropertyStore for offline files

Co-authored-by: Daniel Chau <dancha@microsoft.com>
2022-12-07 11:20:39 -05:00
Samuel Chapleau
899b5016b9 [Peek] Fix installer builds, project configs and update assets (#22540)
* Update installer

* Fix installer errors

* Fix peek vcxproj

* Add package signing

* Add peek to arm64

* Add back ARM64 toMeasureToolUI

* Add versions to project

* Update assets and icons

* Add correct icon
2022-12-06 18:14:57 -08:00
Samuel Chapleau
0d05089316 Add scale awareness to window centering (#22541) 2022-12-06 17:52:38 -08:00
jth-ms
6295ed86ca Juliata/filetypes (#22538)
* Using the same list of file extensions as Lightbox's AppxManifest, and ensuring we convert file extension to lowercase

* Add IsFileTypeSupported to IPreviewer

* respond to PR comments
2022-12-06 17:18:20 -08:00
Daniel Chau
73925885dd [Peek] Fetching image size through PropertyStore (#22530)
* Fetching metadata from PropertySTore

* Releasing objects to fix crash

* Creating new PropertyHelper

Co-authored-by: Daniel Chau <dancha@microsoft.com>
2022-12-06 15:28:48 -08:00
Michael Salmon
437d2dd5f7 [Peek] Plugin pattern to enable any file type previewing (#22475) 2022-12-06 11:24:21 -08:00
Samuel Chapleau
a4bd09a2c8 Bump Microsoft.Windows.SDK.BuildTools version 2022-12-05 16:00:31 -08:00
Samuel Chapleau
c2aae52bba Peek (#22498)
* Add peek dll project

* add spacebar preview and launch on hotkey press

* add todo

* add process handle to handle continuous press of hotkey

* add tool to stop all powertoys processes

* Add a blank Peek page and update nav menu

* Add some initial content to Peek page including a toggle

* refactor settings parsing

* rename spacebar peek to peek viewer

* rename script to stop powertoys processes

* remove tool

* Adding FileUtils for retrieving selected file in File Explorer

* Remove unnecessary SndPeekSettings

* Add shortcut setting

* Set the shortcut to ctrl+space

* Launching viewer with selected FE file

* Add PeekUI WinUI3 project with interop events

* Moving FileTypeUtils into PeekFileUtils project

* execute winui3 app on hotkey

* Fix paths with spaces

* remove winui3 project

* Resolve comment

* add wpf app with toggle visibility on hotkey

* fix visibility on startup

* remove window properties and add todos

* Fixed hidden extension and system file handling

* wip

* Add working WPF app with FileExplorer querying

* remove c++ projects

* Move native awaiter

* Working Image control with image files

* Resize and move window based on explorer monitor

* Image render, window positioning and sizing clean up

* add window management logic and selection logic

* add extension methods to add circular iterating capability to linkedlistnode

* Add OnArrowKeyPresshandler

* Added titlebar with file name and scaling with titlebar height

* fix flashing window on startup and process kept alive when powertoys exits

* remove wait for debugger loop in ui

* Add KeyIsDown method

* Fix KeyDown issue with Key handled and check for repeat

* Add thumbnail logic

* Add all folder items if only one item is selected

* File type helper

* Using hresult

* Add cancellation and rotation handling

* Use extension instead of path

* fIX CONFLICTS

* Fixing some file type checks

* Add new icon for Peek

* Update page with the new Peek icon

* Initialize IsEnabled and hook ActivationShortcut to dllmain

* add icon to taskbar and titlebar

* Add theme sensitive backgrounds

* rename event handlers

* add settings image

* Move window data into obserable object

* Refactor viewmodel, interop and helpers

* Clean up

* Add loading spinner

* Add todos

* Fix conflicts

* Move native code into its own folder

* Add peek to installer

* Fix building peek and peekui projects

* Replace UWP namespaces to WinAppSDK

* Working WASDK placeholder project

* Add exit when powertoys runner exit

* Working winui3 with image display

* Add WIC project with <TreatWarningAsErros> false for now

* Fit content to window

* Use Size from Windows.Foundation

* Change order

* Add some todos

* Refactored native/interop code and added helpers to imagepreviewer

* Rename projects

* Move some code

* Remove using

Co-authored-by: Michael Salmon <miksalmon@users.noreply.github.com>
Co-authored-by: Michael Salmon 🐟 <michaelpsalmon@outlook.com>
Co-authored-by: Alireza Ebadi Ghajari <alirezae@microsoft.com>
Co-authored-by: Jessie Su <Jessie.Su@microsoft.com>
Co-authored-by: sujessie <102062556+sujessie@users.noreply.github.com>
2022-12-05 09:16:06 -08:00
642 changed files with 15095 additions and 12908 deletions

View File

@@ -63,7 +63,6 @@ APPIDS
appium
Applets
Applicationcan
applicationconfiguration
applicationframehost
Applist
applog
@@ -76,7 +75,6 @@ appxpackage
APSTUDIO
AQS
Aqtobe
ARCHITEW
arcosh
ARemapped
argb
@@ -92,7 +90,6 @@ Artsakh
asdf
AShortcut
ASingle
Asn
ASSOCCHANGED
ASYNCWINDOWPLACEMENT
ASYNCWINDOWPOS
@@ -161,8 +158,8 @@ bpmf
bpp
bricelam
BRIGHTGREEN
Brotli
Browsable
brucelindbloom
bsd
bstr
bti
@@ -202,8 +199,9 @@ CHILDACTIVATE
CHILDWINDOW
Choibalsan
chrdavis
chromaticities
Chrzan
cht
CHT
Chukotka
Chuuk
CIELAB
@@ -222,10 +220,6 @@ CLIPCHILDREN
Clipperton
CLIPSIBLINGS
clrcall
clrcompression
clretwrc
clrgc
clrjit
Cls
CLSCTX
clsid
@@ -240,7 +234,6 @@ CMock
CMONITORS
cmpgt
cmyk
Cng
cnt
Cocklebiddy
coclass
@@ -261,11 +254,13 @@ comctl
COMDAT
comdef
comdlg
comhost
cominterop
commandline
COMMANDTITLE
commctrl
Comoros
companding
COMPOSITIONFULL
comsupp
comsuppw
@@ -286,7 +281,6 @@ CONTROLL
CONTROLPARENT
Controlz
copiedcolorrepresentation
coreclr
corewebview
cortana
cotaskmem
@@ -331,10 +325,12 @@ cwd
cxfksword
CXSMICON
CXVIRTUALSCREEN
cxxopts
cyberrex
CYSMICON
CYVIRTUALSCREEN
cziplib
cziplob
Dac
dacl
damienleroy
@@ -350,7 +346,6 @@ davidegiacometti
Dayof
Dbg
Dbghelp
dbgshim
DBLCLKS
DBLEPSILON
DCapture
@@ -359,7 +354,6 @@ DCOM
dcommon
dcomp
dcompi
DCompiler
DComposition
DCR
DDevice
@@ -394,7 +388,7 @@ DESKTOPABSOLUTEEDITING
DESKTOPABSOLUTEPARSING
desktopshorcutinstalled
desktopwindowxamlsource
deu
DEU
devblogs
devdocs
devenum
@@ -482,11 +476,12 @@ ENABLEDPOPUP
endpointvolume
endregion
ENTERSIZEMOVE
enu
ENU
enumerationoptions
EOAC
epicgames
epu
Eqn
ERASEBKGND
EREOF
EResize
@@ -495,7 +490,6 @@ ERRORLEVEL
ERRORTITLE
ESettings
esize
esn
esrp
Eswatini
etl
@@ -539,6 +533,7 @@ Faroe
FARPROC
fdw
feimage
ffaa
fff
fileapi
FILEEXPLORER
@@ -557,6 +552,7 @@ FILEVERSION
Filtergraph
Filterkeyboard
Filterx
finalizer
findfast
firefox
FIXEDFILEINFO
@@ -622,7 +618,6 @@ HACCEL
handlekeyboardhookevent
handlerroutine
hangeul
Hankaku
hanselman
Hanzi
Hardlines
@@ -647,7 +642,6 @@ hdc
hdrop
HEB
Heiko
Helpline
helptext
Heure
HGFE
@@ -684,8 +678,6 @@ HOMEPATH
homljgmgpmcbpjbnjpfijnhipfkiclkd
HOOKPROC
Hostbackdropbrush
hostfxr
hostpolicy
hotkeycontrol
hotkeys
hotlight
@@ -757,7 +749,6 @@ IMAGERESIZEREXT
imageresizerinput
imageresizersettings
imagingdevices
Imc
ime
imeutil
inetcpl
@@ -794,15 +785,17 @@ Intelli
interactable
Interlop
INTRESOURCE
Intrinsics
INVALIDARG
invalidoperatioexception
iobjectwithsitesetsite
iolewindowcontextsensitivehelp
ipc
ipcmanager
IPlugin
IPower
IPREVIEW
ipreview
ipreviewhandler
ipreviewhandlertranslateaccelerator
ipreviewhandlervisualssetfont
IProperty
IPublic
@@ -830,7 +823,7 @@ jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi
jjw
jobject
jpe
jpn
JPN
jpnime
JSONOf
Jsons
@@ -853,6 +846,7 @@ keyevent
KEYEVENTF
keynum
keyremaps
keystokes
Keytool
keyup
Khakassia
@@ -911,7 +905,6 @@ lmcons
LMEM
LMENU
lnk
LOADFROMFILE
LOADLIBRARYASDATAFILE
LOBYTE
LOCALAPPDATA
@@ -923,7 +916,6 @@ LOCATIONCHANGE
logconsole
logfile
LOGFONT
LOGFONTW
LOGMSG
logon
LOGPIXELSX
@@ -990,8 +982,6 @@ MAPPEDTOSAMEKEY
MAPTOSAMESHORTCUT
MAPVK
Markdig
markdownpreviewhandler
MARKDOWNPREVIEWHANDLERCPP
Markovic
Marquesas
martinchrzan
@@ -1024,7 +1014,6 @@ Metadatas
metafile
mfapi
mfc
mfcm
mfidl
mfobjects
mfplat
@@ -1084,10 +1073,8 @@ mru
msbuild
msc
msclr
mscordaccore
mscordbi
mscoree
mscorlib
mscorrc
msdata
msedge
MSGFLT
@@ -1100,7 +1087,6 @@ MSIXCA
MSLLHOOKSTRUCT
Mso
msp
msquic
msrc
msstore
mst
@@ -1150,14 +1136,13 @@ netcpl
netframework
netsetup
netsh
netstandard
Neue
newcolor
newdev
newitem
newpath
newrow
Newtonsoft
newtonsoft
niels
nielslaute
NIF
@@ -1327,7 +1312,6 @@ pinvoke
pipename
Pitcairn
PKBDLLHOOKSTRUCT
Pkcs
PKEY
plib
PLK
@@ -1428,7 +1412,6 @@ QUERYENDSESSION
queryfocus
QUERYOPEN
QUEUESYNC
Quic
Quickime
QUNS
qwertyuiopasdfghjklzxcvbnm
@@ -1546,7 +1529,7 @@ runtimeclass
runtimeconfig
runtimeobject
runtimes
rus
RUS
Rutkas
RValue
rvm
@@ -1590,6 +1573,7 @@ SETFOCUS
SETFOREGROUND
SETICON
setlocal
Setrect
SETREDRAW
SETTEXT
SETTINGCHANGE
@@ -1697,7 +1681,6 @@ srw
srwlock
sse
ssf
Ssl
STACKFRAME
stackoverflow
stackpanel
@@ -1815,7 +1798,6 @@ THH
THICKFRAME
THISCOMPONENT
THotkey
thumbcache
TILEDWINDOW
timedate
timediff
@@ -1890,7 +1872,7 @@ uniquifier
Uniquifies
unitconverter
unittests
Unk
unk
unknwn
UNLEN
Unmap
@@ -2025,6 +2007,7 @@ WINDOWPOSCHANGING
Windowsapp
WINDOWSBUILDNUMBER
Windowscodecs
windowsdesktop
windowssearch
windowssettings
WINDOWSTYLES
@@ -2087,7 +2070,6 @@ workspaces
wox
wparam
wpf
wpfgfx
wpftmp
wpr
wprp
@@ -2154,6 +2136,5 @@ zonable
zoneset
Zoneszonabletester
Zonev
zopfli
Zykova
zzz

View File

@@ -860,69 +860,6 @@
],
"taskName": "Author Response needed"
}
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
"subCapability": "IssueCommentResponder",
"version": "1.0",
"id": "mgZxIoqeF7GWUo7-t3773",
"config": {
"conditions": {
"operator": "and",
"operands": [
{
"name": "commentContains",
"parameters": {
"commentPattern": "\\/loc\\b",
"isRegex": true
}
},
{
"operator": "or",
"operands": [
{
"name": "activitySenderHasAssociation",
"parameters": {
"association": "OWNER"
}
},
{
"name": "activitySenderHasAssociation",
"parameters": {
"association": "MEMBER"
}
}
]
}
]
},
"eventType": "issue",
"eventNames": [
"issue_comment"
],
"actions": [
{
"name": "removeLabel",
"parameters": {
"label": "Needs-Triage"
}
},
{
"name": "addLabel",
"parameters": {
"label": "Loc-Sent To Team"
}
},
{
"name": "addReply",
"parameters": {
"comment": "Hi! Thanks for making us aware of the problem. We raised the issue with our internal localization team. This issue should be fixed hopefully in the next version of PowerToys."
}
}
],
"taskName": "Filed ADO item with Localization team"
}
}
],
"userGroups": []

View File

@@ -46,35 +46,26 @@
"modules\\FancyZones\\PowerToys.FancyZones.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.ManagedTelemetry.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.powerpreview.dll",
"modules\\FileExplorerPreview\\PowerToys.PreviewHandlerCommon.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.comhost.dll",
"modules\\Hosts\\PowerToys.HostsModuleInterface.dll",
"modules\\Hosts\\PowerToys.Hosts.dll",
@@ -85,6 +76,13 @@
"modules\\FileLocksmith\\PowerToys.FileLocksmithUI.exe",
"modules\\FileLocksmith\\PowerToys.FileLocksmithUI.dll",
"modules\\Peek\\Peek.Common.dll",
"modules\\Peek\\Peek.FilePreviewer.dll",
"modules\\Peek\\Powertoys.Peek.UI.dll",
"modules\\Peek\\Powertoys.Peek.UI.exe",
"modules\\Peek\\WIC.dll",
"modules\\Peek\\Powertoys.Peek.dll",
"modules\\ImageResizer\\PowerToys.ImageResizer.exe",
"modules\\ImageResizer\\PowerToys.ImageResizer.dll",
"modules\\ImageResizer\\PowerToys.ImageResizerExt.dll",
@@ -132,6 +130,8 @@
"modules\\MouseUtils\\PowerToys.MousePointerCrosshairs.dll",
"modules\\PowerAccent\\PowerAccent.Core.dll",
"modules\\PowerAccent\\PowerAccent.dll",
"modules\\PowerAccent\\PowerAccent.exe",
"modules\\PowerAccent\\PowerToys.PowerAccent.dll",
"modules\\PowerAccent\\PowerToys.PowerAccent.exe",
"modules\\PowerAccent\\PowerToys.PowerAccentModuleInterface.dll",
@@ -247,7 +247,6 @@
"modules\\launcher\\Interop.Microsoft.Office.Interop.OneNote.dll",
"modules\\launcher\\hyjiacan.py4n.dll",
"Settings\\Microsoft.Graphics.Canvas.Interop.dll",
"Settings\\clrcompression.dll",
"Settings\\CommunityToolkit.Labs.WinUI.SettingsControls.dll",
"ColorCode.Core.dll",
"ColorCode.UWP.dll",

View File

@@ -9,8 +9,6 @@ jobs:
variables:
BuildConfiguration: ${{ parameters.configuration }}
BuildPlatform: ${{ parameters.platform }}
NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=${{ parameters.platform }} # Required for nuget to work due to self contained
NODE_OPTIONS: --max_old_space_size=16384
pool:
demands: ImageOverride -equals WinDevVS17-latest
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:

View File

@@ -22,7 +22,6 @@ parameters:
variables:
IsPipeline: 1 # The installer uses this to detect whether it should pick up localizations
SkipCppCodeAnalysis: 1 # Skip the code analysis to speed up release CI. It runs on PR CI, anyway
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
resources:
@@ -39,8 +38,6 @@ jobs:
${{ config }}_${{ platform }}:
BuildConfiguration: ${{ config }}
BuildPlatform: ${{ platform }}
NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=${{ platform }} # Required for nuget to work due to self contained
NODE_OPTIONS: --max_old_space_size=16384
displayName: Build
timeoutInMinutes: 120 # Some of the loc stuff adds quite a bit of time.
cancelTimeoutInMinutes: 1
@@ -548,7 +545,7 @@ jobs:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: GPO Files'
inputs:
PathtoPublish: src\gpo\assets
PathtoPublish: doc\gpo\assets
ArtifactName: GroupPolicyObjectsFiles

View File

@@ -62,8 +62,7 @@ $items | ForEach-Object {
(-not $_.Name.EndsWith("Microsoft.WindowsAppRuntime.Bootstrap.dll")) -and
(-not $_.Name.EndsWith("MRM.dll")) -and
(-not $_.Name.EndsWith("PushNotificationsLongRunningTask.ProxyStub.dll")) -and
(-not $_.Name.EndsWith("WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll")) -and
(-not $_.Name.EndsWith("System.Diagnostics.EventLog.Messages.dll"))
(-not $_.Name.EndsWith("WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll"))
)
{
Write-Host "Version not set: " + $_.FullName

View File

@@ -18,6 +18,10 @@ Damien has helped out by developing and contributing the Quick Accent utility.
### [@davidegiacometti](https://github.com/davidegiacometti) - [Davide Giacometti](https://www.linkedin.com/in/davidegiacometti/)
Davide has helped fix multiple bugs, added new utilities, features, as well as help us with the ARM64 effort by porting applications to .NET Core.
### [@dend](https://github.com/dend/) - Den Delimarsky
PowerToys Awake is a tool to keep your computer awake.
### [@franky920920](https://github.com/franky920920) - [Franky Chen](https://frankychen.net)
Franky has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys.
@@ -83,11 +87,7 @@ Image Resizer is from Brice.
### [@chrdavis](https://github.com/chrdavis/) - Chris Davis
PowerRename is from Chris's SmartRename and icon rendering for SVGs in File Explorer.
### [@dend](https://github.com/dend/) - Den Delimarsky
PowerToys Awake is a tool to keep your computer awake.
PowerRename is from Chris's SmartRename and icon rendering for SVGs in File Explorer
### [@Niels9001](https://github.com/niels9001/) - [Niels Laute](https://nielslaute.com/)

View File

@@ -30,24 +30,19 @@
</ClCompile>
</ItemDefinitionGroup>
<!-- Run code analysis locally and in PR CI, but not on release CI -->
<PropertyGroup Condition="'$(SkipCppCodeAnalysis)' == ''">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(MsbuildThisFileDirectory)\CppRuleSet.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<!-- C++ source compile-specific things for all configurations -->
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
<PreferredToolArchitecture Condition="'$(PROCESSOR_ARCHITECTURE)' == 'ARM64' or '$(PROCESSOR_ARCHITEW6432)' == 'ARM64'">arm64</PreferredToolArchitecture>
<VcpkgEnabled>false</VcpkgEnabled>
<ExternalIncludePath>$(MSBuildThisFileFullPath)\..\deps\;$(MSBuildThisFileFullPath)\..\packages\;$(ExternalIncludePath)</ExternalIncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(MsbuildThisFileDirectory)\CppRuleSet.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4679;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26800;28251;6387;4505;4679;4702;6248;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableAnalyzeExternal >true</DisableAnalyzeExternal>
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
<ConformanceMode>false</ConformanceMode>
@@ -120,4 +115,4 @@
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
</Project>
</Project>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Cpp Rule Set" Description="Based on Microsoft Native Recommended Rules and CPP core guideline rules." ToolsVersion="17.0">
<RuleSet Name="Cpp Rule Set" Description="Based on Microsoft Native Recommended Rules. These rules focus on the most critical and common problems in your native code, including potential security holes and application crashes. You should include this rule set in any custom rule set you create for your native projects. This ruleset is designed to work with Visual Studio Professional edition and higher." ToolsVersion="17.0">
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
<Rule Id="C26100" Action="Info" />
<Rule Id="C26101" Action="Info" />
@@ -10,97 +10,31 @@
<Rule Id="C26116" Action="Info" />
<Rule Id="C26117" Action="Info" />
<Rule Id="C26140" Action="Info" />
<Rule Id="C26400" Action="Info" />
<Rule Id="C26401" Action="Info" />
<Rule Id="C26402" Action="Error" />
<Rule Id="C26403" Action="Error" />
<Rule Id="C26404" Action="Error" />
<Rule Id="C26405" Action="Error" />
<Rule Id="C26406" Action="Error" />
<Rule Id="C26407" Action="Error" />
<Rule Id="C26408" Action="Info" />
<Rule Id="C26409" Action="Info" />
<Rule Id="C26410" Action="Error" />
<Rule Id="C26411" Action="Error" />
<Rule Id="C26414" Action="Info" />
<Rule Id="C26415" Action="Info" />
<Rule Id="C26416" Action="Error" />
<Rule Id="C26417" Action="Info" />
<Rule Id="C26418" Action="Info" />
<Rule Id="C26426" Action="Info" />
<Rule Id="C26427" Action="Error" />
<Rule Id="C26429" Action="Info" />
<Rule Id="C26430" Action="Info" />
<Rule Id="C26431" Action="Info" />
<Rule Id="C26432" Action="Info" />
<Rule Id="C26433" Action="Info" />
<Rule Id="C26434" Action="Info" />
<Rule Id="C26435" Action="Info" />
<Rule Id="C26436" Action="Info" />
<Rule Id="C26437" Action="Error" />
<Rule Id="C26438" Action="Info" />
<Rule Id="C26439" Action="Error" />
<Rule Id="C26440" Action="Info" />
<Rule Id="C26441" Action="Error" />
<Rule Id="C26443" Action="Error" />
<Rule Id="C26444" Action="Error" />
<Rule Id="C26445" Action="Error" />
<Rule Id="C26446" Action="Info" />
<Rule Id="C26447" Action="Info" />
<Rule Id="C26448" Action="Info" />
<Rule Id="C26449" Action="Error" />
<Rule Id="C26450" Action="Error" />
<Rule Id="C26437" Action="Info" />
<Rule Id="C26439" Action="Info" />
<Rule Id="C26441" Action="Info" />
<Rule Id="C26444" Action="Info" />
<Rule Id="C26449" Action="Info" />
<Rule Id="C26450" Action="Info" />
<Rule Id="C26451" Action="Error" />
<Rule Id="C26452" Action="Error" />
<Rule Id="C26453" Action="Error" />
<Rule Id="C26454" Action="Error" />
<Rule Id="C26455" Action="Info" />
<Rule Id="C26456" Action="Info" />
<Rule Id="C26459" Action="Info" />
<Rule Id="C26460" Action="Info" />
<Rule Id="C26461" Action="Info" />
<Rule Id="C26462" Action="Info" />
<Rule Id="C26463" Action="Error" />
<Rule Id="C26464" Action="Error" />
<Rule Id="C26465" Action="Info" />
<Rule Id="C26466" Action="Error" />
<Rule Id="C26471" Action="Info" />
<Rule Id="C26472" Action="Info" />
<Rule Id="C26473" Action="Info" />
<Rule Id="C26474" Action="Info" />
<Rule Id="C26475" Action="Error" />
<Rule Id="C26476" Action="Info" />
<Rule Id="C26477" Action="Info" />
<Rule Id="C26478" Action="Error" />
<Rule Id="C26479" Action="Error" />
<Rule Id="C26481" Action="Info" />
<Rule Id="C26482" Action="Info" />
<Rule Id="C26483" Action="Error" />
<Rule Id="C26485" Action="Info" />
<Rule Id="C26490" Action="Info" />
<Rule Id="C26491" Action="Info" />
<Rule Id="C26492" Action="Info" />
<Rule Id="C26493" Action="Info" />
<Rule Id="C26494" Action="Info" />
<Rule Id="C26452" Action="Info" />
<Rule Id="C26453" Action="Info" />
<Rule Id="C26454" Action="Info" />
<Rule Id="C26478" Action="Info" />
<Rule Id="C26479" Action="Info" />
<Rule Id="C26495" Action="Error" />
<Rule Id="C26496" Action="Info" />
<Rule Id="C26497" Action="Info" />
<Rule Id="C26498" Action="Error" />
<Rule Id="C26498" Action="Info" />
<Rule Id="C26800" Action="Info" />
<Rule Id="C26810" Action="Error" />
<Rule Id="C26810" Action="Info" />
<Rule Id="C26811" Action="Info" />
<Rule Id="C26812" Action="Info" />
<Rule Id="C26813" Action="Info" />
<Rule Id="C26814" Action="Info" />
<Rule Id="C26815" Action="Info" />
<Rule Id="C26816" Action="Info" />
<Rule Id="C26817" Action="Info" />
<Rule Id="C26818" Action="Info" />
<Rule Id="C26819" Action="Error" />
<Rule Id="C26820" Action="Error" />
<Rule Id="C26826" Action="Info" />
<Rule Id="C26827" Action="Error" />
<Rule Id="C26828" Action="Error" />
<Rule Id="C26819" Action="Info" />
<Rule Id="C26820" Action="Info" />
<Rule Id="C26827" Action="Info" />
<Rule Id="C26828" Action="Info" />
<Rule Id="C28020" Action="Info" />
<Rule Id="C28021" Action="Info" />
<Rule Id="C28022" Action="Info" />

View File

@@ -29,14 +29,14 @@
</PropertyGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<Compile Include="$(MSBuildThisFileDirectory)\src\codeAnalysis\GlobalSuppressions.cs" Link="GlobalSuppressions.cs" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\src\codeAnalysis\StyleCop.json" Link="StyleCop.json" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0-preview1.22464.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -421,6 +421,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerAccent", "PowerAccent"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerAccentModuleInterface", "src\modules\poweraccent\PowerAccentModuleInterface\PowerAccentModuleInterface.vcxproj", "{34A354C5-23C7-4343-916C-C52DAF4FC39D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerAccent", "src\modules\poweraccent\PowerAccent\PowerAccent.csproj", "{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerAccent.Core", "src\modules\poweraccent\PowerAccent.Core\PowerAccent.Core.csproj", "{3264DF53-C805-4B0C-867C-FCEAF7AEF762}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerAccent.UI", "src\modules\poweraccent\PowerAccent.UI\PowerAccent.UI.csproj", "{31CAD28E-778A-441C-85BC-40AB3EAA2A10}"
@@ -468,23 +470,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GPOWrapper", "src\common\GP
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GPOWrapperProjection", "src\common\GPOWrapperProjection\GPOWrapperProjection.csproj", "{00EE9BA6-4E8F-43CA-960D-D4882F0FBB97}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MarkdownPreviewHandlerCpp", "src\modules\previewpane\MarkdownPreviewHandlerCpp\MarkdownPreviewHandlerCpp.vcxproj", "{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Peek", "Peek", "{17B4FA70-001E-4D33-BBBB-0D142DBC2E20}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GcodePreviewHandlerCpp", "src\modules\previewpane\GcodePreviewHandlerCpp\GcodePreviewHandlerCpp.vcxproj", "{5A5DD09D-723A-44D3-8F2B-293584C3D731}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.UI.WPF", "src\modules\peek\Peek.UI.WPF\Peek.UI.WPF.csproj", "{C0240BC3-95AF-4B38-811A-76E3FD56B576}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MonacoPreviewHandlerCpp", "src\modules\previewpane\MonacoPreviewHandlerCpp\MonacoPreviewHandlerCpp.vcxproj", "{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Peek", "src\modules\peek\peek\peek.vcxproj", "{A1425B53-3D61-4679-8623-E64A0D3D0A48}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PdfPreviewHandlerCpp", "src\modules\previewpane\PdfPreviewHandlerCpp\PdfPreviewHandlerCpp.vcxproj", "{54F7C616-FD41-4E62-BFF9-015686914F4D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.UI", "src\modules\peek\Peek.UI\Peek.UI.csproj", "{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SvgPreviewHandlerCpp", "src\modules\previewpane\SvgPreviewHandlerCpp\SvgPreviewHandlerCpp.vcxproj", "{143F13E3-D2E3-4D83-B035-356612D99956}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.Common", "src\modules\peek\Peek.Common\Peek.Common.csproj", "{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GcodeThumbnailProviderCpp", "src\modules\previewpane\GcodeThumbnailProviderCpp\GcodeThumbnailProviderCpp.vcxproj", "{56CC2F10-6E41-453D-BE16-C593A5E58482}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.FilePreviewer", "src\modules\peek\Peek.FilePreviewer\Peek.FilePreviewer.csproj", "{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PdfThumbnailProviderCpp", "src\modules\previewpane\PdfThumbnailProviderCpp\PdfThumbnailProviderCpp.vcxproj", "{CA5518ED-0458-4B09-8F53-4122B9888655}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StlThumbnailProviderCpp", "src\modules\previewpane\StlThumbnailProviderCpp\StlThumbnailProviderCpp.vcxproj", "{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SvgThumbnailProviderCpp", "src\modules\previewpane\SvgThumbnailProviderCpp\SvgThumbnailProviderCpp.vcxproj", "{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIC", "src\modules\peek\WIC\WIC.csproj", "{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1715,6 +1713,18 @@ Global
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|x64.Build.0 = Release|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|x86.ActiveCfg = Release|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|x86.Build.0 = Release|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|ARM64.Build.0 = Debug|ARM64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|x64.ActiveCfg = Debug|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|x64.Build.0 = Debug|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|x86.ActiveCfg = Debug|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Debug|x86.Build.0 = Debug|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|ARM64.ActiveCfg = Release|ARM64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|ARM64.Build.0 = Release|ARM64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|x64.ActiveCfg = Release|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|x64.Build.0 = Release|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|x86.ActiveCfg = Release|x64
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C}.Release|x86.Build.0 = Release|x64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|ARM64.ActiveCfg = Debug|ARM64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|ARM64.Build.0 = Debug|ARM64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|x64.ActiveCfg = Debug|x64
@@ -1913,114 +1923,84 @@ Global
{00EE9BA6-4E8F-43CA-960D-D4882F0FBB97}.Release|x64.Build.0 = Release|x64
{00EE9BA6-4E8F-43CA-960D-D4882F0FBB97}.Release|x86.ActiveCfg = Release|x64
{00EE9BA6-4E8F-43CA-960D-D4882F0FBB97}.Release|x86.Build.0 = Release|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|ARM64.ActiveCfg = Debug|ARM64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|ARM64.Build.0 = Debug|ARM64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|x64.ActiveCfg = Debug|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|x64.Build.0 = Debug|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|x86.ActiveCfg = Debug|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|x86.Build.0 = Debug|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|ARM64.ActiveCfg = Release|ARM64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|ARM64.Build.0 = Release|ARM64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|x64.ActiveCfg = Release|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|x64.Build.0 = Release|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|x86.ActiveCfg = Release|x64
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Release|x86.Build.0 = Release|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|ARM64.ActiveCfg = Debug|ARM64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|ARM64.Build.0 = Debug|ARM64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|x64.ActiveCfg = Debug|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|x64.Build.0 = Debug|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|x86.ActiveCfg = Debug|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Debug|x86.Build.0 = Debug|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|ARM64.ActiveCfg = Release|ARM64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|ARM64.Build.0 = Release|ARM64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|x64.ActiveCfg = Release|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|x64.Build.0 = Release|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|x86.ActiveCfg = Release|x64
{5A5DD09D-723A-44D3-8F2B-293584C3D731}.Release|x86.Build.0 = Release|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|ARM64.Build.0 = Debug|ARM64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|x64.ActiveCfg = Debug|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|x64.Build.0 = Debug|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|x86.ActiveCfg = Debug|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Debug|x86.Build.0 = Debug|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|ARM64.ActiveCfg = Release|ARM64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|ARM64.Build.0 = Release|ARM64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|x64.ActiveCfg = Release|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|x64.Build.0 = Release|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|x86.ActiveCfg = Release|x64
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}.Release|x86.Build.0 = Release|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|ARM64.Build.0 = Debug|ARM64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|x64.ActiveCfg = Debug|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|x64.Build.0 = Debug|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|x86.ActiveCfg = Debug|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Debug|x86.Build.0 = Debug|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|ARM64.ActiveCfg = Release|ARM64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|ARM64.Build.0 = Release|ARM64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|x64.ActiveCfg = Release|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|x64.Build.0 = Release|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|x86.ActiveCfg = Release|x64
{54F7C616-FD41-4E62-BFF9-015686914F4D}.Release|x86.Build.0 = Release|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|ARM64.ActiveCfg = Debug|ARM64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|ARM64.Build.0 = Debug|ARM64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|x64.ActiveCfg = Debug|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|x64.Build.0 = Debug|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|x86.ActiveCfg = Debug|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Debug|x86.Build.0 = Debug|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|ARM64.ActiveCfg = Release|ARM64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|ARM64.Build.0 = Release|ARM64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|x64.ActiveCfg = Release|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|x64.Build.0 = Release|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|x86.ActiveCfg = Release|x64
{143F13E3-D2E3-4D83-B035-356612D99956}.Release|x86.Build.0 = Release|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|ARM64.ActiveCfg = Debug|ARM64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|ARM64.Build.0 = Debug|ARM64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|x64.ActiveCfg = Debug|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|x64.Build.0 = Debug|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|x86.ActiveCfg = Debug|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Debug|x86.Build.0 = Debug|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|ARM64.ActiveCfg = Release|ARM64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|ARM64.Build.0 = Release|ARM64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|x64.ActiveCfg = Release|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|x64.Build.0 = Release|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|x86.ActiveCfg = Release|x64
{56CC2F10-6E41-453D-BE16-C593A5E58482}.Release|x86.Build.0 = Release|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|ARM64.ActiveCfg = Debug|ARM64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|ARM64.Build.0 = Debug|ARM64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|x64.ActiveCfg = Debug|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|x64.Build.0 = Debug|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|x86.ActiveCfg = Debug|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Debug|x86.Build.0 = Debug|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|ARM64.ActiveCfg = Release|ARM64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|ARM64.Build.0 = Release|ARM64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|x64.ActiveCfg = Release|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|x64.Build.0 = Release|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|x86.ActiveCfg = Release|x64
{CA5518ED-0458-4B09-8F53-4122B9888655}.Release|x86.Build.0 = Release|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|ARM64.Build.0 = Debug|ARM64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|x64.ActiveCfg = Debug|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|x64.Build.0 = Debug|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|x86.ActiveCfg = Debug|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Debug|x86.Build.0 = Debug|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|ARM64.ActiveCfg = Release|ARM64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|ARM64.Build.0 = Release|ARM64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|x64.ActiveCfg = Release|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|x64.Build.0 = Release|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|x86.ActiveCfg = Release|x64
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D}.Release|x86.Build.0 = Release|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|ARM64.ActiveCfg = Debug|ARM64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|ARM64.Build.0 = Debug|ARM64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|x64.ActiveCfg = Debug|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|x64.Build.0 = Debug|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|x86.ActiveCfg = Debug|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Debug|x86.Build.0 = Debug|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|ARM64.ActiveCfg = Release|ARM64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|ARM64.Build.0 = Release|ARM64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|x64.ActiveCfg = Release|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|x64.Build.0 = Release|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|x86.ActiveCfg = Release|x64
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA}.Release|x86.Build.0 = Release|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|ARM64.Build.0 = Debug|ARM64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|x64.ActiveCfg = Debug|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|x64.Build.0 = Debug|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|x86.ActiveCfg = Debug|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Debug|x86.Build.0 = Debug|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|ARM64.ActiveCfg = Release|ARM64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|ARM64.Build.0 = Release|ARM64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|x64.ActiveCfg = Release|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|x64.Build.0 = Release|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|x86.ActiveCfg = Release|x64
{C0240BC3-95AF-4B38-811A-76E3FD56B576}.Release|x86.Build.0 = Release|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|ARM64.Build.0 = Debug|ARM64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|x64.ActiveCfg = Debug|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|x64.Build.0 = Debug|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|x86.ActiveCfg = Debug|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Debug|x86.Build.0 = Debug|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|ARM64.ActiveCfg = Release|ARM64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|ARM64.Build.0 = Release|ARM64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|x64.ActiveCfg = Release|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|x64.Build.0 = Release|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|x86.ActiveCfg = Release|x64
{A1425B53-3D61-4679-8623-E64A0D3D0A48}.Release|x86.Build.0 = Release|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|ARM64.Build.0 = Debug|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|ARM64.Deploy.0 = Debug|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x64.ActiveCfg = Debug|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x64.Build.0 = Debug|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x64.Deploy.0 = Debug|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x86.ActiveCfg = Debug|x86
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x86.Build.0 = Debug|x86
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Debug|x86.Deploy.0 = Debug|x86
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|ARM64.ActiveCfg = Release|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|ARM64.Build.0 = Release|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|ARM64.Deploy.0 = Release|ARM64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x64.ActiveCfg = Release|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x64.Build.0 = Release|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x64.Deploy.0 = Release|x64
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x86.ActiveCfg = Release|x86
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x86.Build.0 = Release|x86
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}.Release|x86.Deploy.0 = Release|x86
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|ARM64.ActiveCfg = Debug|ARM64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|ARM64.Build.0 = Debug|ARM64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|x64.ActiveCfg = Debug|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|x64.Build.0 = Debug|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|x86.ActiveCfg = Debug|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Debug|x86.Build.0 = Debug|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|ARM64.ActiveCfg = Release|ARM64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|ARM64.Build.0 = Release|ARM64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|x64.ActiveCfg = Release|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|x64.Build.0 = Release|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|x86.ActiveCfg = Release|x64
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}.Release|x86.Build.0 = Release|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|ARM64.ActiveCfg = Debug|ARM64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|ARM64.Build.0 = Debug|ARM64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|x64.ActiveCfg = Debug|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|x64.Build.0 = Debug|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|x86.ActiveCfg = Debug|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Debug|x86.Build.0 = Debug|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|ARM64.ActiveCfg = Release|ARM64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|ARM64.Build.0 = Release|ARM64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x64.ActiveCfg = Release|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x64.Build.0 = Release|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x86.ActiveCfg = Release|x64
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x86.Build.0 = Release|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|ARM64.ActiveCfg = Debug|ARM64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|ARM64.Build.0 = Debug|ARM64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x64.ActiveCfg = Debug|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x64.Build.0 = Debug|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x86.ActiveCfg = Debug|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x86.Build.0 = Debug|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|ARM64.ActiveCfg = Release|ARM64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|ARM64.Build.0 = Release|ARM64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x64.ActiveCfg = Release|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x64.Build.0 = Release|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x86.ActiveCfg = Release|x64
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x86.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2161,6 +2141,7 @@ Global
{18B3DB45-4FFE-4D01-97D6-5223FEEE1853} = {6C7F47CC-2151-44A3-A546-41C70025132C}
{0F14491C-6369-4C45-AAA8-135814E66E6B} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{34A354C5-23C7-4343-916C-C52DAF4FC39D} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{7B4CDB0D-28C9-4F95-88AA-73FCC06E354C} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{3264DF53-C805-4B0C-867C-FCEAF7AEF762} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{31CAD28E-778A-441C-85BC-40AB3EAA2A10} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{A50C70A6-2DA0-4027-B90E-B1A40755A8A5} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
@@ -2182,15 +2163,13 @@ Global
{C604B37E-9D0E-4484-8778-E8B31B0E1B3A} = {AB82E5DD-C32D-4F28-9746-2C780846188E}
{E599C30B-9DC8-4E5A-BF27-93D4CCEDE788} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{00EE9BA6-4E8F-43CA-960D-D4882F0FBB97} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{ED9A1AC6-AEB0-4569-A6E9-E1696182B545} = {2F305555-C296-497E-AC20-5FA1B237996A}
{5A5DD09D-723A-44D3-8F2B-293584C3D731} = {2F305555-C296-497E-AC20-5FA1B237996A}
{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9} = {2F305555-C296-497E-AC20-5FA1B237996A}
{54F7C616-FD41-4E62-BFF9-015686914F4D} = {2F305555-C296-497E-AC20-5FA1B237996A}
{143F13E3-D2E3-4D83-B035-356612D99956} = {2F305555-C296-497E-AC20-5FA1B237996A}
{56CC2F10-6E41-453D-BE16-C593A5E58482} = {2F305555-C296-497E-AC20-5FA1B237996A}
{CA5518ED-0458-4B09-8F53-4122B9888655} = {2F305555-C296-497E-AC20-5FA1B237996A}
{D6DCC3AE-18C0-488A-B978-BAA9E3CFF09D} = {2F305555-C296-497E-AC20-5FA1B237996A}
{2BBC9E33-21EC-401C-84DA-BB6590A9B2AA} = {2F305555-C296-497E-AC20-5FA1B237996A}
{17B4FA70-001E-4D33-BBBB-0D142DBC2E20} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{C0240BC3-95AF-4B38-811A-76E3FD56B576} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
{A1425B53-3D61-4679-8623-E64A0D3D0A48} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}

160
README.md
View File

@@ -30,15 +30,15 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
- Windows 11 or Windows 10 version 2004 (code name 20H1 / build number 19041) or newer.
- Our installer will install the following items:
- [.NET 7.0.0 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/7.0#runtime-desktop-7.0.0).
- [.NET 6.0.10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/6.0#runtime-desktop-6.0.10).
- [Microsoft Edge WebView2 Runtime](https://go.microsoft.com/fwlink/p/?LinkId=2124703) bootstrapper. This will install the latest version.
### Via GitHub with EXE [Recommended]
Go to [Microsoft PowerToys GitHub releases page][github-release-link], click on `Assets` at the bottom to show the files available in the release. Please use the appropriate the PowerToys installer that matches your machine's architecture. For most, it is `x64`.
- **For x64 processors (most common):** [PowerToysSetup-0.65.0-x64.exe](https://github.com/microsoft/PowerToys/releases/download/v0.65.0/PowerToysSetup-0.65.0-x64.exe)
- **For ARM64 processors:** [PowerToysSetup-0.65.0-arm64.exe](https://github.com/microsoft/PowerToys/releases/download/v0.65.0/PowerToysSetup-0.65.0-arm64.exe)
- **For x64 processors (most common):** [PowerToysSetup-0.64.1-x64.exe](https://github.com/microsoft/PowerToys/releases/download/v0.64.1/PowerToysSetup-0.64.1-x64.exe)
- **For ARM64 processors:** [PowerToysSetup-0.64.1-arm64.exe](https://github.com/microsoft/PowerToys/releases/download/v0.64.1/PowerToysSetup-0.64.1-arm64.exe)
This is our preferred method.
@@ -55,7 +55,7 @@ winget install Microsoft.PowerToys -s winget
### Other install methods
There are [community driven install methods](./doc/unofficialInstallMethods.md) such as Chocolatey and Scoop. If these are your preferred install solutions, this will have the install instructions.
There are [community driven install methods](./doc/unofficialInstallMethods.md) such as Chocolatey and Scoop. If these are your preferred install solutions, this will have the install instructions.
## Contributing
@@ -73,15 +73,18 @@ For guidance on developing for PowerToys, please read the [developer docs](/doc/
Our [prioritized roadmap][roadmap] of features and utilities that the core team is focusing on.
### 0.65 - November 2022 Update
### 0.64 - October 2022 Update
In this release, we focused on stability and improvements.
In this release, we focused on releasing new features and improvements.
**Highlights**
- The codebase was upgraded to work with .NET 7. Thanks [@snickler](https://github.com/snickler)!
- Quick Accent can now show a description of the selected character. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
- ColorPicker now supports adding custom formats.
- New utility: File Locksmith allows seeing which processes are currently using the selected files.
- New utility: Hosts File Editor allows you to edit your hosts file in an Editor UI. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Settings has a new feature for backing up / restoring the settings from a file. Thanks [@jefflord](https://github.com/jefflord)!
- FancyZones allows you to set defaults for horizontal/vertical screens to get better intended behavior for new screens and cases where a monitor ID resets.
- PowerToys ships with Group Policy Objects settings for force disabling and enabling PowerToys utilities in organizations. Check the [GPO docs](https://github.com/microsoft/PowerToys/tree/main/doc/gpo) for more details.
- Added a warning about deprecating Video Conference Mute in the future (v0.67), please check https://github.com/microsoft/PowerToys/issues/21473 for more information.
### Known issues
@@ -89,127 +92,100 @@ In this release, we focused on stability and improvements.
- After installing PowerToys, [the new Windows 11 context menu entries for PowerRename and Image Resizer might not appear before a system restart](https://github.com/microsoft/PowerToys/issues/19124).
- There are reports of users who are [unable to open the Settings window](https://github.com/microsoft/PowerToys/issues/18015). This is being caused by incompatibilities with some applications (RTSS RivaTuner Statistics Server is a known examples of this). If you're affected by this, please check the linked issue to verify if any of the presented solutions works for you.
### General
- Downgraded the ModernWPF dependency to 0.9.4 to avoid issues on certain virtualization technologies. (This was a hotfix for 0.64)
- Upgraded and fixed the code to work with .NET 7. Thanks [@snickler](https://github.com/snickler)!
### Always on Top
- Added telemetry for the pinning/unpinning events.
### Awake
- Added telemetry.
- Removed exiting Awake from the tray icon when starting from the runner. Utilities started from the runner should be disabled in the Settings to avoid discrepancies.
- Detect and put a window on top again if it's no longer on top.
### Color Picker
- Fixed an infinite loop due to a looping UI refresh. (This was a hotfix for 0.64)
- Added a feature to allow users to create their own color formats.
- Added the hexadecimal integer format. Thanks [@marius-bughiu](https://github.com/marius-bughiu)!
### FancyZones
- Fixed an issue that caused turning off spaces between zones to not apply correctly. (This was a hotfix for 0.64)
- Prevent the shift key press from trickling down to the focused window. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed a bug causing FancyZones to try resizing hidden windows.
- Fixed the focus layout preview being empty on first run in the editor.
- Fixed UI margin in the "Create new layout" dialog.
- Fixed window positioning issues when switching between virtual desktops.
- Fixed snapping by hotkey in single zone layouts.
### File explorer add-ons
- Added .log file support to the Monaco preview handler. Thanks [@Eagle3386](https://github.com/Eagle3386)!
- Added a way for users to configure default layouts for horizontal and vertical screens.
- Replaced remaining Number Boxes in FancyZones Editor with Sliders, to improve accessibility for screen readers.
- Fixed an issue breaking window switching shortcuts.
### File Locksmith
- Query system and other users processes when elevated. (This was a hotfix for 0.64)
- Icon and UI fixes. Thanks [@niels9001](https://github.com/niels9001)! (This was a hotfix for 0.64)
- Added a new utility: File Locksmith.
- Thanks [@niels9001](https://github.com/niels9001) for the design on the UI!
### Group Policy Objects
- Removed a obsolete dependency from the admx file to fix importing on Intune. Thanks [@htcfreek](https://github.com/htcfreek)! (This was a hotfix for 0.64)
- Group Policy Objects settings for force disabling and enabling PowerToys utilities.
- Thanks [@htcfreek](https://github.com/htcfreek) for your help in reviewing to make sure the shipped settings conform to system administrators expectations!
### Hosts File Editor
- Added a scrollbar to the additional lines dialog. Thanks [@davidegiacometti](https://github.com/davidegiacometti)! (This was a hotfix for 0.64)
- Updated the plus icon. Thanks [@niels9001](https://github.com/niels9001)! (This was a hotfix for 0.64)
- Prevent the new entry content dialog from overlapping the title bar.
- Updated the name for the additional lines feature. Thanks [@htcfreek](https://github.com/htcfreek)!
- Added a workaround for an issue causing the context menu not opening on right-click. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Added a new utility: Hosts File Editor. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Thanks [@niels9001](https://github.com/niels9001) for the design help on the UI!
- Thanks [@davidegiacometti](https://github.com/davidegiacometti) for fixing the bugs found and adding features up until release!
- Thanks [@AtariDreams](https://github.com/AtariDreams) for consolidating the packages comparing to the rest of the project!
- Thanks [@htcfreek](https://github.com/htcfreek) for adding a scrollviewer to the entry editor!
### Image Resizer
- Fixed a silent crash when trying to show the tier 1 context menu on Windows 11.
### Keyboard Manager
- Fixed a delay that was not being cancelled properly. Thanks [@AtariDreams](https://github.com/AtariDreams)!
### Mouse Utilities
- Changed the opacity setting to the 1-100 range. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
### PowerToys Run
- Added pinyin support to the search. Thanks [@frg2089](https://github.com/frg2089)!
- Fixed an error in the TimeZone plugin preventing searching for standard time zones. Thanks [@Tantalus13A98B5F](https://github.com/Tantalus13A98B5F)!
- Added the English abbreviations as fallbacks in the UnitConverter plugin. Thanks [@Tantalus13A98B5F](https://github.com/Tantalus13A98B5F)!
- Changed image loading to release the images in PowerToys Run main executable. This is a try to fix the "app.dark.png" missing issues received after a PowerToys update.
- Fixed the PowerToys Run hiding after the default action failed. Thanks [@hlaueriksson](https://github.com/hlaueriksson)!
- Fixed the PowerToys Run allows showing after a context menu action succeeded. Thanks [@hlaueriksson](https://github.com/hlaueriksson)!
### Quick Accent
- Added mappings for the mu, omicron, upsilon and thorn characters.
- Added a setting to exclude apps from activating Quick Accent.
- Fixed an issue causing the selector to trigger when leaving the lock screen. Thanks [@damienleroy](https://github.com/damienleroy)!
- Added the Croatian, Netherlands, Swedish and Welsh character sets. Thanks [@damienleroy](https://github.com/damienleroy)!
- Added support for more unicode characters. Thanks [@char-46](https://github.com/char-46)!
- Shift-space can now navigate backwards in the selector. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Added the Catalan accented characters. Thanks [@ivocarbajo](https://github.com/ivocarbajo) and [@codingneko](https://github.com/codingneko)!
- Added the Kurdish accented characters.
- Added the Serbian accented characters. Thanks [@damienleroy](https://github.com/damienleroy)!
- Added the Irish and Scottish accented characters.
- Added the description for the currently selected character in the selector.
- Fixed a bug causing the selector window to appear blank.
- Corrected "Dutch" word to "German". Thanks [@damienleroy](https://github.com/damienleroy)!
- Added the Portuguese language accents. Thanks [@pcanavar](https://github.com/pcanavar)!
- Fixed positioning of toolbar on scaled desktops.
### Runner
### Screen Ruler
- Fixed a crash on a racing condition accessing the IPC communication with Settings.
- Improved the acrylic brush used in the menu. Thanks [@niels9001](https://github.com/niels9001)!
### Settings
- Fixed settings name in the QuickAccent page. Thanks [@htcfreek](https://github.com/htcfreek)!
- Added a message indicating there's no network available when looking for updates.
- Fixed an error causing the backup/restore feature to not find the backup file. Thanks [@jefflord](https://github.com/jefflord)!
- Fixed localization for the "All apps" expression in the keyboard manager page.
- UI refactoring, clean-up and bringing in modern controls. Thanks [@niels9001](https://github.com/niels9001)!
- Improved settings/OOBE screens text. Thanks [@Jay-o-Way](https://github.com/Jay-o-Way)!
- The backup/restore feature also backs up FancyZones layouts.
- Added a feature to backup/restore settings to/from a file. Thanks [@jefflord](https://github.com/jefflord)!
- Fixed an issue causing shortcuts shown in OOBE not updating to new values when the window was re-opened.
- Fixed the "Documents" folder usage in the backup/restore feature. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
### Shortcut Guide
- Added a setting to make the shortcuts and taskbar icons have different configurable response times. Thanks [@OkamiWong](https://github.com/OkamiWong)!
### Text Extractor
- Added a warning about how to install languages for OCR recognition.
- Fixed the overlay not focusing after the first activation.
- Added spaces between CJK and non-CJK words. Thanks [@maggch97](https://github.com/maggch97)!
### Video Conference Mute
- Added a setting to hide the Video Conference Mute overlay when muted. Thanks [@akabhirav](https://github.com/akabhirav)!
- Added a warning about deprecating Video Conference Mute in the future (v0.67), please check https://github.com/microsoft/PowerToys/issues/21473 for more information.
- Changed the warning about deprecating Video Conference Mute to saying it's going to go into legacy mode, thanks to community feedback. (This was a hotfix for 0.64)
### Installer
### Documentation
- Added the core team to COMMUNITY.md
- Added some missing files that were causing Settings and PowerRename to not function correctly on some configurations.
- Updated the .NET dependency to 6.0.10.
### Development
- Fixed some errors in the GitHub issue templates. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
- Updated the Windows implementation library. Thanks [@AtariDreams](https://github.com/AtariDreams)!
- Added Hosts File Editor to the issue templates. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Consolidated nuget packages and removed a few unused packages.
- Updated the Windows.CppRT to the latest version. Thanks [@AtariDreams](https://github.com/AtariDreams)!
- Removed the cxxopts dependency, which was no longer used. Thanks [@AtariDreams](https://github.com/AtariDreams)!
- Updated the cziplob dependency to 0.25. Thanks [@AtariDreams](https://github.com/AtariDreams)!
- Updated the System.IO.Abstractions dependency. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Turned on C++ code analysis and incrementally fixing warnings.
- Cleaned up unused dependencies. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed building on the latest MSVC.
- Fixed multi-processor build on the latest MSBuild.
- Added a message to suggest the feedback hub to the fabric bot triggers.
- Optimized every png file with the zopfli algorithm. Thanks [@pea-sys](https://github.com/pea-sys)!
- Updated the .vsconfig file for a quicker development setup. Thanks [@ChaseKnowlden](https://github.com/ChaseKnowlden)!
- Fixed a language typo in the code. Thanks [@eltociear](https://github.com/eltociear)!
- Fixed wrong x86 target in the solution file.
- Added a script to fail building when the nuget packages aren't consolidated. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Upgraded the Vanara.Invoke dependencies.
- Upgraded and brought back the spell-checker. Thanks [@jsoref](https://github.com/jsoref)!
- Added a new dependencies feed and fixed release CI. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
- Added the install method to the issue template on GitHub, since some issues seem to be related to specific installation methods.
- Automated installer hash creation in the release CI.
- Simplified use of `.First()` on ImageResizer. Thanks [@AtariDreams](https://github.com/AtariDreams)!
- Improved and clarified the issues templates. Thanks [@Jay-o-Way](https://github.com/Jay-o-Way)!
- Fixed a PTRun unit test to be more compatible with .NET 6. Thanks [@AtariDreams](https://github.com/AtariDreams)!
#### What is being planned for version 0.66
#### What is being planned for version 0.65
For [v0.66][github-next-release-work], we'll work on below:
For [v0.65][github-next-release-work], we'll work on below:
- Ship .NET self contained and shared between utilities
- Stability / bug fixes
@@ -239,5 +215,5 @@ The application logs basic telemetry. Our Telemetry Data page (Coming Soon) has
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
<!-- items that need to be updated release to release -->
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F39
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F38
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F38
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F37

View File

@@ -38,17 +38,16 @@ Once you've discussed your proposed feature/fix/etc. with a team member, and you
### Prerequisites for Compiling PowerToys
1. Windows 10 April 2018 Update (version 1803) or newer
1. Visual Studio Community/Professional/Enterprise 2022 17.4 or newer
1. Git clone PowerToys repository
1. Open started the `PowerToys.sln`
1. If you see a dialog that says `install extra components` in the solution explorer pane, click `install`
2. Visual Studio Community/Professional/Enterprise 2022
3. Install the [required Windows Apps SDK workloads](https://learn.microsoft.com/windows/apps/windows-app-sdk/set-up-your-development-environment?tabs=vs-2022-17-1-a%2Cvs-2022-17-1-b#required-workloads-and-components), the [Windows App SDK 1.0.3 C# Visual Studio 2022 extension](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads) and the [Windows Apps SDK 1.0.3 runtime](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads#windows-app-sdk-10).
4. Once you've cloned and started the `PowerToys.sln`, in the solution explorer, if you see a dialog that says `install extra components`, click `install`
### Get Submodules to compile
We have submodules that need to be initialized before you can compile most parts of PowerToys. This should be a one time step.
1. Open a terminal
1. Navigate to the folder you cloned PowerToys to.
1. Run `git submodule update --init --recursive`
2. Navigate to the folder you cloned PowerToys to.
3. Run `git submodule update --init --recursive`
### Compiling Source Code
@@ -65,22 +64,22 @@ Our installer is two parts, an EXE and an MSI. The EXE (Bootstrapper) contains
The installer can only be compiled in `Release` mode, step 1 and 2 must be done before the MSI will be able to be compiled.
1. Compile `PowerToys.sln`. Instructions are listed above.
1. Compile `BugReportTool.sln` tool. Path from root: `tools\BugReportTool\BugReportTool.sln` (details listed below)
1. Compile `WebcamReportTool.sln` tool. Path from root: `tools\WebcamReportTool\WebcamReportTool.sln` (details listed below)
1. Compile `StylesReportTool.sln` tool. Path from root: `tools\StylesReportTool\StylesReportTool.sln` (details listed below)
1. Compile `PowerToysSetup.sln` Path from root: `installer\PowerToysSetup.sln` (details listed below)
2. Compile `BugReportTool.sln` tool. Path from root: `tools\BugReportTool\BugReportTool.sln` (details listed below)
3. Compile `WebcamReportTool.sln` tool. Path from root: `tools\WebcamReportTool\WebcamReportTool.sln` (details listed below)
3. Compile `StylesReportTool.sln` tool. Path from root: `tools\StylesReportTool\StylesReportTool.sln` (details listed below)
4. Compile `PowerToysSetup.sln` Path from root: `installer\PowerToysSetup.sln` (details listed below)
### Prerequisites for building the MSI installer
1. Install the [WiX Toolset Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension).
1. Install the [WiX Toolset build tools](https://wixtoolset.org/releases/v3-14-0-6526/).
1. Download [WiX binaries](https://wixtoolset.org/downloads/v3.14.0.6526/wix314-binaries.zip) and extract `wix.targets` to `C:\Program Files (x86)\WiX Toolset v3.14`.
2. Install the [WiX Toolset build tools](https://wixtoolset.org/releases/v3-14-0-6526/).
3. Download [WiX binaries](https://wixtoolset.org/downloads/v3.14.0.6526/wix314-binaries.zip) and extract `wix.targets` to `C:\Program Files (x86)\WiX Toolset v3.14`.
### Locally building the installer prerequisite projects all at once from the command-line
1. Open a `Developer Command Prompt for VS 2022`
1. Ensure `nuget.exe` is in your `%path%`
1. In the repo root, run these commands:
2. Ensure `nuget.exe` is in your `%path%`
3. In the repo root, run these commands:
```
nuget restore .\tools\BugReportTool\BugReportTool.sln
@@ -96,26 +95,26 @@ msbuild -p:Platform=x64 -p:Configuration=Release .\tools\StylesReportTool\Styles
### Locally compiling the Bug reporting tool
1. Open `tools\BugReportTool\BugReportTool.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
### Locally compiling the Webcam reporting tool
1. Open `tools\WebcamReportTool\WebcamReportTool.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
### Locally compiling the Window styles reporting tool
1. Open `tools\StylesReportTool\StylesReportTool.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
### Locally compiling the installer
1. Open `installer\PowerToysSetup.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu choose `Build Solution`.
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu choose `Build Solution`.
The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.

View File

@@ -6,13 +6,21 @@
<?define BinDir="$(var.RepoDir)$(var.Platform)\$(var.Configuration)\" ?>
<?define PowerToysPlatform="x64"?>
<?define Dotnet7DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/5b2fbe00-507e-450e-8b52-43ab052aadf2/79d54c3a19ce3fce314f2367cf4e3b21/windowsdesktop-runtime-7.0.0-win-x64.exe"?>
<?define Dotnet7PayloadSize="57756472"?>
<?define Dotnet7PayloadHash="DB56882D3263C9E533EA7003D018CB7D65F11C10"?>
<?define PlatformProgramFiles="[ProgramFiles64Folder]"?>
<?else?>
<!-- stable WIX 3 doesn't support ARM64, so we build installers as x86 -->
<?define BinDir="$(var.RepoDir)ARM64\$(var.Configuration)\" ?>
<?define PowerToysPlatform="ARM64"?>
<!--TODO: define to ARM64 Program files once it's available-->
<?define Dotnet7DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/bce1b608-3a2a-45e6-ab7b-8c414b9e2c56/74703a44afc5f7550eba824143fc20a7/windowsdesktop-runtime-7.0.0-win-arm64.exe"?>
<?define Dotnet7PayloadSize="53133216"?>
<?define Dotnet7PayloadHash="8A7271390C2538268EFC71F3E49C80017F406C16"?>
<!--TODO: define to ARM64 Program files once it's available-->
<?define PlatformProgramFiles="[ProgramFiles6432Folder]"?>
<?endif?>
@@ -33,6 +41,7 @@
SuppressRepair="yes" />
</BootstrapperApplicationRef>
<util:FileSearch Variable="HasDotnet700" Path="$(var.PlatformProgramFiles)dotnet\shared\Microsoft.WindowsDesktop.App\7.0.0\System.Xaml.dll" Result="exists" />
<util:RegistrySearch Variable="HasWebView2PerMachine" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
<util:RegistrySearch Variable="HasWebView2PerUser" Root="HKCU" Key="Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
@@ -64,6 +73,26 @@
PerMachine="yes"
Vital="no">
</ExePackage>
<ExePackage
DisplayName="Downloading and installing .NET 7 Desktop Runtime"
Name="windowsdesktop-runtime-7.0.0-win-$(var.PowerToysPlatform).exe"
Compressed="no"
Id="DotnetRuntime7"
DetectCondition="HasDotnet700"
DownloadUrl="$(var.Dotnet7DownloadUrl)"
InstallCommand="/install /quiet /norestart"
RepairCommand="/repair /passive /norestart"
Permanent="yes"
PerMachine="yes"
UninstallCommand="/uninstall /quiet /norestart">
<ExitCode Value="1638" Behavior="success"/>
<RemotePayload
Description="Microsoft Windows Desktop Runtime - 7.0.0 ($(var.PowerToysPlatform))"
ProductName="Microsoft Windows Desktop Runtime - 7.0.0 ($(var.PowerToysPlatform))"
Size="$(var.Dotnet7PayloadSize)"
Version="7.0.0.31819"
Hash="$(var.Dotnet7PayloadHash)" />
</ExePackage>
<ExePackage
DisplayName="Installing Microsoft Edge WebView2"
Name="MicrosoftEdgeWebview2Setup.exe"

File diff suppressed because one or more lines are too long

View File

@@ -15,8 +15,6 @@
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Management.Deployment.h>
#include "DepsFilesLists.h"
using namespace std;
HINSTANCE DLL_HANDLE = nullptr;
@@ -34,6 +32,56 @@ const DWORD USERNAME_LEN = UNLEN + 1; // User Name + '\0'
static const wchar_t* POWERTOYS_EXE_COMPONENT = L"{A2C66D91-3485-4D00-B04D-91844E6B345B}";
static const wchar_t* POWERTOYS_UPGRADE_CODE = L"{42B84BF7-5FBF-473B-9C8B-049DC16F7708}";
const std::vector<std::wstring> winAppSdkFiles = {
L"CoreMessagingXP.dll",
L"DWriteCore.dll",
L"DwmSceneI.dll",
L"MRM.dll",
L"Microsoft.DirectManipulation.dll",
L"Microsoft.InputStateManager.dll",
L"Microsoft.Internal.FrameworkUdk.dll",
L"Microsoft.UI.Composition.OSSupport.dll",
L"Microsoft.UI.Input.dll",
L"Microsoft.UI.Windowing.Core.dll",
L"Microsoft.UI.Xaml.Controls.dll",
L"Microsoft.UI.Xaml.Controls.pri",
L"Microsoft.UI.Xaml.Internal.dll",
L"Microsoft.UI.Xaml.Phone.dll",
L"Microsoft.Web.WebView2.Core.dll",
L"Microsoft.Windows.AppNotifications.Projection.dll",
L"Microsoft.Windows.ApplicationModel.Resources.dll",
L"Microsoft.WindowsAppRuntime.Bootstrap.dll",
L"Microsoft.Windows.PushNotifications.Projection.dll",
L"Microsoft.Windows.System.Projection.dll",
L"Microsoft.WindowsAppRuntime.Insights.Resource.dll",
L"Microsoft.WindowsAppRuntime.Release.Net.dll",
L"Microsoft.WindowsAppRuntime.dll",
L"Microsoft.ui.xaml.dll",
L"Microsoft.ui.xaml.resources.19h1.dll",
L"Microsoft.ui.xaml.resources.common.dll",
L"PushNotificationsLongRunningTask.ProxyStub.dll",
L"WinUIEdit.dll",
L"WindowsAppRuntime.png",
L"WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll",
L"dcompi.dll",
L"dwmcorei.dll",
L"marshal.dll",
L"wuceffectsi.dll" };
const std::vector<std::wstring> powerToysInteropFiles = {
L"concrt140.dll",
L"msvcp140.dll",
L"msvcp140_1.dll",
L"msvcp140_2.dll",
L"msvcp140_atomic_wait.dll",
L"msvcp140_codecvt_ids.dll",
L"PowerToys.Interop.dll",
L"vcamp140.dll",
L"vccorlib140.dll",
L"vcomp140.dll",
L"vcruntime140.dll",
L"vcruntime140_1.dll" };
struct WcaSink : spdlog::sinks::base_sink<std::mutex>
{
virtual void sink_it_(const spdlog::details::log_msg& msg) override
@@ -456,7 +504,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to create a scheduled task to start PowerToys at user login. You can re-try to create the scheduled task using the PowerToys settings."));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -573,7 +621,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to remove the PowerToys folder from the scheduled task. These can be removed manually later."));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -846,7 +894,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to add certificate to store"));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -878,7 +926,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to install virtual camera driver"));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -919,7 +967,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to uninstall virtual camera driver"));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -1055,7 +1103,6 @@ const std::wstring PTInteropConsumers[] =
L"modules\\PowerAccent",
L"modules\\FileLocksmith",
L"modules\\Hosts",
L"modules\\FileExplorerPreview",
};
UINT __stdcall CreatePTInteropHardlinksCA(MSIHANDLE hInstall)
@@ -1094,87 +1141,6 @@ LExit:
return WcaFinalize(er);
}
UINT __stdcall CreateDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
std::wstring installationFolder, dotnetRuntimeFilesSrcDir, colorPickerDir, powerOCRDir, launcherDir, fancyZonesDir,
imageResizerDir, settingsDir, awakeDir, measureToolDir, powerAccentDir, fileExplorerAddOnsDir, hostsDir, fileLocksmithDir;
hr = WcaInitialize(hInstall, "CreateDotnetRuntimeHardlinksCA");
ExitOnFailure(hr, "Failed to initialize");
hr = getInstallFolder(hInstall, installationFolder);
ExitOnFailure(hr, "Failed to get installation folder");
dotnetRuntimeFilesSrcDir = installationFolder + L"dll\\dotnet\\";
colorPickerDir = installationFolder + L"modules\\ColorPicker\\";
powerOCRDir = installationFolder + L"modules\\PowerOCR\\";
launcherDir = installationFolder + L"modules\\launcher\\";
fancyZonesDir = installationFolder + L"modules\\FancyZones\\";
imageResizerDir = installationFolder + L"modules\\ImageResizer\\";
settingsDir = installationFolder + L"Settings\\";
awakeDir = installationFolder + L"modules\\Awake\\";
measureToolDir = installationFolder + L"modules\\MeasureTool\\";
powerAccentDir = installationFolder + L"modules\\PowerAccent\\";
fileExplorerAddOnsDir = installationFolder + L"modules\\FileExplorerPreview\\";
hostsDir = installationFolder + L"modules\\Hosts\\";
fileLocksmithDir = installationFolder + L"modules\\FileLocksmith\\";
for (auto file : dotnetRuntimeFiles)
{
std::error_code ec;
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (colorPickerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerOCRDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (launcherDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fancyZonesDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (imageResizerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (settingsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (awakeDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (measureToolDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerAccentDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileExplorerAddOnsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (hostsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileLocksmithDir + file).c_str(), ec);
if (ec.value() != S_OK)
{
std::wstring errorMessage{ L"Error creating hard link for: " };
errorMessage += file;
errorMessage += L", error code: " + std::to_wstring(ec.value());
Logger::error(errorMessage);
er = ERROR_INSTALL_FAILURE;
}
}
for (auto file : dotnetRuntimeWPFFiles)
{
std::error_code ec;
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (awakeDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (colorPickerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerOCRDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (launcherDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fancyZonesDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (imageResizerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerAccentDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileExplorerAddOnsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (hostsDir + file).c_str(), ec);
if (ec.value() != S_OK)
{
std::wstring errorMessage{ L"Error creating hard link for: " };
errorMessage += file;
errorMessage += L", error code: " + std::to_wstring(ec.value());
Logger::error(errorMessage);
er = ERROR_INSTALL_FAILURE;
}
}
LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
UINT __stdcall DeleteWinAppSDKHardlinksCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
@@ -1247,78 +1213,6 @@ LExit:
return WcaFinalize(er);
}
UINT __stdcall DeleteDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
std::wstring installationFolder, colorPickerDir, powerOCRDir, launcherDir, fancyZonesDir,
imageResizerDir, settingsDir, awakeDir, measureToolDir, powerAccentDir, fileExplorerAddOnsDir,
hostsDir, fileLocksmithDir;
hr = WcaInitialize(hInstall, "DeleteDotnetRuntimeHardlinksCA");
ExitOnFailure(hr, "Failed to initialize");
hr = getInstallFolder(hInstall, installationFolder);
ExitOnFailure(hr, "Failed to get installation folder");
colorPickerDir = installationFolder + L"modules\\ColorPicker\\";
powerOCRDir = installationFolder + L"modules\\PowerOCR\\";
launcherDir = installationFolder + L"modules\\launcher\\";
fancyZonesDir = installationFolder + L"modules\\FancyZones\\";
imageResizerDir = installationFolder + L"modules\\ImageResizer\\";
settingsDir = installationFolder + L"Settings\\";
awakeDir = installationFolder + L"modules\\Awake\\";
measureToolDir = installationFolder + L"modules\\MeasureTool\\";
powerAccentDir = installationFolder + L"modules\\PowerAccent\\";
fileExplorerAddOnsDir = installationFolder + L"modules\\FileExplorerPreview\\";
hostsDir = installationFolder + L"modules\\Hosts\\";
fileLocksmithDir = installationFolder + L"modules\\FileLocksmith\\";
try
{
for (auto file : dotnetRuntimeFiles)
{
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((settingsDir + file).c_str());
DeleteFile((awakeDir + file).c_str());
DeleteFile((measureToolDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
DeleteFile((fileLocksmithDir + file).c_str());
}
for (auto file : dotnetRuntimeWPFFiles)
{
DeleteFile((awakeDir + file).c_str());
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
}
}
catch (std::exception e)
{
std::string errorMessage{ "Exception thrown while trying to delete dotnet runtime hardlinks: " };
errorMessage += e.what();
Logger::error(errorMessage);
er = ERROR_INSTALL_FAILURE;
}
LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
@@ -1336,7 +1230,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));
std::array<std::wstring_view, 9> processesToTerminate = {
std::array<std::wstring_view, 10> processesToTerminate = {
L"PowerToys.PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.Awake.exe",
@@ -1345,6 +1239,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
L"PowerToys.FileLocksmithUI.exe",
L"PowerToys.ColorPickerUI.exe",
L"PowerToys.AlwaysOnTop.exe",
L"PowerToys.PeekUI.exe",
L"PowerToys.exe"
};

View File

@@ -7,8 +7,6 @@ EXPORTS
DeleteWinAppSDKHardlinksCA
CreatePTInteropHardlinksCA
DeletePTInteropHardlinksCA
CreateDotnetRuntimeHardlinksCA
DeleteDotnetRuntimeHardlinksCA
DetectPrevInstallPathCA
RemoveScheduledTasksCA
TelemetryLogInstallSuccessCA

View File

@@ -1,535 +0,0 @@
#pragma once
#include <vector>
#include <string>
inline const std::vector<std::wstring> winAppSdkFiles = {
L"CoreMessagingXP.dll",
L"DWriteCore.dll",
L"DwmSceneI.dll",
L"MRM.dll",
L"Microsoft.DirectManipulation.dll",
L"Microsoft.InputStateManager.dll",
L"Microsoft.Internal.FrameworkUdk.dll",
L"Microsoft.UI.Composition.OSSupport.dll",
L"Microsoft.UI.Input.dll",
L"Microsoft.UI.Windowing.Core.dll",
L"Microsoft.UI.Xaml.Controls.dll",
L"Microsoft.UI.Xaml.Controls.pri",
L"Microsoft.UI.Xaml.Internal.dll",
L"Microsoft.UI.Xaml.Phone.dll",
L"Microsoft.Web.WebView2.Core.dll",
L"Microsoft.Windows.AppNotifications.Projection.dll",
L"Microsoft.Windows.ApplicationModel.Resources.dll",
L"Microsoft.WindowsAppRuntime.Bootstrap.dll",
L"Microsoft.Windows.PushNotifications.Projection.dll",
L"Microsoft.Windows.System.Projection.dll",
L"Microsoft.WindowsAppRuntime.Insights.Resource.dll",
L"Microsoft.WindowsAppRuntime.Release.Net.dll",
L"Microsoft.WindowsAppRuntime.dll",
L"Microsoft.ui.xaml.dll",
L"Microsoft.ui.xaml.resources.19h1.dll",
L"Microsoft.ui.xaml.resources.common.dll",
L"PushNotificationsLongRunningTask.ProxyStub.dll",
L"WinUIEdit.dll",
L"WindowsAppRuntime.png",
L"WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll",
L"dcompi.dll",
L"dwmcorei.dll",
L"marshal.dll",
L"wuceffectsi.dll"
};
inline const std::vector<std::wstring> powerToysInteropFiles = {
L"concrt140.dll",
L"msvcp140.dll",
L"msvcp140_1.dll",
L"msvcp140_2.dll",
L"msvcp140_atomic_wait.dll",
L"msvcp140_codecvt_ids.dll",
L"PowerToys.Interop.dll",
L"vcamp140.dll",
L"vccorlib140.dll",
L"vcomp140.dll",
L"vcruntime140.dll",
L"vcruntime140_1.dll"
};
#ifdef _M_X64
inline const std::vector<std::wstring> dotnetRuntimeFiles = {
L"clrcompression.dll",
L"clretwrc.dll",
L"clrgc.dll",
L"clrjit.dll",
L"coreclr.dll",
L"hostfxr.dll",
L"hostpolicy.dll",
L"Microsoft.CSharp.dll",
L"Microsoft.DiaSymReader.Native.amd64.dll",
L"Microsoft.VisualBasic.Core.dll",
L"Microsoft.VisualBasic.dll",
L"Microsoft.Win32.Primitives.dll",
L"Microsoft.Win32.Registry.dll",
L"mscordaccore.dll",
L"mscordbi.dll",
L"mscorlib.dll",
L"mscorrc.dll",
L"msquic.dll",
L"netstandard.dll",
L"System.AppContext.dll",
L"System.Buffers.dll",
L"System.CodeDom.dll",
L"System.Collections.Concurrent.dll",
L"System.Collections.dll",
L"System.Collections.Immutable.dll",
L"System.Collections.NonGeneric.dll",
L"System.Collections.Specialized.dll",
L"System.ComponentModel.Annotations.dll",
L"System.ComponentModel.DataAnnotations.dll",
L"System.ComponentModel.dll",
L"System.ComponentModel.EventBasedAsync.dll",
L"System.ComponentModel.Primitives.dll",
L"System.ComponentModel.TypeConverter.dll",
L"System.Configuration.dll",
L"System.Console.dll",
L"System.Core.dll",
L"System.Data.Common.dll",
L"System.Data.DataSetExtensions.dll",
L"System.Data.dll",
L"System.Diagnostics.Contracts.dll",
L"System.Diagnostics.Debug.dll",
L"System.Diagnostics.DiagnosticSource.dll",
L"System.Diagnostics.FileVersionInfo.dll",
L"System.Diagnostics.Process.dll",
L"System.Diagnostics.StackTrace.dll",
L"System.Diagnostics.TextWriterTraceListener.dll",
L"System.Diagnostics.Tools.dll",
L"System.Diagnostics.TraceSource.dll",
L"System.Diagnostics.Tracing.dll",
L"System.dll",
L"System.Drawing.dll",
L"System.Drawing.Primitives.dll",
L"System.Dynamic.Runtime.dll",
L"System.Formats.Asn1.dll",
L"System.Formats.Tar.dll",
L"System.Globalization.Calendars.dll",
L"System.Globalization.dll",
L"System.Globalization.Extensions.dll",
L"System.IO.Compression.Brotli.dll",
L"System.IO.Compression.dll",
L"System.IO.Compression.FileSystem.dll",
L"System.IO.Compression.Native.dll",
L"System.IO.Compression.ZipFile.dll",
L"System.IO.dll",
L"System.IO.FileSystem.AccessControl.dll",
L"System.IO.FileSystem.dll",
L"System.IO.FileSystem.DriveInfo.dll",
L"System.IO.FileSystem.Primitives.dll",
L"System.IO.FileSystem.Watcher.dll",
L"System.IO.IsolatedStorage.dll",
L"System.IO.MemoryMappedFiles.dll",
L"System.IO.Pipes.AccessControl.dll",
L"System.IO.Pipes.dll",
L"System.IO.UnmanagedMemoryStream.dll",
L"System.Linq.dll",
L"System.Linq.Expressions.dll",
L"System.Linq.Parallel.dll",
L"System.Linq.Queryable.dll",
L"System.Memory.dll",
L"System.Net.dll",
L"System.Net.Http.dll",
L"System.Net.Http.Json.dll",
L"System.Net.HttpListener.dll",
L"System.Net.Mail.dll",
L"System.Net.NameResolution.dll",
L"System.Net.NetworkInformation.dll",
L"System.Net.Ping.dll",
L"System.Net.Primitives.dll",
L"System.Net.Quic.dll",
L"System.Net.Requests.dll",
L"System.Net.Security.dll",
L"System.Net.ServicePoint.dll",
L"System.Net.Sockets.dll",
L"System.Net.WebClient.dll",
L"System.Net.WebHeaderCollection.dll",
L"System.Net.WebProxy.dll",
L"System.Net.WebSockets.Client.dll",
L"System.Net.WebSockets.dll",
L"System.Numerics.dll",
L"System.Numerics.Vectors.dll",
L"System.ObjectModel.dll",
L"System.Private.CoreLib.dll",
L"System.Private.DataContractSerialization.dll",
L"System.Private.Uri.dll",
L"System.Private.Xml.dll",
L"System.Private.Xml.Linq.dll",
L"System.Reflection.DispatchProxy.dll",
L"System.Reflection.dll",
L"System.Reflection.Emit.dll",
L"System.Reflection.Emit.ILGeneration.dll",
L"System.Reflection.Emit.Lightweight.dll",
L"System.Reflection.Extensions.dll",
L"System.Reflection.Metadata.dll",
L"System.Reflection.Primitives.dll",
L"System.Reflection.TypeExtensions.dll",
L"System.Resources.Reader.dll",
L"System.Resources.ResourceManager.dll",
L"System.Resources.Writer.dll",
L"System.Runtime.CompilerServices.Unsafe.dll",
L"System.Runtime.CompilerServices.VisualC.dll",
L"System.Runtime.dll",
L"System.Runtime.Extensions.dll",
L"System.Runtime.Handles.dll",
L"System.Runtime.InteropServices.dll",
L"System.Runtime.InteropServices.JavaScript.dll",
L"System.Runtime.InteropServices.RuntimeInformation.dll",
L"System.Runtime.Intrinsics.dll",
L"System.Runtime.Loader.dll",
L"System.Runtime.Numerics.dll",
L"System.Runtime.Serialization.dll",
L"System.Runtime.Serialization.Formatters.dll",
L"System.Runtime.Serialization.Json.dll",
L"System.Runtime.Serialization.Primitives.dll",
L"System.Runtime.Serialization.Xml.dll",
L"System.Security.AccessControl.dll",
L"System.Security.Claims.dll",
L"System.Security.Cryptography.dll",
L"System.Security.Cryptography.Algorithms.dll",
L"System.Security.Cryptography.Cng.dll",
L"System.Security.Cryptography.Csp.dll",
L"System.Security.Cryptography.Encoding.dll",
L"System.Security.Cryptography.OpenSsl.dll",
L"System.Security.Cryptography.Primitives.dll",
L"System.Security.Cryptography.X509Certificates.dll",
L"System.Security.dll",
L"System.Security.Principal.dll",
L"System.Security.Principal.Windows.dll",
L"System.Security.SecureString.dll",
L"System.ServiceModel.Web.dll",
L"System.ServiceProcess.dll",
L"System.Text.Encoding.CodePages.dll",
L"System.Text.Encoding.dll",
L"System.Text.Encoding.Extensions.dll",
L"System.Text.Encodings.Web.dll",
L"System.Text.RegularExpressions.dll",
L"System.Threading.Channels.dll",
L"System.Threading.dll",
L"System.Threading.Overlapped.dll",
L"System.Threading.Tasks.Dataflow.dll",
L"System.Threading.Tasks.dll",
L"System.Threading.Tasks.Extensions.dll",
L"System.Threading.Tasks.Parallel.dll",
L"System.Threading.Thread.dll",
L"System.Threading.ThreadPool.dll",
L"System.Threading.Timer.dll",
L"System.Transactions.dll",
L"System.Transactions.Local.dll",
L"System.ValueTuple.dll",
L"System.Web.dll",
L"System.Web.HttpUtility.dll",
L"System.Windows.dll",
L"System.Xml.dll",
L"System.Xml.Linq.dll",
L"System.Xml.ReaderWriter.dll",
L"System.Xml.Serialization.dll",
L"System.Xml.XDocument.dll",
L"System.Xml.XmlDocument.dll",
L"System.Xml.XmlSerializer.dll",
L"System.Xml.XPath.dll",
L"System.Xml.XPath.XDocument.dll" };
inline const std::vector<std::wstring> dotnetRuntimeWPFFiles = {
L"Accessibility.dll",
L"D3DCompiler_47_cor3.dll",
L"DirectWriteForwarder.dll",
L"Microsoft.VisualBasic.Forms.dll",
L"Microsoft.Win32.Registry.AccessControl.dll",
L"Microsoft.Win32.SystemEvents.dll",
L"PenImc_cor3.dll",
L"PresentationCore.dll",
L"PresentationFramework-SystemCore.dll",
L"PresentationFramework-SystemData.dll",
L"PresentationFramework-SystemDrawing.dll",
L"PresentationFramework-SystemXml.dll",
L"PresentationFramework-SystemXmlLinq.dll",
L"PresentationFramework.Aero.dll",
L"PresentationFramework.Aero2.dll",
L"PresentationFramework.AeroLite.dll",
L"PresentationFramework.Classic.dll",
L"PresentationFramework.dll",
L"PresentationFramework.Luna.dll",
L"PresentationFramework.Royale.dll",
L"PresentationNative_cor3.dll",
L"PresentationUI.dll",
L"ReachFramework.dll",
L"System.Configuration.ConfigurationManager.dll",
L"System.Design.dll",
L"System.Diagnostics.EventLog.dll",
L"System.Diagnostics.EventLog.Messages.dll",
L"System.Diagnostics.PerformanceCounter.dll",
L"System.DirectoryServices.dll",
L"System.Drawing.Common.dll",
L"System.Drawing.Design.dll",
L"System.IO.Packaging.dll",
L"System.Printing.dll",
L"System.Resources.Extensions.dll",
L"System.Security.Cryptography.Pkcs.dll",
L"System.Security.Cryptography.ProtectedData.dll",
L"System.Security.Cryptography.Xml.dll",
L"System.Security.Permissions.dll",
L"System.Threading.AccessControl.dll",
L"System.Windows.Controls.Ribbon.dll",
L"System.Windows.Extensions.dll",
L"System.Windows.Forms.Design.dll",
L"System.Windows.Forms.Design.Editors.dll",
L"System.Windows.Forms.dll",
L"System.Windows.Forms.Primitives.dll",
L"System.Windows.Input.Manipulations.dll",
L"System.Windows.Presentation.dll",
L"System.Xaml.dll",
L"UIAutomationClient.dll",
L"UIAutomationClientSideProviders.dll",
L"UIAutomationProvider.dll",
L"UIAutomationTypes.dll",
L"vcruntime140_cor3.dll",
L"WindowsFormsIntegration.dll",
L"wpfgfx_cor3.dll" };
#else //ARM64
inline const std::vector<std::wstring> dotnetRuntimeFiles = {
L"clretwrc.dll",
L"clrgc.dll",
L"clrjit.dll",
L"coreclr.dll",
L"dbgshim.dll",
L"hostfxr.dll",
L"hostpolicy.dll",
L"Microsoft.CSharp.dll",
L"Microsoft.DiaSymReader.Native.arm64.dll",
L"Microsoft.Graphics.Canvas.dll",
L"Microsoft.VisualBasic.Core.dll",
L"Microsoft.VisualBasic.dll",
L"Microsoft.Win32.Primitives.dll",
L"Microsoft.Win32.Registry.dll",
L"mscordaccore.dll",
L"mscordbi.dll",
L"mscorlib.dll",
L"mscorrc.dll",
L"netstandard.dll",
L"System.AppContext.dll",
L"System.Buffers.dll",
L"System.Collections.Concurrent.dll",
L"System.Collections.dll",
L"System.Collections.Immutable.dll",
L"System.Collections.NonGeneric.dll",
L"System.Collections.Specialized.dll",
L"System.ComponentModel.Annotations.dll",
L"System.ComponentModel.DataAnnotations.dll",
L"System.ComponentModel.dll",
L"System.ComponentModel.EventBasedAsync.dll",
L"System.ComponentModel.Primitives.dll",
L"System.ComponentModel.TypeConverter.dll",
L"System.Configuration.dll",
L"System.Console.dll",
L"System.Core.dll",
L"System.Data.Common.dll",
L"System.Data.DataSetExtensions.dll",
L"System.Data.dll",
L"System.Diagnostics.Contracts.dll",
L"System.Diagnostics.Debug.dll",
L"System.Diagnostics.DiagnosticSource.dll",
L"System.Diagnostics.FileVersionInfo.dll",
L"System.Diagnostics.Process.dll",
L"System.Diagnostics.StackTrace.dll",
L"System.Diagnostics.TextWriterTraceListener.dll",
L"System.Diagnostics.Tools.dll",
L"System.Diagnostics.TraceSource.dll",
L"System.Diagnostics.Tracing.dll",
L"System.dll",
L"System.Drawing.dll",
L"System.Drawing.Primitives.dll",
L"System.Dynamic.Runtime.dll",
L"System.Formats.Asn1.dll",
L"System.Formats.Tar.dll",
L"System.Globalization.Calendars.dll",
L"System.Globalization.dll",
L"System.Globalization.Extensions.dll",
L"System.IO.Compression.Brotli.dll",
L"System.IO.Compression.dll",
L"System.IO.Compression.FileSystem.dll",
L"System.IO.Compression.Native.dll",
L"System.IO.Compression.ZipFile.dll",
L"System.IO.dll",
L"System.IO.FileSystem.AccessControl.dll",
L"System.IO.FileSystem.dll",
L"System.IO.FileSystem.DriveInfo.dll",
L"System.IO.FileSystem.Primitives.dll",
L"System.IO.FileSystem.Watcher.dll",
L"System.IO.IsolatedStorage.dll",
L"System.IO.MemoryMappedFiles.dll",
L"System.IO.Pipes.AccessControl.dll",
L"System.IO.Pipes.dll",
L"System.IO.UnmanagedMemoryStream.dll",
L"System.Linq.dll",
L"System.Linq.Expressions.dll",
L"System.Linq.Parallel.dll",
L"System.Linq.Queryable.dll",
L"System.Memory.dll",
L"System.Net.dll",
L"System.Net.Http.dll",
L"System.Net.Http.Json.dll",
L"System.Net.HttpListener.dll",
L"System.Net.Mail.dll",
L"System.Net.NameResolution.dll",
L"System.Net.NetworkInformation.dll",
L"System.Net.Ping.dll",
L"System.Net.Primitives.dll",
L"System.Net.Quic.dll",
L"System.Net.Requests.dll",
L"System.Net.Security.dll",
L"System.Net.ServicePoint.dll",
L"System.Net.Sockets.dll",
L"System.Net.WebClient.dll",
L"System.Net.WebHeaderCollection.dll",
L"System.Net.WebProxy.dll",
L"System.Net.WebSockets.Client.dll",
L"System.Net.WebSockets.dll",
L"System.Numerics.dll",
L"System.Numerics.Vectors.dll",
L"System.ObjectModel.dll",
L"System.Private.CoreLib.dll",
L"System.Private.DataContractSerialization.dll",
L"System.Private.Uri.dll",
L"System.Private.Xml.dll",
L"System.Private.Xml.Linq.dll",
L"System.Reflection.DispatchProxy.dll",
L"System.Reflection.dll",
L"System.Reflection.Emit.dll",
L"System.Reflection.Emit.ILGeneration.dll",
L"System.Reflection.Emit.Lightweight.dll",
L"System.Reflection.Extensions.dll",
L"System.Reflection.Metadata.dll",
L"System.Reflection.Primitives.dll",
L"System.Reflection.TypeExtensions.dll",
L"System.Resources.Reader.dll",
L"System.Resources.ResourceManager.dll",
L"System.Resources.Writer.dll",
L"System.Runtime.CompilerServices.Unsafe.dll",
L"System.Runtime.CompilerServices.VisualC.dll",
L"System.Runtime.dll",
L"System.Runtime.Extensions.dll",
L"System.Runtime.Handles.dll",
L"System.Runtime.InteropServices.dll",
L"System.Runtime.InteropServices.JavaScript.dll",
L"System.Runtime.InteropServices.RuntimeInformation.dll",
L"System.Runtime.Intrinsics.dll",
L"System.Runtime.Loader.dll",
L"System.Runtime.Numerics.dll",
L"System.Runtime.Serialization.dll",
L"System.Runtime.Serialization.Formatters.dll",
L"System.Runtime.Serialization.Json.dll",
L"System.Runtime.Serialization.Primitives.dll",
L"System.Runtime.Serialization.Xml.dll",
L"System.Security.AccessControl.dll",
L"System.Security.Claims.dll",
L"System.Security.Cryptography.dll",
L"System.Security.Cryptography.Algorithms.dll",
L"System.Security.Cryptography.Cng.dll",
L"System.Security.Cryptography.Csp.dll",
L"System.Security.Cryptography.Encoding.dll",
L"System.Security.Cryptography.OpenSsl.dll",
L"System.Security.Cryptography.Primitives.dll",
L"System.Security.Cryptography.X509Certificates.dll",
L"System.Security.dll",
L"System.Security.Principal.dll",
L"System.Security.Principal.Windows.dll",
L"System.Security.SecureString.dll",
L"System.ServiceModel.Web.dll",
L"System.ServiceProcess.dll",
L"System.Text.Encoding.CodePages.dll",
L"System.Text.Encoding.dll",
L"System.Text.Encoding.Extensions.dll",
L"System.Text.Encodings.Web.dll",
L"System.Text.Json.dll",
L"System.Text.RegularExpressions.dll",
L"System.Threading.Channels.dll",
L"System.Threading.dll",
L"System.Threading.Overlapped.dll",
L"System.Threading.Tasks.Dataflow.dll",
L"System.Threading.Tasks.dll",
L"System.Threading.Tasks.Extensions.dll",
L"System.Threading.Tasks.Parallel.dll",
L"System.Threading.Thread.dll",
L"System.Threading.ThreadPool.dll",
L"System.Threading.Timer.dll",
L"System.Transactions.dll",
L"System.Transactions.Local.dll",
L"System.ValueTuple.dll",
L"System.Web.dll",
L"System.Web.HttpUtility.dll",
L"System.Windows.dll",
L"System.Xml.dll",
L"System.Xml.Linq.dll",
L"System.Xml.ReaderWriter.dll",
L"System.Xml.Serialization.dll",
L"System.Xml.XDocument.dll",
L"System.Xml.XmlDocument.dll",
L"System.Xml.XmlSerializer.dll",
L"System.Xml.XPath.dll",
L"System.Xml.XPath.XDocument.dll" };
inline const std::vector<std::wstring> dotnetRuntimeWPFFiles = {
L"Accessibility.dll",
L"DirectWriteForwarder.dll",
L"Microsoft.VisualBasic.Forms.dll",
L"Microsoft.Win32.Registry.AccessControl.dll",
L"Microsoft.Win32.SystemEvents.dll",
L"PenImc_cor3.dll",
L"PresentationCore.dll",
L"PresentationFramework-SystemCore.dll",
L"PresentationFramework-SystemData.dll",
L"PresentationFramework-SystemDrawing.dll",
L"PresentationFramework-SystemXml.dll",
L"PresentationFramework-SystemXmlLinq.dll",
L"PresentationFramework.Aero.dll",
L"PresentationFramework.Aero2.dll",
L"PresentationFramework.AeroLite.dll",
L"PresentationFramework.Classic.dll",
L"PresentationFramework.dll",
L"PresentationFramework.Luna.dll",
L"PresentationFramework.Royale.dll",
L"PresentationNative_cor3.dll",
L"PresentationUI.dll",
L"ReachFramework.dll",
L"System.CodeDom.dll",
L"System.Configuration.ConfigurationManager.dll",
L"System.Design.dll",
L"System.Diagnostics.EventLog.dll",
L"System.Diagnostics.EventLog.Messages.dll",
L"System.Diagnostics.PerformanceCounter.dll",
L"System.DirectoryServices.dll",
L"System.Drawing.Common.dll",
L"System.Drawing.Design.dll",
L"System.IO.Packaging.dll",
L"System.Security.Cryptography.Pkcs.dll",
L"System.Security.Cryptography.ProtectedData.dll",
L"System.Security.Cryptography.Xml.dll",
L"System.Security.Permissions.dll",
L"System.Threading.AccessControl.dll",
L"System.Windows.Controls.Ribbon.dll",
L"System.Windows.Extensions.dll",
L"System.Windows.Forms.Design.dll",
L"System.Windows.Forms.Design.Editors.dll",
L"System.Windows.Forms.dll",
L"System.Windows.Forms.Primitives.dll",
L"System.Windows.Input.Manipulations.dll",
L"System.Windows.Presentation.dll",
L"System.Xaml.dll",
L"UIAutomationClient.dll",
L"UIAutomationClientSideProviders.dll",
L"UIAutomationProvider.dll",
L"UIAutomationTypes.dll",
L"vcruntime140_cor3.dll",
L"WindowsFormsIntegration.dll",
L"wpfgfx_cor3.dll"
};
#endif

View File

@@ -109,7 +109,6 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="DepsFilesLists.h" />
<ClInclude Include="RcResource.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="stdafx.h" />

View File

@@ -14,7 +14,6 @@
</ClInclude>
<ClInclude Include="resource.h" />
<ClInclude Include="RcResource.h" />
<ClInclude Include="DepsFilesLists.h" />
</ItemGroup>
<ItemGroup>
<None Include="CustomAction.def" />

View File

@@ -8,6 +8,7 @@ dotnet_diagnostic.CA1303.severity = suggestion
# CA1051: Do not declare visible instance fields
dotnet_code_quality.ca1051.exclude_structs = true
csharp_using_directive_placement = inside_namespace:warning
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent

View File

@@ -12,6 +12,7 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:PrefixLocalCallsWithThis", Justification = "We follow the C# Core Coding Style which avoids using `this` unless absolutely necessary.")]
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1200:UsingDirectivesMustBePlacedWithinNamespace", Justification = "We follow the C# Core Coding Style which puts using statements outside the namespace.")]
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:ElementsMustAppearInTheCorrectOrder", Justification = "It is not a priority and have hight impact in code changes.")]
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1202:ElementsMustBeOrderedByAccess", Justification = "It is not a priority and have hight impact in code changes.")]
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1203:ConstantsMustAppearBeforeFields", Justification = "It is not a priority and have hight impact in code changes.")]

View File

@@ -15,8 +15,7 @@
"newlineAtEndOfFile": "require"
},
"orderingRules": {
"usingDirectivesPlacement": "outsideNamespace",
"systemUsingDirectivesFirst": true
"usingDirectivesPlacement": "outsideNamespace"
}
}
}

View File

@@ -2,13 +2,13 @@
// 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.Collections.Generic;
using System.Drawing;
using System.Globalization;
namespace ManagedCommon
{
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
public static class ColorFormatHelper
{
/// <summary>
@@ -16,7 +16,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The cyan[0..1], magenta[0..1], yellow[0..1] and black key[0..1] of the converted color</returns>
public static (double Cyan, double Magenta, double Yellow, double BlackKey) ConvertToCMYKColor(Color color)
public static (double cyan, double magenta, double yellow, double blackKey) ConvertToCMYKColor(Color color)
{
// special case for black (avoid division by zero)
if (color.R == 0 && color.G == 0 && color.B == 0)
@@ -48,7 +48,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue [0°..360°], saturation [0..1] and brightness [0..1] of the converted color</returns>
public static (double Hue, double Saturation, double Brightness) ConvertToHSBColor(Color color)
public static (double hue, double saturation, double brightness) ConvertToHSBColor(Color color)
{
// HSB and HSV represents the same color space
return ConvertToHSVColor(color);
@@ -59,7 +59,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue [0°..360°], saturation [0..1] and value [0..1] of the converted color</returns>
public static (double Hue, double Saturation, double Value) ConvertToHSVColor(Color color)
public static (double hue, double saturation, double value) ConvertToHSVColor(Color color)
{
var min = Math.Min(Math.Min(color.R, color.G), color.B) / 255d;
var max = Math.Max(Math.Max(color.R, color.G), color.B) / 255d;
@@ -72,7 +72,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue [0°..360°], saturation [0..1] and intensity [0..1] of the converted color</returns>
public static (double Hue, double Saturation, double Intensity) ConvertToHSIColor(Color color)
public static (double hue, double saturation, double intensity) ConvertToHSIColor(Color color)
{
// special case for black
if (color.R == 0 && color.G == 0 && color.B == 0)
@@ -96,7 +96,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue [0°..360°], saturation [0..1] and lightness [0..1] values of the converted color</returns>
public static (double Hue, double Saturation, double Lightness) ConvertToHSLColor(Color color)
public static (double hue, double saturation, double lightness) ConvertToHSLColor(Color color)
{
var min = Math.Min(Math.Min(color.R, color.G), color.B) / 255d;
var max = Math.Max(Math.Max(color.R, color.G), color.B) / 255d;
@@ -120,7 +120,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue [0°..360°], whiteness [0..1] and blackness [0..1] of the converted color</returns>
public static (double Hue, double Whiteness, double Blackness) ConvertToHWBColor(Color color)
public static (double hue, double whiteness, double blackness) ConvertToHWBColor(Color color)
{
var min = Math.Min(Math.Min(color.R, color.G), color.B) / 255d;
var max = Math.Max(Math.Max(color.R, color.G), color.B) / 255d;
@@ -133,10 +133,10 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The lightness [0..100] and two chromaticities [-128..127]</returns>
public static (double Lightness, double ChromaticityA, double ChromaticityB) ConvertToCIELABColor(Color color)
public static (double lightness, double chromaticityA, double chromaticityB) ConvertToCIELABColor(Color color)
{
var xyz = ConvertToCIEXYZColor(color);
var lab = GetCIELABColorFromCIEXYZ(xyz.X, xyz.Y, xyz.Z);
var lab = GetCIELABColorFromCIEXYZ(xyz.x, xyz.y, xyz.z);
return lab;
}
@@ -150,7 +150,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The X [0..1], Y [0..1] and Z [0..1]</returns>
public static (double X, double Y, double Z) ConvertToCIEXYZColor(Color color)
public static (double x, double y, double z) ConvertToCIEXYZColor(Color color)
{
double r = color.R / 255d;
double g = color.G / 255d;
@@ -177,7 +177,7 @@ namespace ManagedCommon
/// <param name="y">The <see cref="y"/> represents the luminance</param>
/// <param name="z">The <see cref="z"/> is quasi-equal to blue (of CIE RGB)</param>
/// <returns>The lightness [0..100] and two chromaticities [-128..127]</returns>
private static (double Lightness, double ChromaticityA, double ChromaticityB)
private static (double lightness, double chromaticityA, double chromaticityB)
GetCIELABColorFromCIEXYZ(double x, double y, double z)
{
// sRGB reference white (x=0.3127, y=0.3290, Y=1.0), actually CIE Standard Illuminant D65 truncated to 4 decimal places,
@@ -215,7 +215,7 @@ namespace ManagedCommon
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The hue, whiteness [0..1] and blackness [0..1] of the converted color</returns>
public static (string Hue, double Whiteness, double Blackness) ConvertToNaturalColor(Color color)
public static (string hue, double whiteness, double blackness) ConvertToNaturalColor(Color color)
{
var min = Math.Min(Math.Min(color.R, color.G), color.B) / 255d;
var max = Math.Max(Math.Max(color.R, color.G), color.B) / 255d;
@@ -285,15 +285,10 @@ namespace ManagedCommon
{ "Xv", 'i' }, // X value int
{ "Yv", 'i' }, // Y value int
{ "Zv", 'i' }, // Z value int
{ "Dr", 'i' }, // Decimal value (RGB) int
{ "Dv", 'i' }, // Decimal value (BGR) int
// Removed Parameter Na, as the color name gets replaced separately, in localised way
// { "Na", 's' }, // Color name string
{ "Dv", 'i' }, // Decimal value int
{ "Na", 's' }, // Color name string
};
public static string GetColorNameParameter() => "%Na";
private static readonly Dictionary<char, string> FormatTypeToStringFormatters = new Dictionary<char, string>()
{
{ 'b', "b" }, // 0..255 byte
@@ -352,7 +347,7 @@ namespace ManagedCommon
formatString = string.Concat(formatString.AsSpan(0, formatterPosition), GetStringRepresentation(color.Value, paramFormat, paramType), formatString.AsSpan(formatterPosition + paramCount + 1));
}
// search for the next occurrence of the formatter char
// search for the next occurence of the formatter char
formatterPosition = formatString.IndexOf('%', formatterPosition + 1);
}
@@ -452,14 +447,10 @@ namespace ManagedCommon
var (_, _, z) = ConvertToCIEXYZColor(color);
z = Math.Round(z * 100, 4);
return z.ToString(CultureInfo.InvariantCulture);
case "Dr":
return ((color.R * 65536) + (color.G * 256) + color.B).ToString(CultureInfo.InvariantCulture);
case "Dv":
return (color.R + (color.G * 256) + (color.B * 65536)).ToString(CultureInfo.InvariantCulture);
// Removed Parameter Na, as the color name gets replaced separately, in localised way
// case "Na":
// return ColorNameHelper.GetColorName(color);
case "Na":
return ColorNameHelper.GetColorName(color);
default: return string.Empty;
}
}

View File

@@ -85,86 +85,86 @@ namespace ManagedCommon
// of that color, which are defined as follows:
private static string[] colorNamesLight =
{
"TEXT_COLOR_CORAL",
"TEXT_COLOR_ROSE",
"TEXT_COLOR_LIGHTORANGE",
"TEXT_COLOR_TAN",
"TEXT_COLOR_TAN",
"TEXT_COLOR_LIGHTYELLOW",
"TEXT_COLOR_LIGHTYELLOW",
"TEXT_COLOR_TAN",
"TEXT_COLOR_LIGHTGREEN",
"TEXT_COLOR_LIME",
"TEXT_COLOR_LIGHTGREEN",
"TEXT_COLOR_LIGHTGREEN",
"TEXT_COLOR_AQUA",
"TEXT_COLOR_SKYBLUE",
"TEXT_COLOR_LIGHTTURQUOISE",
"TEXT_COLOR_PALEBLUE",
"TEXT_COLOR_LIGHTBLUE",
"TEXT_COLOR_ICEBLUE",
"TEXT_COLOR_PERIWINKLE",
"TEXT_COLOR_LAVENDER",
"TEXT_COLOR_PINK",
"TEXT_COLOR_TAN",
"TEXT_COLOR_ROSE",
CommonResources.TEXT_COLOR_CORAL,
CommonResources.TEXT_COLOR_ROSE,
CommonResources.TEXT_COLOR_LIGHTORANGE,
CommonResources.TEXT_COLOR_TAN,
CommonResources.TEXT_COLOR_TAN,
CommonResources.TEXT_COLOR_LIGHTYELLOW,
CommonResources.TEXT_COLOR_LIGHTYELLOW,
CommonResources.TEXT_COLOR_TAN,
CommonResources.TEXT_COLOR_LIGHTGREEN,
CommonResources.TEXT_COLOR_LIME,
CommonResources.TEXT_COLOR_LIGHTGREEN,
CommonResources.TEXT_COLOR_LIGHTGREEN,
CommonResources.TEXT_COLOR_AQUA,
CommonResources.TEXT_COLOR_SKYBLUE,
CommonResources.TEXT_COLOR_LIGHTTURQUOISE,
CommonResources.TEXT_COLOR_PALEBLUE,
CommonResources.TEXT_COLOR_LIGHTBLUE,
CommonResources.TEXT_COLOR_ICEBLUE,
CommonResources.TEXT_COLOR_PERIWINKLE,
CommonResources.TEXT_COLOR_LAVENDER,
CommonResources.TEXT_COLOR_PINK,
CommonResources.TEXT_COLOR_TAN,
CommonResources.TEXT_COLOR_ROSE,
};
private static string[] colorNamesMid =
{
"TEXT_COLOR_CORAL",
"TEXT_COLOR_RED",
"TEXT_COLOR_ORANGE",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_TAN",
"TEXT_COLOR_GOLD",
"TEXT_COLOR_YELLOW",
"TEXT_COLOR_OLIVEGREEN",
"TEXT_COLOR_OLIVEGREEN",
"TEXT_COLOR_GREEN",
"TEXT_COLOR_GREEN",
"TEXT_COLOR_BRIGHTGREEN",
"TEXT_COLOR_TEAL",
"TEXT_COLOR_AQUA",
"TEXT_COLOR_TURQUOISE",
"TEXT_COLOR_PALEBLUE",
"TEXT_COLOR_BLUE",
"TEXT_COLOR_BLUEGRAY",
"TEXT_COLOR_INDIGO",
"TEXT_COLOR_PURPLE",
"TEXT_COLOR_PINK",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_RED",
CommonResources.TEXT_COLOR_CORAL,
CommonResources.TEXT_COLOR_RED,
CommonResources.TEXT_COLOR_ORANGE,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_TAN,
CommonResources.TEXT_COLOR_GOLD,
CommonResources.TEXT_COLOR_YELLOW,
CommonResources.TEXT_COLOR_OLIVEGREEN,
CommonResources.TEXT_COLOR_OLIVEGREEN,
CommonResources.TEXT_COLOR_GREEN,
CommonResources.TEXT_COLOR_GREEN,
CommonResources.TEXT_COLOR_BRIGHTGREEN,
CommonResources.TEXT_COLOR_TEAL,
CommonResources.TEXT_COLOR_AQUA,
CommonResources.TEXT_COLOR_TURQUOISE,
CommonResources.TEXT_COLOR_PALEBLUE,
CommonResources.TEXT_COLOR_BLUE,
CommonResources.TEXT_COLOR_BLUEGRAY,
CommonResources.TEXT_COLOR_INDIGO,
CommonResources.TEXT_COLOR_PURPLE,
CommonResources.TEXT_COLOR_PINK,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_RED,
};
private static string[] colorNamesDark =
{
"TEXT_COLOR_BROWN",
"TEXT_COLOR_DARKRED",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_DARKYELLOW",
"TEXT_COLOR_DARKYELLOW",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_DARKGREEN",
"TEXT_COLOR_DARKGREEN",
"TEXT_COLOR_DARKGREEN",
"TEXT_COLOR_DARKGREEN",
"TEXT_COLOR_DARKTEAL",
"TEXT_COLOR_DARKTEAL",
"TEXT_COLOR_DARKTEAL",
"TEXT_COLOR_DARKBLUE",
"TEXT_COLOR_DARKBLUE",
"TEXT_COLOR_BLUEGRAY",
"TEXT_COLOR_INDIGO",
"TEXT_COLOR_DARKPURPLE",
"TEXT_COLOR_PLUM",
"TEXT_COLOR_BROWN",
"TEXT_COLOR_DARKRED",
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_DARKRED,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_DARKYELLOW,
CommonResources.TEXT_COLOR_DARKYELLOW,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_DARKGREEN,
CommonResources.TEXT_COLOR_DARKGREEN,
CommonResources.TEXT_COLOR_DARKGREEN,
CommonResources.TEXT_COLOR_DARKGREEN,
CommonResources.TEXT_COLOR_DARKTEAL,
CommonResources.TEXT_COLOR_DARKTEAL,
CommonResources.TEXT_COLOR_DARKTEAL,
CommonResources.TEXT_COLOR_DARKBLUE,
CommonResources.TEXT_COLOR_DARKBLUE,
CommonResources.TEXT_COLOR_BLUEGRAY,
CommonResources.TEXT_COLOR_INDIGO,
CommonResources.TEXT_COLOR_DARKPURPLE,
CommonResources.TEXT_COLOR_PLUM,
CommonResources.TEXT_COLOR_BROWN,
CommonResources.TEXT_COLOR_DARKRED,
};
public static string GetColorNameIdentifier(Color color)
public static string GetColorName(Color color)
{
var (hue, sat, lum) = ColorFormatHelper.ConvertToHSLColor(color);
@@ -175,26 +175,26 @@ namespace ManagedCommon
// First, if we're in the achromatic state, return the appropriate achromatic color name.
if (lum > 240)
{
return "TEXT_COLOR_WHITE";
return CommonResources.TEXT_COLOR_WHITE;
}
else if (lum < 20)
{
return "TEXT_COLOR_BLACK";
return CommonResources.TEXT_COLOR_BLACK;
}
if (sat <= 20)
{
if (lum > 170)
{
return "TEXT_COLOR_LIGHTGRAY";
return CommonResources.TEXT_COLOR_LIGHTGRAY;
}
else if (lum > 100)
{
return "TEXT_COLOR_GRAY";
return CommonResources.TEXT_COLOR_GRAY;
}
else
{
return "TEXT_COLOR_DARKGRAY";
return CommonResources.TEXT_COLOR_DARKGRAY;
}
}

View File

@@ -59,5 +59,383 @@ namespace ManagedCommon {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Aqua.
/// </summary>
public static string TEXT_COLOR_AQUA {
get {
return ResourceManager.GetString("TEXT_COLOR_AQUA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Black.
/// </summary>
public static string TEXT_COLOR_BLACK {
get {
return ResourceManager.GetString("TEXT_COLOR_BLACK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Blue.
/// </summary>
public static string TEXT_COLOR_BLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_BLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Blue gray.
/// </summary>
public static string TEXT_COLOR_BLUEGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_BLUEGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bright green.
/// </summary>
public static string TEXT_COLOR_BRIGHTGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_BRIGHTGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Brown.
/// </summary>
public static string TEXT_COLOR_BROWN {
get {
return ResourceManager.GetString("TEXT_COLOR_BROWN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Coral.
/// </summary>
public static string TEXT_COLOR_CORAL {
get {
return ResourceManager.GetString("TEXT_COLOR_CORAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark blue.
/// </summary>
public static string TEXT_COLOR_DARKBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark gray.
/// </summary>
public static string TEXT_COLOR_DARKGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark green.
/// </summary>
public static string TEXT_COLOR_DARKGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark purple.
/// </summary>
public static string TEXT_COLOR_DARKPURPLE {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKPURPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark red.
/// </summary>
public static string TEXT_COLOR_DARKRED {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKRED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark teal.
/// </summary>
public static string TEXT_COLOR_DARKTEAL {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKTEAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark yellow.
/// </summary>
public static string TEXT_COLOR_DARKYELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKYELLOW", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gold.
/// </summary>
public static string TEXT_COLOR_GOLD {
get {
return ResourceManager.GetString("TEXT_COLOR_GOLD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gray.
/// </summary>
public static string TEXT_COLOR_GRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_GRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Green.
/// </summary>
public static string TEXT_COLOR_GREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_GREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ice blue.
/// </summary>
public static string TEXT_COLOR_ICEBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_ICEBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Indigo.
/// </summary>
public static string TEXT_COLOR_INDIGO {
get {
return ResourceManager.GetString("TEXT_COLOR_INDIGO", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lavender.
/// </summary>
public static string TEXT_COLOR_LAVENDER {
get {
return ResourceManager.GetString("TEXT_COLOR_LAVENDER", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light blue.
/// </summary>
public static string TEXT_COLOR_LIGHTBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light gray.
/// </summary>
public static string TEXT_COLOR_LIGHTGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light green.
/// </summary>
public static string TEXT_COLOR_LIGHTGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light orange.
/// </summary>
public static string TEXT_COLOR_LIGHTORANGE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTORANGE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light turquoise.
/// </summary>
public static string TEXT_COLOR_LIGHTTURQUOISE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTTURQUOISE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light yellow.
/// </summary>
public static string TEXT_COLOR_LIGHTYELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTYELLOW", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lime.
/// </summary>
public static string TEXT_COLOR_LIME {
get {
return ResourceManager.GetString("TEXT_COLOR_LIME", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Olive green.
/// </summary>
public static string TEXT_COLOR_OLIVEGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_OLIVEGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Orange.
/// </summary>
public static string TEXT_COLOR_ORANGE {
get {
return ResourceManager.GetString("TEXT_COLOR_ORANGE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pale blue.
/// </summary>
public static string TEXT_COLOR_PALEBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_PALEBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Periwinkle.
/// </summary>
public static string TEXT_COLOR_PERIWINKLE {
get {
return ResourceManager.GetString("TEXT_COLOR_PERIWINKLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pink.
/// </summary>
public static string TEXT_COLOR_PINK {
get {
return ResourceManager.GetString("TEXT_COLOR_PINK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Plum.
/// </summary>
public static string TEXT_COLOR_PLUM {
get {
return ResourceManager.GetString("TEXT_COLOR_PLUM", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Purple.
/// </summary>
public static string TEXT_COLOR_PURPLE {
get {
return ResourceManager.GetString("TEXT_COLOR_PURPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Red.
/// </summary>
public static string TEXT_COLOR_RED {
get {
return ResourceManager.GetString("TEXT_COLOR_RED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rose.
/// </summary>
public static string TEXT_COLOR_ROSE {
get {
return ResourceManager.GetString("TEXT_COLOR_ROSE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sky blue.
/// </summary>
public static string TEXT_COLOR_SKYBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_SKYBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tan.
/// </summary>
public static string TEXT_COLOR_TAN {
get {
return ResourceManager.GetString("TEXT_COLOR_TAN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Teal.
/// </summary>
public static string TEXT_COLOR_TEAL {
get {
return ResourceManager.GetString("TEXT_COLOR_TEAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Turquoise.
/// </summary>
public static string TEXT_COLOR_TURQUOISE {
get {
return ResourceManager.GetString("TEXT_COLOR_TURQUOISE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to White.
/// </summary>
public static string TEXT_COLOR_WHITE {
get {
return ResourceManager.GetString("TEXT_COLOR_WHITE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yellow.
/// </summary>
public static string TEXT_COLOR_YELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_YELLOW", resourceCulture);
}
}
}
}

View File

@@ -117,4 +117,172 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TEXT_COLOR_WHITE" xml:space="preserve">
<value>White</value>
<comment>White color</comment>
</data>
<data name="TEXT_COLOR_BLACK" xml:space="preserve">
<value>Black</value>
<comment>Black color</comment>
</data>
<data name="TEXT_COLOR_LIGHTGRAY" xml:space="preserve">
<value>Light gray</value>
<comment>Light gray color</comment>
</data>
<data name="TEXT_COLOR_GRAY" xml:space="preserve">
<value>Gray</value>
<comment>Gray color</comment>
</data>
<data name="TEXT_COLOR_DARKGRAY" xml:space="preserve">
<value>Dark gray</value>
<comment>Dark gray color</comment>
</data>
<data name="TEXT_COLOR_CORAL" xml:space="preserve">
<value>Coral</value>
<comment>Coral color</comment>
</data>
<data name="TEXT_COLOR_ROSE" xml:space="preserve">
<value>Rose</value>
<comment>Rose color</comment>
</data>
<data name="TEXT_COLOR_LIGHTORANGE" xml:space="preserve">
<value>Light orange</value>
<comment>Light orange color</comment>
</data>
<data name="TEXT_COLOR_TAN" xml:space="preserve">
<value>Tan</value>
<comment>Tan color</comment>
</data>
<data name="TEXT_COLOR_LIGHTYELLOW" xml:space="preserve">
<value>Light yellow</value>
<comment>Light yellow color</comment>
</data>
<data name="TEXT_COLOR_LIGHTGREEN" xml:space="preserve">
<value>Light green</value>
<comment>Light green color</comment>
</data>
<data name="TEXT_COLOR_LIME" xml:space="preserve">
<value>Lime</value>
<comment>Lime color</comment>
</data>
<data name="TEXT_COLOR_AQUA" xml:space="preserve">
<value>Aqua</value>
<comment>Aqua color</comment>
</data>
<data name="TEXT_COLOR_SKYBLUE" xml:space="preserve">
<value>Sky blue</value>
<comment>Sky blue color</comment>
</data>
<data name="TEXT_COLOR_LIGHTTURQUOISE" xml:space="preserve">
<value>Light turquoise</value>
<comment>Light turquoise color</comment>
</data>
<data name="TEXT_COLOR_PALEBLUE" xml:space="preserve">
<value>Pale blue</value>
<comment>Pale blue color</comment>
</data>
<data name="TEXT_COLOR_LIGHTBLUE" xml:space="preserve">
<value>Light blue</value>
<comment>Light blue color</comment>
</data>
<data name="TEXT_COLOR_ICEBLUE" xml:space="preserve">
<value>Ice blue</value>
<comment>Ice blue color</comment>
</data>
<data name="TEXT_COLOR_PERIWINKLE" xml:space="preserve">
<value>Periwinkle</value>
<comment>Periwinkle color</comment>
</data>
<data name="TEXT_COLOR_LAVENDER" xml:space="preserve">
<value>Lavender</value>
<comment>Lavender color</comment>
</data>
<data name="TEXT_COLOR_PINK" xml:space="preserve">
<value>Pink</value>
<comment>Pink color</comment>
</data>
<data name="TEXT_COLOR_RED" xml:space="preserve">
<value>Red</value>
<comment>Red color</comment>
</data>
<data name="TEXT_COLOR_ORANGE" xml:space="preserve">
<value>Orange</value>
<comment>Orange color</comment>
</data>
<data name="TEXT_COLOR_BROWN" xml:space="preserve">
<value>Brown</value>
<comment>Brown color</comment>
</data>
<data name="TEXT_COLOR_GOLD" xml:space="preserve">
<value>Gold</value>
<comment>Gold color</comment>
</data>
<data name="TEXT_COLOR_YELLOW" xml:space="preserve">
<value>Yellow</value>
<comment>Yellow color</comment>
</data>
<data name="TEXT_COLOR_OLIVEGREEN" xml:space="preserve">
<value>Olive green</value>
<comment>Olive green color</comment>
</data>
<data name="TEXT_COLOR_GREEN" xml:space="preserve">
<value>Green</value>
<comment>Green color</comment>
</data>
<data name="TEXT_COLOR_BRIGHTGREEN" xml:space="preserve">
<value>Bright green</value>
<comment>Rose color</comment>
</data>
<data name="TEXT_COLOR_TEAL" xml:space="preserve">
<value>Teal</value>
<comment>Teal color</comment>
</data>
<data name="TEXT_COLOR_TURQUOISE" xml:space="preserve">
<value>Turquoise</value>
<comment>Turquoise color</comment>
</data>
<data name="TEXT_COLOR_BLUE" xml:space="preserve">
<value>Blue</value>
<comment>Blue color</comment>
</data>
<data name="TEXT_COLOR_BLUEGRAY" xml:space="preserve">
<value>Blue gray</value>
<comment>Blue gray color</comment>
</data>
<data name="TEXT_COLOR_INDIGO" xml:space="preserve">
<value>Indigo</value>
<comment>Indigo color</comment>
</data>
<data name="TEXT_COLOR_PURPLE" xml:space="preserve">
<value>Purple</value>
<comment>Purple color</comment>
</data>
<data name="TEXT_COLOR_DARKRED" xml:space="preserve">
<value>Dark red</value>
<comment>Dark red color</comment>
</data>
<data name="TEXT_COLOR_DARKYELLOW" xml:space="preserve">
<value>Dark yellow</value>
<comment>Dark yellow color</comment>
</data>
<data name="TEXT_COLOR_DARKGREEN" xml:space="preserve">
<value>Dark green</value>
<comment>Dark green color</comment>
</data>
<data name="TEXT_COLOR_DARKTEAL" xml:space="preserve">
<value>Dark teal</value>
<comment>Dark teal color</comment>
</data>
<data name="TEXT_COLOR_DARKBLUE" xml:space="preserve">
<value>Dark blue</value>
<comment>Dark blue color</comment>
</data>
<data name="TEXT_COLOR_DARKPURPLE" xml:space="preserve">
<value>Dark purple</value>
<comment>Dark purple color</comment>
</data>
<data name="TEXT_COLOR_PLUM" xml:space="preserve">
<value>Plum</value>
<comment>Plum color</comment>
</data>
</root>

View File

@@ -2,17 +2,12 @@
#define HKEY_WINDOWS_THEME L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"
// disabling warning 4702 - unreachable code
// prevent the warning after the call off a infinite loop function
#pragma warning(push)
#pragma warning(disable : 4702)
DWORD WINAPI _checkTheme(LPVOID lpParam)
{
auto listener = (ThemeListener*)lpParam;
listener->CheckTheme();
return 0;
}
#pragma warning(pop)
void ThemeListener::AddChangedHandler(THEME_HANDLE handle)
{

View File

@@ -660,19 +660,19 @@ namespace UnitTestsCommonLib
TEST_METHOD (GetCodeFromJson)
{
HotkeyObject object = HotkeyObject::from_json(m_defaultHotkeyJson);
Assert::AreEqual(123U, object.get_code());
Assert::AreEqual(UINT(123), object.get_code());
}
TEST_METHOD (GetCodeFromJsonString)
{
HotkeyObject object = HotkeyObject::from_json_string(m_defaultHotkeyJson.Stringify());
Assert::AreEqual(123U, object.get_code());
Assert::AreEqual(UINT(123), object.get_code());
}
TEST_METHOD (GetCodeFromSettings)
{
HotkeyObject object = HotkeyObject::from_settings(true, true, true, true, 123);
Assert::AreEqual(123U, object.get_code());
Assert::AreEqual(UINT(123), object.get_code());
}
TEST_METHOD (GetWinPressedFromJson)

View File

@@ -12,11 +12,6 @@
#include <winrt/base.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
#pragma warning(push)
#pragma warning(disable : 26466)
#include "CppUnitTest.h"
#pragma warning(pop)
#endif //PCH_H

View File

@@ -66,6 +66,8 @@ namespace Microsoft.Interop.Tests
ClientPipe.Dispose();
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}

View File

@@ -47,9 +47,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
</ItemGroup>
<ItemGroup>

View File

@@ -203,28 +203,13 @@ public
return gcnew String(CommonSharedConstants::AWAKE_EXIT_EVENT);
}
static String^ ShowPeekEvent() {
return gcnew String(CommonSharedConstants::SHOW_PEEK_SHARED_EVENT);
}
static String ^ PowerAccentExitEvent() {
return gcnew String(CommonSharedConstants::POWERACCENT_EXIT_EVENT);
}
static String ^ GcodePreviewResizeEvent() {
return gcnew String(CommonSharedConstants::GCODE_PREVIEW_RESIZE_EVENT);
}
static String ^ DevFilesPreviewResizeEvent() {
return gcnew String(CommonSharedConstants::DEV_FILES_PREVIEW_RESIZE_EVENT);
}
static String ^ MarkdownPreviewResizeEvent() {
return gcnew String(CommonSharedConstants::MARKDOWN_PREVIEW_RESIZE_EVENT);
}
static String ^ PdfPreviewResizeEvent() {
return gcnew String(CommonSharedConstants::PDF_PREVIEW_RESIZE_EVENT);
}
static String ^ SvgPreviewResizeEvent() {
return gcnew String(CommonSharedConstants::SVG_PREVIEW_RESIZE_EVENT);
}
};
}

View File

@@ -44,20 +44,8 @@ namespace CommonSharedConstants
// Path to the event used by PowerOCR
const wchar_t SHOW_POWEROCR_SHARED_EVENT[] = L"Local\\PowerOCREvent-dc864e06-e1af-4ecc-9078-f98bee745e3a";
// Path to the event used by GcodePreviewHandler
const wchar_t GCODE_PREVIEW_RESIZE_EVENT[] = L"Local\\PowerToysGcodePreviewResizeEvent-6ff1f9bd-ccbd-4b24-a79f-40a34fb0317d";
// Path to the event used by DevFilesPreviewHandler
const wchar_t DEV_FILES_PREVIEW_RESIZE_EVENT[] = L"Local\\PowerToysDevFilesPreviewResizeEvent-5707a22c-2cac-4ea2-82f0-27c03ef0b5f3";
// Path to the event used by MarkdownPreviewHandler
const wchar_t MARKDOWN_PREVIEW_RESIZE_EVENT[] = L"Local\\PowerToysMarkdownPreviewResizeEvent-54c9ab69-11f3-49e9-a98f-53221cfef3ec";
// Path to the event used by MarkdownPreviewHandler
const wchar_t PDF_PREVIEW_RESIZE_EVENT[] = L"Local\\PowerToysPdfPreviewResizeEvent-5a2f162a-f728-45fe-8bda-ef3d5e434ce7";
// Path to the event used by MarkdownPreviewHandler
const wchar_t SVG_PREVIEW_RESIZE_EVENT[] = L"Local\\PowerToysSvgPreviewResizeEvent-0701a4fc-d5a1-4ee7-b885-f83982c62a0d";
// Path to the event used to show Peek
const wchar_t SHOW_PEEK_SHARED_EVENT[] = L"Local\\ShowPeekEvent";
// Max DWORD for key code to disable keys.
const DWORD VK_DISABLED = 0x100;

View File

@@ -58,24 +58,18 @@ bool Logger::wasLogFailedShown()
void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring_view logSettingsPath)
{
auto logLevel = getLogLevel(logSettingsPath);
bool newLoggerCreated = false;
try
{
logger = spdlog::get(loggerName);
if (logger == nullptr)
auto sink = make_shared<daily_file_sink_mt>(logFilePath, 0, 0, false, LogSettings::retention);
if (IsDebuggerPresent())
{
auto sink = make_shared<daily_file_sink_mt>(logFilePath, 0, 0, false, LogSettings::retention);
if (IsDebuggerPresent())
{
auto msvc_sink = make_shared<msvc_sink_mt>();
msvc_sink->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [%n] [t-%t] [%l] %v");
logger = make_shared<spdlog::logger>(loggerName, sinks_init_list{ sink, msvc_sink });
}
else
{
logger = make_shared<spdlog::logger>(loggerName, sink);
}
newLoggerCreated = true;
auto msvc_sink = make_shared<msvc_sink_mt>();
msvc_sink->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [%n] [t-%t] [%l] %v");
logger = make_shared<spdlog::logger>(loggerName, sinks_init_list{ sink, msvc_sink });
}
else
{
logger = make_shared<spdlog::logger>(loggerName, sink);
}
}
catch (...)
@@ -95,14 +89,10 @@ void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring
return;
}
if (newLoggerCreated)
{
logger->set_level(logLevel);
logger->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [p-%P] [t-%t] [%l] %v");
logger->flush_on(logLevel); // Auto flush on every log message.
spdlog::register_logger(logger);
}
logger->set_level(logLevel);
logger->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [p-%P] [t-%t] [%l] %v");
spdlog::register_logger(logger);
spdlog::flush_every(std::chrono::seconds(3));
logger->info("{} logger is initialized", loggerName);
}

View File

@@ -15,24 +15,6 @@ struct LogSettings
inline const static std::wstring updateLogPath = L"UpdateLogs\\update-log.txt";
inline const static std::string fileExplorerLoggerName = "FileExplorer";
inline const static std::wstring fileExplorerLogPath = L"Logs\\file-explorer-log.txt";
inline const static std::string gcodePrevLoggerName = "GcodePrevHandler";
inline const static std::wstring gcodePrevLogPath = L"logs\\FileExplorer_localLow\\GcodePreviewHandler\\gcode-prev-handler-log.txt";
inline const static std::string gcodeThumbLoggerName = "GcodeThumbnailProvider";
inline const static std::wstring gcodeThumbLogPath = L"logs\\FileExplorer_localLow\\GcodeThumbnailProvider\\gcode-thumbnail-provider-log.txt";
inline const static std::string mdPrevLoggerName = "MDPrevHandler";
inline const static std::wstring mdPrevLogPath = L"logs\\FileExplorer_localLow\\MDPrevHandler\\md-prev-handler-log.txt";
inline const static std::string monacoPrevLoggerName = "MonacoPrevHandler";
inline const static std::wstring monacoPrevLogPath = L"logs\\FileExplorer_localLow\\MonacoPrevHandler\\monaco-prev-handler-log.txt";
inline const static std::string pdfPrevLoggerName = "PdfPrevHandler";
inline const static std::wstring pdfPrevLogPath = L"logs\\FileExplorer_localLow\\PdfPrevHandler\\pdf-prev-handler-log.txt";
inline const static std::string pdfThumbLoggerName = "PdfThumbnailProvider";
inline const static std::wstring pdfThumbLogPath = L"logs\\FileExplorer_localLow\\PdfThumbnailProvider\\pdf-thumbnail-provider-log.txt";
inline const static std::string stlThumbLoggerName = "StlThumbnailProvider";
inline const static std::wstring stlThumbLogPath = L"logs\\FileExplorer_localLow\\StlThumbnailProvider\\stl-thumbnail-provider-log.txt";
inline const static std::string svgPrevLoggerName = "SvgPrevHandler";
inline const static std::wstring svgPrevLogPath = L"logs\\FileExplorer_localLow\\SvgPrevHandler\\svg-prev-handler-log.txt";
inline const static std::string svgThumbLoggerName = "SvgThumbnailProvider";
inline const static std::wstring svgThumbLogPath = L"logs\\FileExplorer_localLow\\SvgThumbnailProvider\\svg-thumbnail-provider-log.txt";
inline const static std::string launcherLoggerName = "launcher";
inline const static std::wstring launcherLogPath = L"LogsModuleInterface\\launcher-log.txt";
inline const static std::wstring awakeLogPath = L"Logs\\awake-log.txt";

View File

@@ -67,10 +67,6 @@ namespace updating
throw std::runtime_error("Release object doesn't have the required asset");
}
// disabling warning 4702 - unreachable code
// prevent the warning that may show up depend on the value of the constants (#defines)
#pragma warning(push)
#pragma warning(disable : 4702)
std::future<nonstd::expected<github_version_info, std::wstring>> get_github_version_info_async(const bool prerelease)
{
// If the current version starts with 0.0.*, it means we're on a local build from a farm and shouldn't check for updates.
@@ -130,7 +126,6 @@ namespace updating
}
co_return nonstd::make_unexpected(NETWORK_ERROR);
}
#pragma warning(pop)
std::filesystem::path get_pending_updates_path()
{

View File

@@ -34,7 +34,7 @@ namespace
{
CComPtr<IShellWindows> spShellWindows;
auto result = spShellWindows.CoCreateInstance(CLSID_ShellWindows);
if (result != S_OK || spShellWindows == nullptr)
if (result != S_OK)
{
Logger::warn(L"Failed to create instance. {}", GetErrorString(result));
return false;
@@ -47,7 +47,7 @@ namespace
result = spShellWindows->FindWindowSW(
&vtLoc, &vtEmpty, SWC_DESKTOP, &lhwnd, SWFO_NEEDDISPATCH, &spdisp);
if (result != S_OK || spdisp == nullptr)
if (result != S_OK)
{
Logger::warn(L"Failed to find the window. {}", GetErrorString(result));
return false;
@@ -56,7 +56,7 @@ namespace
CComPtr<IShellBrowser> spBrowser;
result = CComQIPtr<IServiceProvider>(spdisp)->QueryService(SID_STopLevelBrowser,
IID_PPV_ARGS(&spBrowser));
if (result != S_OK || spBrowser == nullptr)
if (result != S_OK)
{
Logger::warn(L"Failed to query service. {}", GetErrorString(result));
return false;
@@ -64,14 +64,14 @@ namespace
CComPtr<IShellView> spView;
result = spBrowser->QueryActiveShellView(&spView);
if (result != S_OK || spView == nullptr)
if (result != S_OK)
{
Logger::warn(L"Failed to query active shell window. {}", GetErrorString(result));
return false;
}
result = spView->QueryInterface(riid, ppv);
if (result != S_OK || ppv == nullptr || *ppv == nullptr )
if (result != S_OK)
{
Logger::warn(L"Failed to query interface. {}", GetErrorString(result));
return false;

View File

@@ -28,12 +28,13 @@ inline registry::ChangeSet getSvgPreviewHandlerChangeSet(const std::wstring inst
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::preview,
perUser,
L"{FCDD4EED-41AA-492F-8A84-31A1546226E0}",
L"{ddee2b8a-6807-48a6-bb20-2338174ff779}",
get_std_product_version(),
(fs::path{ installationDir } /
LR"d(modules\FileExplorerPreview\PowerToys.SvgPreviewHandlerCpp.dll)d")
LR"d(modules\FileExplorerPreview\PowerToys.SvgPreviewHandler.comhost.dll)d")
.wstring(),
L"SvgPreviewHandler",
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.PreviewHandler.Svg.SvgPreviewHandler",
L"Svg Preview Handler",
NonLocalizable::ExtSVG);
}
@@ -43,10 +44,11 @@ inline registry::ChangeSet getMdPreviewHandlerChangeSet(const std::wstring insta
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::preview,
perUser,
L"{60789D87-9C3C-44AF-B18C-3DE2C2820ED3}",
L"{45769bcc-e8fd-42d0-947e-02beef77a1f5}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.MarkdownPreviewHandlerCpp.dll)d").wstring(),
L"MarkdownPreviewHandler",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.MarkdownPreviewHandler.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.PreviewHandler.Markdown.MarkdownPreviewHandler",
L"Markdown Preview Handler",
NonLocalizable::ExtMarkdown);
}
@@ -105,10 +107,11 @@ inline registry::ChangeSet getMonacoPreviewHandlerChangeSet(const std::wstring i
return generatePreviewHandler(PreviewHandlerType::preview,
perUser,
L"{D8034CFA-F34B-41FE-AD45-62FCBB52A6DA}",
L"{afbd5a44-2520-4ae0-9224-6cfce8fe4400}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.MonacoPreviewHandlerCpp.dll)d").wstring(),
L"MonacoPreviewHandler",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.PreviewHandler.Monaco.MonacoPreviewHandler",
L"Monaco Preview Handler",
extensions);
}
@@ -118,10 +121,11 @@ inline registry::ChangeSet getPdfPreviewHandlerChangeSet(const std::wstring inst
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::preview,
perUser,
L"{A5A41CC7-02CB-41D4-8C9B-9087040D6098}",
L"{07665729-6243-4746-95b7-79579308d1b2}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.PdfPreviewHandlerCpp.dll)d").wstring(),
L"PdfPreviewHandler",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.PdfPreviewHandler.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.PreviewHandler.Pdf.PdfPreviewHandler",
L"Pdf Preview Handler",
NonLocalizable::ExtPDF);
}
@@ -131,10 +135,11 @@ inline registry::ChangeSet getGcodePreviewHandlerChangeSet(const std::wstring in
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::preview,
perUser,
L"{A0257634-8812-4CE8-AF11-FA69ACAEAFAE}",
L"{ec52dea8-7c9f-4130-a77b-1737d0418507}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.GcodePreviewHandlerCpp.dll)d").wstring(),
L"GcodePreviewHandler",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.GcodePreviewHandler.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.PreviewHandler.Gcode.GcodePreviewHandler",
L"G-code Preview Handler",
NonLocalizable::ExtGCode);
}
@@ -144,10 +149,11 @@ inline registry::ChangeSet getSvgThumbnailHandlerChangeSet(const std::wstring in
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::thumbnail,
perUser,
L"{10144713-1526-46C9-88DA-1FB52807A9FF}",
L"{36B27788-A8BB-4698-A756-DF9F11F64F84}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.SvgThumbnailProviderCpp.dll)d").wstring(),
L"SvgThumbnailProvider",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.SvgThumbnailProvider.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.ThumbnailHandler.Svg.SvgThumbnailProvider",
L"Svg Thumbnail Provider",
NonLocalizable::ExtSVG,
L"Picture");
@@ -158,10 +164,11 @@ inline registry::ChangeSet getPdfThumbnailHandlerChangeSet(const std::wstring in
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::thumbnail,
perUser,
L"{D8BB9942-93BD-412D-87E4-33FAB214DC1A}",
L"{BCC13D15-9720-4CC4-8371-EA74A274741E}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.PdfThumbnailProviderCpp.dll)d").wstring(),
L"PdfThumbnailProvider",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.PdfThumbnailProvider.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.ThumbnailHandler.Pdf.PdfThumbnailProvider",
L"Pdf Thumbnail Provider",
NonLocalizable::ExtPDF);
}
@@ -171,10 +178,11 @@ inline registry::ChangeSet getGcodeThumbnailHandlerChangeSet(const std::wstring
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::thumbnail,
perUser,
L"{F2847CBE-CD03-4C83-A359-1A8052C1B9D5}",
L"{BFEE99B4-B74D-4348-BCA5-E757029647FF}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.GcodeThumbnailProviderCpp.dll)d").wstring(),
L"GcodeThumbnailProvider",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.GcodeThumbnailProvider.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.ThumbnailHandler.Gcode.GcodeThumbnailProvider",
L"G-code Thumbnail Provider",
NonLocalizable::ExtGCode);
}
@@ -184,10 +192,11 @@ inline registry::ChangeSet getStlThumbnailHandlerChangeSet(const std::wstring in
using namespace registry::shellex;
return generatePreviewHandler(PreviewHandlerType::thumbnail,
perUser,
L"{77257004-6F25-4521-B602-50ECC6EC62A6}",
L"{8BC8AFC2-4E7C-4695-818E-8C1FFDCEA2AF}",
get_std_product_version(),
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.StlThumbnailProviderCpp.dll)d").wstring(),
L"StlThumbnailProvider",
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.StlThumbnailProvider.comhost.dll)d").wstring(),
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
L"Microsoft.PowerToys.ThumbnailHandler.Stl.StlThumbnailProvider",
L"Stl Thumbnail Provider",
NonLocalizable::ExtSTL);
}

View File

@@ -315,10 +315,11 @@ namespace registry
std::wstring handlerClsid,
std::wstring powertoysVersion,
std::wstring fullPathToHandler,
std::wstring handlerCategory,
std::wstring className,
std::wstring displayName,
std::vector<std::wstring> fileTypes,
std::wstring fileKindType = L"")
std::wstring fileKindType = L"" )
{
const HKEY scope = perUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
@@ -330,6 +331,9 @@ namespace registry
inprocServerPath += L'\\';
inprocServerPath += L"InprocServer32";
std::wstring implementedCategoriesPath = clsidPath + LR"d(\Implemented Categories\)d";
implementedCategoriesPath += handlerCategory;
std::wstring assemblyKeyValue;
if (const auto lastDotPos = className.rfind(L'.'); lastDotPos != std::wstring::npos)
{
@@ -352,10 +356,13 @@ namespace registry
// TODO: verify that we actually need all of those
vec_t changes = { { scope, clsidPath, L"DisplayName", displayName },
{ scope, clsidPath, std::nullopt, className },
{ scope, implementedCategoriesPath, std::nullopt, L"" },
{ scope, inprocServerPath, std::nullopt, fullPathToHandler },
{ scope, inprocServerPath, L"Assembly", assemblyKeyValue },
{ scope, inprocServerPath, L"Class", className },
{ scope, inprocServerPath, L"ThreadingModel", L"Apartment" } };
{ scope, inprocServerPath, L"ThreadingModel", L"Both" },
{ scope, versionPath, L"Assembly", assemblyKeyValue },
{ scope, versionPath, L"Class", className } };
for (const auto& fileType : fileTypes)
{

View File

@@ -1,8 +1,6 @@
#include "pch.h"
#include "NtdllExtensions.h"
#include <thread>
#include <atomic>
#define STATUS_INFO_LENGTH_MISMATCH ((LONG)0xC0000004)
@@ -167,116 +165,66 @@ std::vector<NtdllExtensions::HandleInfo> NtdllExtensions::handles() noexcept
std::vector<BYTE> object_info_buffer(DefaultResultBufferSize);
std::atomic<ULONG> i = 0;
std::atomic<ULONG> handle_count = info_ptr->HandleCount;
std::atomic<HANDLE> process_handle = NULL;
std::atomic<HANDLE> handle_copy = NULL;
ULONG previous_i;
while (i < handle_count)
for (ULONG i = 0; i < info_ptr->HandleCount; i++)
{
previous_i = i;
auto handle_info = info_ptr->Handles + i;
DWORD pid = handle_info->ProcessId;
// The system calls we use in this block were reported to hang on some machines.
// We need to offload the cycle to another thread and keep track of progress to terminate and resume when needed.
// Unfortunately, there are no alternative APIs to what we're using that accept timeouts. (NtQueryObject and GetFileType)
auto offload_function = std::thread([&] {
for (; i < handle_count; i++)
{
process_handle = NULL;
handle_copy = NULL;
auto handle_info = info_ptr->Handles + i;
DWORD pid = handle_info->ProcessId;
auto iter = pid_to_handle.find(pid);
if (iter != pid_to_handle.end())
{
process_handle = iter->second;
}
else
{
process_handle = OpenProcess(PROCESS_DUP_HANDLE, FALSE, pid);
if (!process_handle)
{
continue;
}
pid_to_handle[pid] = process_handle;
}
// According to this:
// https://stackoverflow.com/questions/46384048/enumerate-handles
// NtQueryObject could hang
// TODO uncomment and investigate
// if (handle_info->GrantedAccess == 0x0012019f) {
// continue;
// }
HANDLE local_handle_copy;
auto dh_result = DuplicateHandle(process_handle, (HANDLE)handle_info->Handle, GetCurrentProcess(), &local_handle_copy, 0, 0, DUPLICATE_SAME_ACCESS);
if (dh_result == 0)
{
// Ignore this handle.
continue;
}
handle_copy = local_handle_copy;
ULONG return_length;
auto status = NtQueryObject(handle_copy, ObjectTypeInformation, object_info_buffer.data(), (ULONG)object_info_buffer.size(), &return_length);
if (NT_ERROR(status))
{
// Ignore this handle.
CloseHandle(handle_copy);
handle_copy = NULL;
continue;
}
auto object_type_info = (OBJECT_TYPE_INFORMATION*)object_info_buffer.data();
auto type_name = unicode_to_str(object_type_info->Name);
std::wstring file_name;
if (type_name == L"File")
{
file_name = file_handle_to_kernel_name(handle_copy, object_info_buffer);
result.push_back(HandleInfo{ pid, handle_info->Handle, type_name, file_name });
}
CloseHandle(handle_copy);
handle_copy = NULL;
}
});
offload_function.detach();
do
HANDLE process_handle = NULL;
auto iter = pid_to_handle.find(pid);
if (iter != pid_to_handle.end())
{
Sleep(200); // Timeout in milliseconds for detecting that the system hang on getting information for a handle.
if (i >= handle_count)
process_handle = iter->second;
}
else
{
process_handle = OpenProcess(PROCESS_DUP_HANDLE, FALSE, pid);
if (!process_handle)
{
// We're done.
break;
continue;
}
pid_to_handle[pid] = process_handle;
}
if (previous_i >= i)
{
// The thread looks like it's hanging on some handle. Let's kill it and resume.
// According to this:
// https://stackoverflow.com/questions/46384048/enumerate-handles
// NtQueryObject could hang
// HACK: This is unsafe and may leak something, but looks like there's no way to properly clean up a thread when it's hanging on a system call.
TerminateThread(offload_function.native_handle(), 1);
// TODO uncomment and investigate
// if (handle_info->GrantedAccess == 0x0012019f) {
// continue;
// }
// Close Handles that might be lingering.
if (handle_copy!=NULL)
{
CloseHandle(handle_copy);
}
i++;
break;
}
previous_i = i;
} while (1);
HANDLE handle_copy;
auto dh_result = DuplicateHandle(process_handle, (HANDLE)handle_info->Handle, GetCurrentProcess(), &handle_copy, 0, 0, DUPLICATE_SAME_ACCESS);
if (dh_result == 0)
{
// Ignore this handle.
continue;
}
ULONG return_length;
auto status = NtQueryObject(handle_copy, ObjectTypeInformation, object_info_buffer.data(), (ULONG)object_info_buffer.size(), &return_length);
if (NT_ERROR(status))
{
// Ignore this handle.
CloseHandle(handle_copy);
continue;
}
auto object_type_info = (OBJECT_TYPE_INFORMATION*)object_info_buffer.data();
auto type_name = unicode_to_str(object_type_info->Name);
std::wstring file_name = file_handle_to_kernel_name(handle_copy, object_info_buffer);
if (type_name == L"File")
{
file_name = file_handle_to_kernel_name(handle_copy, object_info_buffer);
}
result.push_back(HandleInfo{ pid, handle_info->Handle, type_name, file_name });
CloseHandle(handle_copy);
}
for (auto [pid, handle] : pid_to_handle)

View File

@@ -27,7 +27,7 @@ private:
public:
struct ProcessInfo
{
DWORD pid = 0;
DWORD pid;
std::wstring name;
std::wstring user;
std::vector<std::wstring> modules;

View File

@@ -35,7 +35,6 @@ namespace FileLocksmith::Interop
std::wstring paths_file()
{
#pragma warning(suppress : 4691) // Weird warning about System::String from referenced library not being the one expected (?!)
std::wstring path = from_system_string(interop::Constants::AppDataPath());
path += L"\\";
path += constants::nonlocalizable::PowerToyName;
@@ -103,7 +102,7 @@ namespace FileLocksmith::Interop
while (!finished)
{
WCHAR ch{};
WCHAR ch;
// We have to read data like this
if (!stream.read(reinterpret_cast<char*>(&ch), 2))
{
@@ -158,7 +157,7 @@ namespace FileLocksmith::Interop
auto exec_path = executable_path();
SHELLEXECUTEINFOW exec_info{};
SHELLEXECUTEINFOW exec_info;
exec_info.cbSize = sizeof(exec_info);
exec_info.fMask = SEE_MASK_NOCLOSEPROCESS;
exec_info.hwnd = NULL;
@@ -182,7 +181,7 @@ namespace FileLocksmith::Interop
static System::Boolean SetDebugPrivilege()
{
HANDLE hToken;
TOKEN_PRIVILEGES tp{};
TOKEN_PRIVILEGES tp;
LUID luid;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken) != 0)
@@ -231,7 +230,7 @@ namespace FileLocksmith::Interop
bool elevated = false;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
TOKEN_ELEVATION elevation{};
TOKEN_ELEVATION elevation;
DWORD size;
if (GetTokenInformation(token, TokenElevation, &elevation, sizeof(elevation), &size))
{

View File

@@ -20,8 +20,6 @@
<SolidColorBrush x:Key="SubtleButtonForegroundPressed" Color="{ThemeResource TextFillColorSecondary}" />
<SolidColorBrush x:Key="SubtleButtonForegroundDisabled" Color="{ThemeResource TextFillColorDisabled}" />
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">Transparent</SolidColorBrush>
<Style x:Key="SubtleButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{ThemeResource SubtleButtonBackground}" />

View File

@@ -2,12 +2,12 @@
// 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 FileLocksmith.Interop;
using Microsoft.UI.Xaml.Data;
namespace PowerToys.FileLocksmithUI.Converters
{
using System;
using FileLocksmith.Interop;
using Microsoft.UI.Xaml.Data;
public sealed class FileCountConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)

View File

@@ -2,13 +2,13 @@
// 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.IO;
using FileLocksmith.Interop;
using Microsoft.UI.Xaml.Data;
namespace PowerToys.FileLocksmithUI.Converters
{
using System;
using System.IO;
using FileLocksmith.Interop;
using Microsoft.UI.Xaml.Data;
public sealed class FileListToDescriptionConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)

View File

@@ -2,16 +2,16 @@
// 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.Drawing;
using System.IO;
using CommunityToolkit.WinUI.UI;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media.Imaging;
using Windows.Storage;
namespace PowerToys.FileLocksmithUI.Converters
{
using System;
using System.Drawing;
using System.IO;
using CommunityToolkit.WinUI.UI;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media.Imaging;
using Windows.Storage;
public sealed class PidToIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)

View File

@@ -2,14 +2,14 @@
// 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.Globalization;
using FileLocksmith.Interop;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
namespace PowerToys.FileLocksmithUI.Converters
{
using System;
using System.Globalization;
using FileLocksmith.Interop;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
public sealed class UserToSystemWarningVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)

View File

@@ -21,15 +21,6 @@
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<ApplicationIcon>Assets/Icon.ico</ApplicationIcon>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
@@ -66,9 +57,9 @@
<PackageReference Include="CommunityToolkit.Labs.WinUI.SettingsControls" Version="0.0.7" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.WinUI.UI" Version="7.1.2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<Manifest Include="$(ApplicationManifest)" />

View File

@@ -3,7 +3,10 @@
// See the LICENSE file in the project root for more information.
using System;
using ManagedCommon;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using WinUIEx;
namespace FileLocksmithUI
@@ -19,8 +22,24 @@ namespace FileLocksmithUI
private void SetTitleBar()
{
ExtendsContentIntoTitleBar = true;
SetTitleBar(titleBar);
if (AppWindowTitleBar.IsCustomizationSupported())
{
AppWindow window = this.GetAppWindow();
window.TitleBar.ExtendsContentIntoTitleBar = true;
window.TitleBar.ButtonBackgroundColor = Colors.Transparent;
SetTitleBar(titleBar);
}
else
{
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
ThemeHelpers.SetImmersiveDarkMode(hWnd, ThemeHelpers.GetAppTheme() == AppTheme.Dark);
titleBar.Visibility = Visibility.Collapsed;
// Set window icon
WindowId windowId = Win32Interop.GetWindowIdFromWindow(hWnd);
AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
appWindow.SetIcon("Assets/Icon.ico");
}
}
public void Dispose()

View File

@@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)\modules\FileLocksmith</PublishDir>
<RuntimeIdentifier>win10-$(Platform)</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<SelfContained>false</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

View File

@@ -2,20 +2,23 @@
// 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.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using FileLocksmith.Interop;
using global::FileLocksmithUI.Helpers;
namespace PowerToys.FileLocksmithUI.ViewModels
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using FileLocksmith.Interop;
using global::FileLocksmithUI;
using global::FileLocksmithUI.Helpers;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml.Controls;
#pragma warning disable CA1708 // Identifiers should differ by more than case
public partial class MainViewModel : ObservableObject, IDisposable
#pragma warning restore CA1708 // Identifiers should differ by more than case
@@ -28,7 +31,7 @@ namespace PowerToys.FileLocksmithUI.ViewModels
private bool _disposed;
private CancellationTokenSource _cancelProcessWatching;
public ObservableCollection<ProcessResult> Processes { get; } = new();
public ObservableCollection<ProcessResult> Processes { get; } = new ();
public bool IsLoading
{

View File

@@ -2,12 +2,12 @@
// 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 Microsoft.UI.Xaml.Controls;
using PowerToys.FileLocksmithUI.ViewModels;
namespace PowerToys.FileLocksmithUI.Views
{
using System;
using Microsoft.UI.Xaml.Controls;
using PowerToys.FileLocksmithUI.ViewModels;
public sealed partial class MainPage : Page
{
public MainViewModel ViewModel { get; private set; }

View File

@@ -15,10 +15,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Moq" Version="4.18.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.2.3" />
</ItemGroup>

View File

@@ -21,8 +21,6 @@
<SolidColorBrush x:Key="SubtleButtonForegroundPressed" Color="{ThemeResource TextFillColorSecondary}" />
<SolidColorBrush x:Key="SubtleButtonForegroundDisabled" Color="{ThemeResource TextFillColorDisabled}" />
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">Transparent</SolidColorBrush>
<Style x:Key="SubtleButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{ThemeResource SubtleButtonBackground}" />
@@ -42,20 +40,20 @@
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter
x:Name="ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AnimatedIcon.State="Normal"
AutomationProperties.AccessibilityView="Raw"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
CornerRadius="{TemplateBinding CornerRadius}">
x:Name="ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AnimatedIcon.State="Normal"
AutomationProperties.AccessibilityView="Raw"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
CornerRadius="{TemplateBinding CornerRadius}">
<ContentPresenter.BackgroundTransition>
<BrushTransition Duration="0:0:0.083" />
</ContentPresenter.BackgroundTransition>

View File

@@ -2,11 +2,11 @@
// 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.InteropServices;
namespace Hosts.Helpers
{
using System;
using System.Runtime.InteropServices;
internal class NativeMethods
{
[DllImport("user32.dll", SetLastError = true)]

View File

@@ -20,15 +20,6 @@
<AssemblyName>PowerToys.Hosts</AssemblyName>
<DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
<ApplicationIcon>Assets/Hosts.ico</ApplicationIcon>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
</PropertyGroup>
<!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->
@@ -50,8 +41,8 @@
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" />
<PackageReference Include="WinUIEx" Version="1.8.0" />

View File

@@ -3,7 +3,10 @@
// See the LICENSE file in the project root for more information.
using Hosts.Helpers;
using ManagedCommon;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using WinUIEx;
namespace Hosts
@@ -14,14 +17,34 @@ namespace Hosts
{
InitializeComponent();
SetTitleBar();
if (AppWindowTitleBar.IsCustomizationSupported())
{
SetTitleBar();
}
else
{
titleBar.Visibility = Visibility.Collapsed;
// Set window icon
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
WindowId windowId = Win32Interop.GetWindowIdFromWindow(hWnd);
AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
appWindow.SetIcon("Assets/Hosts.ico");
if (ThemeHelpers.GetAppTheme() == AppTheme.Dark)
{
ThemeHelpers.SetImmersiveDarkMode(hWnd, true);
}
}
BringToForeground();
}
private void SetTitleBar()
{
ExtendsContentIntoTitleBar = true;
AppWindow window = this.GetAppWindow();
window.TitleBar.ExtendsContentIntoTitleBar = true;
window.TitleBar.ButtonBackgroundColor = Colors.Transparent;
SetTitleBar(titleBar);
}

View File

@@ -35,7 +35,6 @@ namespace Hosts.Models
{
SetProperty(ref _hosts, value);
OnPropertyChanged(nameof(Valid));
SplittedHosts = _hosts.Split(' ');
}
}
@@ -51,13 +50,8 @@ namespace Hosts.Models
[ObservableProperty]
private bool _pinging;
[ObservableProperty]
private bool _duplicate;
public bool Valid => ValidationHelper.ValidHosts(_hosts) && (ValidationHelper.ValidIPv4(_address) || ValidationHelper.ValidIPv6(_address));
public string[] SplittedHosts { get; private set; }
public Entry()
{
}

View File

@@ -184,9 +184,6 @@
<data name="DeleteDialogAreYouSure.Text" xml:space="preserve">
<value>Are you sure you want to delete this entry?</value>
</data>
<data name="DuplicateEntryIcon.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Duplicate entry</value>
</data>
<data name="Entries.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Entries</value>
</data>
@@ -237,10 +234,6 @@
<value>Ping</value>
<comment>"Ping" refers to the command-line utility, do not loc</comment>
</data>
<data name="PingIcon.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Ping response</value>
<comment>"Ping" refers to the command-line utility, do not loc</comment>
</data>
<data name="Reload.Content" xml:space="preserve">
<value>Reload</value>
</data>
@@ -250,9 +243,6 @@
<data name="SettingsBtn.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Settings</value>
</data>
<data name="ShowOnlyDuplicates.Header" xml:space="preserve">
<value>Show only duplicates</value>
</data>
<data name="UpdateBtn" xml:space="preserve">
<value>Update</value>
</data>

View File

@@ -1,9 +1,8 @@
// Copyright (c) Microsoft Corporation
// 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.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
@@ -14,6 +13,7 @@ using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.WinUI;
using Hosts.Helpers;
using Hosts.Models;
using Hosts.Settings;
using Microsoft.UI.Dispatching;
namespace Hosts.ViewModels
@@ -21,6 +21,7 @@ namespace Hosts.ViewModels
public partial class MainViewModel : ObservableObject, IDisposable
{
private readonly IHostsService _hostsService;
private readonly IUserSettings _userSettings;
private readonly DispatcherQueue _dispatcherQueue = DispatcherQueue.GetForCurrentThread();
private bool _disposed;
@@ -33,9 +34,6 @@ namespace Hosts.ViewModels
[ObservableProperty]
private bool _fileChanged;
[ObservableProperty]
private bool _filtered;
[ObservableProperty]
private string _addressFilter;
@@ -46,15 +44,50 @@ namespace Hosts.ViewModels
private string _commentFilter;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(Entries))]
private bool _showOnlyDuplicates;
private bool _filtered;
[ObservableProperty]
private string _additionalLines;
private ObservableCollection<Entry> _entries;
public ObservableCollection<Entry> Entries => _filtered || _showOnlyDuplicates ? GetFilteredEntries() : _entries;
public ObservableCollection<Entry> Entries
{
get
{
if (_filtered)
{
var filter = _entries.AsEnumerable();
if (!string.IsNullOrWhiteSpace(_addressFilter))
{
filter = filter.Where(e => e.Address.Contains(_addressFilter, StringComparison.OrdinalIgnoreCase));
}
if (!string.IsNullOrWhiteSpace(_hostsFilter))
{
filter = filter.Where(e => e.Hosts.Contains(_hostsFilter, StringComparison.OrdinalIgnoreCase));
}
if (!string.IsNullOrWhiteSpace(_commentFilter))
{
filter = filter.Where(e => e.Comment.Contains(_commentFilter, StringComparison.OrdinalIgnoreCase));
}
return new ObservableCollection<Entry>(filter);
}
else
{
return _entries;
}
}
set
{
_entries = value;
OnPropertyChanged(nameof(Entries));
}
}
public ICommand ReadHostsCommand => new RelayCommand(ReadHosts);
@@ -66,9 +99,12 @@ namespace Hosts.ViewModels
public ICommand OpenHostsFileCommand => new RelayCommand(OpenHostsFile);
public MainViewModel(IHostsService hostService)
public MainViewModel(
IHostsService hostService,
IUserSettings userSettings)
{
_hostsService = hostService;
_userSettings = userSettings;
_hostsService.FileChanged += (s, e) =>
{
@@ -80,35 +116,24 @@ namespace Hosts.ViewModels
{
entry.PropertyChanged += Entry_PropertyChanged;
_entries.Add(entry);
FindDuplicates(entry.Address, entry.SplittedHosts);
OnPropertyChanged(nameof(Entries));
}
public void Update(int index, Entry entry)
{
var existingEntry = Entries.ElementAt(index);
var oldAddress = existingEntry.Address;
var oldHosts = existingEntry.SplittedHosts;
var existingEntry = _entries.ElementAt(index);
existingEntry.Address = entry.Address;
existingEntry.Comment = entry.Comment;
existingEntry.Hosts = entry.Hosts;
existingEntry.Active = entry.Active;
FindDuplicates(oldAddress, oldHosts);
FindDuplicates(entry.Address, entry.SplittedHosts);
OnPropertyChanged(nameof(Entries));
}
public void DeleteSelected()
{
var address = Selected.Address;
var hosts = Selected.SplittedHosts;
_entries.Remove(Selected);
FindDuplicates(address, hosts);
OnPropertyChanged(nameof(Entries));
if (Filtered)
{
OnPropertyChanged(nameof(Entries));
}
}
public void UpdateAdditionalLines(string lines)
@@ -132,7 +157,7 @@ namespace Hosts.ViewModels
await _dispatcherQueue.EnqueueAsync(() =>
{
_entries = new ObservableCollection<Entry>(entries);
Entries = new ObservableCollection<Entry>(entries);
foreach (var e in _entries)
{
@@ -140,24 +165,17 @@ namespace Hosts.ViewModels
}
_entries.CollectionChanged += Entries_CollectionChanged;
OnPropertyChanged(nameof(Entries));
FindDuplicates();
});
});
}
public void ApplyFilters()
{
if (_entries == null)
if (_entries != null)
{
return;
Filtered = !string.IsNullOrWhiteSpace(_addressFilter) || !string.IsNullOrWhiteSpace(_hostsFilter) || !string.IsNullOrWhiteSpace(_commentFilter);
OnPropertyChanged(nameof(Entries));
}
Filtered = !string.IsNullOrWhiteSpace(_addressFilter)
|| !string.IsNullOrWhiteSpace(_hostsFilter)
|| !string.IsNullOrWhiteSpace(_commentFilter);
OnPropertyChanged(nameof(Entries));
}
public void ClearFilters()
@@ -165,7 +183,6 @@ namespace Hosts.ViewModels
AddressFilter = null;
HostsFilter = null;
CommentFilter = null;
ShowOnlyDuplicates = false;
}
public async Task PingSelectedAsync()
@@ -195,10 +212,8 @@ namespace Hosts.ViewModels
private void Entry_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
// Ping and duplicate should't trigger a file save
if (e.PropertyName == nameof(Entry.Ping)
|| e.PropertyName == nameof(Entry.Pinging)
|| e.PropertyName == nameof(Entry.Duplicate))
// Ping should't trigger a file save
if (e.PropertyName == nameof(Entry.Ping) || e.PropertyName == nameof(Entry.Pinging))
{
return;
}
@@ -219,68 +234,6 @@ namespace Hosts.ViewModels
});
}
private void FindDuplicates()
{
foreach (var entry in _entries)
{
SetDuplicate(entry);
}
}
private void FindDuplicates(string address, IEnumerable<string> hosts)
{
var entries = _entries.Where(e =>
string.Equals(e.Address, address, StringComparison.InvariantCultureIgnoreCase)
|| hosts.Intersect(e.SplittedHosts, StringComparer.InvariantCultureIgnoreCase).Any());
foreach (var entry in entries)
{
SetDuplicate(entry);
}
}
private void SetDuplicate(Entry entry)
{
var hosts = entry.SplittedHosts;
entry.Duplicate = _entries.FirstOrDefault(e =>
e != entry
&& (string.Equals(e.Address, entry.Address, StringComparison.InvariantCultureIgnoreCase)
|| hosts.Intersect(e.SplittedHosts, StringComparer.InvariantCultureIgnoreCase).Any())) != null;
}
private ObservableCollection<Entry> GetFilteredEntries()
{
if (_entries == null)
{
return new ObservableCollection<Entry>();
}
var filter = _entries.AsEnumerable();
if (!string.IsNullOrWhiteSpace(_addressFilter))
{
filter = filter.Where(e => e.Address.Contains(_addressFilter, StringComparison.OrdinalIgnoreCase));
}
if (!string.IsNullOrWhiteSpace(_hostsFilter))
{
filter = filter.Where(e => e.Hosts.Contains(_hostsFilter, StringComparison.OrdinalIgnoreCase));
}
if (!string.IsNullOrWhiteSpace(_commentFilter))
{
filter = filter.Where(e => e.Comment.Contains(_commentFilter, StringComparison.OrdinalIgnoreCase));
}
if (_showOnlyDuplicates)
{
filter = filter.Where(e => e.Duplicate);
}
return new ObservableCollection<Entry>(filter);
}
protected virtual void Dispose(bool disposing)
{
if (!_disposed)

View File

@@ -116,9 +116,6 @@
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</AutoSuggestBox>
<ToggleSwitch
x:Uid="ShowOnlyDuplicates"
IsOn="{x:Bind ViewModel.ShowOnlyDuplicates, Mode=TwoWay}" />
<Button
x:Uid="ClearFiltersBtn"
Margin="0,6,0,0"
@@ -154,6 +151,7 @@
</StackPanel>
</Grid>
<StackPanel
Grid.Row="2"
Orientation="Vertical"
@@ -207,7 +205,6 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<FlyoutBase.AttachedFlyout>
<MenuFlyout>
@@ -257,7 +254,6 @@
Margin="0,0,8,0"
IsActive="{x:Bind Pinging, Mode=OneWay}" />
<FontIcon
x:Uid="PingIcon"
x:Name="PingIcon"
Grid.Column="2"
Margin="0,0,8,0"
@@ -310,18 +306,9 @@
</ic:DataTriggerBehavior>
</i:Interaction.Behaviors>
</FontIcon>
<FontIcon
x:Uid="DuplicateEntryIcon"
Grid.Column="3"
Margin="0,0,8,0"
Foreground="{StaticResource SystemControlErrorTextForegroundBrush}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="18"
Glyph="&#xe7BA;"
Visibility="{x:Bind Duplicate, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<ToggleSwitch
x:Uid="ActiveToggle"
Grid.Column="4"
Grid.Column="3"
Width="40"
MinWidth="0"
HorizontalAlignment="Right"
@@ -397,6 +384,7 @@
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollMode="Enabled"
TextWrapping="Wrap" />
</ContentDialog>
</Grid>
</Page>

View File

@@ -4,13 +4,7 @@
#include <dcomp.h>
#include <dxgi1_3.h>
#include <inspectable.h>
// Suppressing 26466 - Don't use static_cast downcasts - in base.h
#pragma warning(push)
#pragma warning(disable : 26466)
#include <winrt/base.h>
#pragma warning(pop)
struct DxgiWindowState
{

View File

@@ -74,12 +74,7 @@ HRESULT __stdcall PerGlyphOpacityTextRender::DrawGlyphRun(void* /*clientDrawingC
auto opacityEffect = clientDrawingEffect.try_query<IDrawingEffect>();
if (opacityEffect)
{
const auto temp_opacity = dynamic_cast<OpacityEffect*>(opacityEffect.get());
assert(nullptr != temp_opacity);
_baseBrush->SetOpacity(temp_opacity->alpha);
}
_baseBrush->SetOpacity(static_cast<OpacityEffect*>(opacityEffect.get())->alpha);
if (SUCCEEDED(hr))
{

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.props')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.props')" />
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
@@ -143,21 +143,21 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.2.221116.1\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.220929.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.1\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

View File

@@ -55,7 +55,4 @@
<ItemGroup>
<ResourceCompile Include="PowerToys.MeasureToolCore.rc" />
</ItemGroup>
<ItemGroup>
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" />
</ItemGroup>
</Project>

View File

@@ -197,9 +197,13 @@ std::unique_ptr<D3DCaptureState> D3DCaptureState::Create(DxgiAPI* dxgiAPI,
swapChain.put()));
// We must create the object in a heap, since we need to pin it in memory to receive callbacks
auto statePtr = std::unique_ptr<D3DCaptureState>(new D3DCaptureState{ dxgiAPI, std::move(swapChain), pixelFormat, std::move(monitorInfo), continuousCapture });
auto statePtr = new D3DCaptureState{ dxgiAPI,
std::move(swapChain),
pixelFormat,
std::move(monitorInfo),
continuousCapture };
return statePtr;
return std::unique_ptr<D3DCaptureState>{ statePtr };
}
D3DCaptureState::~D3DCaptureState()

View File

@@ -2,5 +2,5 @@
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.220929.3" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.755" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.1" targetFramework="native" />
</packages>

View File

@@ -13,10 +13,11 @@ using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Input;
using Windows.Graphics;
using WinUIEx;
using static NativeMethods;
namespace MeasureToolUI
{
using static NativeMethods;
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>

View File

@@ -13,6 +13,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
@@ -21,14 +22,6 @@
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
</PropertyGroup>
<!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->
@@ -70,8 +63,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

View File

@@ -204,12 +204,6 @@ void Highlighter::StartDrawingPointFading(MouseButton button)
void Highlighter::ClearDrawing()
{
if (nullptr == m_shape || nullptr == m_shape.Shapes())
{
// Guard against m_shape not being initialized.
return;
}
m_shape.Shapes().Clear();
}

View File

@@ -53,7 +53,7 @@ internal class ImageMethods
return BitmapToImageSource(bmp);
}
internal static async Task<string> GetRegionsText(Window? passedWindow, Rectangle selectedRegion, Language? preferredLanguage)
internal static async Task<string> GetRegionsText(Window? passedWindow, Rectangle selectedRegion)
{
using Bitmap bmp = new Bitmap(selectedRegion.Width, selectedRegion.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using Graphics g = Graphics.FromImage(bmp);
@@ -66,12 +66,12 @@ internal class ImageMethods
g.CopyFromScreen(thisCorrectedLeft, thisCorrectedTop, 0, 0, bmp.Size, CopyPixelOperation.SourceCopy);
// bmp = PadImage(bmp);
string? resultText = await ExtractText(bmp, preferredLanguage);
string? resultText = await ExtractText(bmp);
return resultText != null ? resultText.Trim() : string.Empty;
}
internal static async Task<string> GetClickedWord(Window passedWindow, System.Windows.Point clickedPoint, Language? preferredLanguage)
internal static async Task<string> GetClickedWord(Window passedWindow, System.Windows.Point clickedPoint)
{
DpiScale dpi = VisualTreeHelper.GetDpi(passedWindow);
Bitmap bmp = new Bitmap((int)(passedWindow.ActualWidth * dpi.DpiScaleX), (int)(passedWindow.ActualHeight * dpi.DpiScaleY), System.Drawing.Imaging.PixelFormat.Format32bppArgb);
@@ -85,18 +85,13 @@ internal class ImageMethods
System.Windows.Point adjustedPoint = new System.Windows.Point(clickedPoint.X, clickedPoint.Y);
string resultText = await ExtractText(bmp, preferredLanguage, adjustedPoint);
string resultText = await ExtractText(bmp, adjustedPoint);
return resultText.Trim();
}
public static async Task<string> ExtractText(Bitmap bmp, Language? preferredLanguage, System.Windows.Point? singlePoint = null)
public static async Task<string> ExtractText(Bitmap bmp, System.Windows.Point? singlePoint = null)
{
Language? selectedLanguage = preferredLanguage;
if (selectedLanguage == null)
{
selectedLanguage = GetOCRLanguage();
}
Language? selectedLanguage = GetOCRLanguage();
if (selectedLanguage == null)
{
return string.Empty;
@@ -152,10 +147,7 @@ internal class ImageMethods
}
else
{
// Kanji, Hiragana, Katakana, Hankaku-Katakana do not need blank.(not only the symbol in CJKUnifiedIdeographs).
// Maybe there are more symbols that don't require spaces like \u3001 \u3002.
// var cjkRegex = new Regex(@"\p{IsCJKUnifiedIdeographs}|\p{IsHiragana}|\p{IsKatakana}|[\uFF61-\uFF9F]|[\u3000-\u3003]");
var cjkRegex = new Regex(@"\p{IsCJKUnifiedIdeographs}|\p{IsHiragana}|\p{IsKatakana}|[\uFF61-\uFF9F]");
var cjkRegex = new Regex(@"\p{IsCJKUnifiedIdeographs}");
foreach (OcrLine ocrLine in ocrResult.Lines)
{

View File

@@ -151,9 +151,12 @@ public class KeyboardMonitor : IDisposable
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
_keyboardHook?.Dispose();
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}

View File

@@ -45,7 +45,12 @@
Color="Black" />
</Canvas.Background>
<Canvas.ContextMenu>
<ContextMenu x:Name="CanvasContextMenu" />
<ContextMenu>
<MenuItem
Name="CancelMenuItem"
Click="CancelMenuItem_Click"
Header="Cancel" />
</ContextMenu>
</Canvas.ContextMenu>
</Canvas>
</Grid>

View File

@@ -3,18 +3,13 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Microsoft.PowerToys.Telemetry;
using PowerOCR.Helpers;
using PowerOCR.Settings;
using PowerOCR.Utilities;
using Windows.Globalization;
using Windows.Media.Ocr;
namespace PowerOCR;
@@ -35,9 +30,6 @@ public partial class OCROverlay : Window
private Point GetMousePos() => PointToScreen(Mouse.GetPosition(this));
private Language? selectedLanguage = null;
private MenuItem cancelMenuItem;
private System.Windows.Forms.Screen? CurrentScreen
{
get;
@@ -55,52 +47,6 @@ public partial class OCROverlay : Window
public OCROverlay()
{
InitializeComponent();
var userSettings = new UserSettings(new Helpers.ThrottledActionInvoker());
string? selectedLanguageName = userSettings.PreferredLanguage.Value;
// build context menu
if (string.IsNullOrEmpty(selectedLanguageName))
{
selectedLanguage = ImageMethods.GetOCRLanguage();
selectedLanguageName = selectedLanguage?.DisplayName;
}
List<Language> possibleOcrLanguages = OcrEngine.AvailableRecognizerLanguages.ToList();
foreach (Language language in possibleOcrLanguages)
{
MenuItem menuItem = new MenuItem() { Header = language.NativeName, Tag = language, IsCheckable = true };
menuItem.IsChecked = language.DisplayName.Equals(selectedLanguageName);
if (language.DisplayName.Equals(selectedLanguageName))
{
selectedLanguage = language;
}
menuItem.Click += LanguageMenuItem_Click;
CanvasContextMenu.Items.Add(menuItem);
}
CanvasContextMenu.Items.Add(new Separator());
// ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse(); // resourceLoader.GetString("TextExtractor_Cancel")
cancelMenuItem = new MenuItem() { Header = "cancel" };
cancelMenuItem.Click += CancelMenuItem_Click;
CanvasContextMenu.Items.Add(cancelMenuItem);
}
private void LanguageMenuItem_Click(object sender, RoutedEventArgs e)
{
MenuItem menuItem = (MenuItem)sender;
foreach (var item in CanvasContextMenu.Items)
{
if (item is MenuItem)
{
MenuItem menuItemLoop = (MenuItem)item;
menuItemLoop.IsChecked = item.Equals(menuItem);
}
}
selectedLanguage = menuItem.Tag as Language;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -132,7 +78,7 @@ public partial class OCROverlay : Window
RegionClickCanvas.MouseUp -= RegionClickCanvas_MouseUp;
RegionClickCanvas.MouseMove -= RegionClickCanvas_MouseMove;
cancelMenuItem.Click -= CancelMenuItem_Click;
CancelMenuItem.Click -= CancelMenuItem_Click;
}
private void MainWindow_KeyUp(object sender, KeyEventArgs e)
@@ -313,11 +259,11 @@ public partial class OCROverlay : Window
if (regionScaled.Width < 3 || regionScaled.Height < 3)
{
grabbedText = await ImageMethods.GetClickedWord(this, new Point(xDimScaled, yDimScaled), selectedLanguage);
grabbedText = await ImageMethods.GetClickedWord(this, new Point(xDimScaled, yDimScaled));
}
else
{
grabbedText = await ImageMethods.GetRegionsText(this, regionScaled, selectedLanguage);
grabbedText = await ImageMethods.GetRegionsText(this, regionScaled);
}
if (string.IsNullOrWhiteSpace(grabbedText) == false)

View File

@@ -10,15 +10,6 @@
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>

View File

@@ -8,7 +8,5 @@ public interface IUserSettings
{
SettingItem<string> ActivationShortcut { get; }
SettingItem<string> PreferredLanguage { get; }
void SendSettingsTelemetry();
}

View File

@@ -29,7 +29,6 @@ namespace PowerOCR.Settings
{
_settingsUtils = new SettingsUtils();
ActivationShortcut = new SettingItem<string>(DefaultActivationShortcut);
PreferredLanguage = new SettingItem<string>(string.Empty);
LoadSettingsFromJson();
@@ -39,8 +38,6 @@ namespace PowerOCR.Settings
public SettingItem<string> ActivationShortcut { get; private set; }
public SettingItem<string> PreferredLanguage { get; private set; }
private void LoadSettingsFromJson()
{
// TODO this IO call should by Async, update GetFileWatcher helper to support async
@@ -67,7 +64,6 @@ namespace PowerOCR.Settings
if (settings != null)
{
ActivationShortcut.Value = settings.Properties.ActivationShortcut.ToString();
PreferredLanguage.Value = settings.Properties.PreferredLanguage.ToString();
}
retry = false;

View File

@@ -74,6 +74,7 @@ public:
// These are the settings shown on the settings page along with their current values.
virtual bool get_config(wchar_t* buffer, int* buffer_size) override
{
return false;
HINSTANCE hinstance = reinterpret_cast<HINSTANCE>(&__ImageBase);
// Create a Settings object.

View File

@@ -17,15 +17,8 @@
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PackageProjectUrl>https://awake.den.dev</PackageProjectUrl>
<RepositoryUrl>https://github.com/microsoft/powertoys</RepositoryUrl>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Recommended</AnalysisMode>
</PropertyGroup>
<!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->

View File

@@ -57,8 +57,7 @@ namespace Awake.Core
_log.Error($"An error occurred initializing the tray. {ex.Message}");
_log.Error($"{ex.StackTrace}");
}
},
TrayIcon);
}, TrayIcon);
}
/// <summary>
@@ -133,7 +132,7 @@ namespace Awake.Core
TrayIcon.Text = text;
}
private sealed class CheckButtonToolStripMenuItemAccessibleObject : ToolStripItem.ToolStripItemAccessibleObject
private class CheckButtonToolStripMenuItemAccessibleObject : ToolStripItem.ToolStripItemAccessibleObject
{
private CheckButtonToolStripMenuItem _menuItem;
@@ -154,7 +153,7 @@ namespace Awake.Core
public override string Name => _menuItem.Text + ", " + Role + ", " + (_menuItem.Checked ? "Checked" : "Unchecked");
}
private sealed class CheckButtonToolStripMenuItem : ToolStripMenuItem
private class CheckButtonToolStripMenuItem : ToolStripMenuItem
{
public CheckButtonToolStripMenuItem()
{

View File

@@ -30,7 +30,7 @@ using Windows.Win32.System.Power;
namespace Awake
{
internal sealed class Program
internal class Program
{
// PowerToys Awake build code name. Used for exact logging
// that does not map to PowerToys broad version schema to pinpoint

View File

@@ -66,9 +66,7 @@
<ResourceCompile Include="Generated Files\ColorPicker.rc" />
</ItemGroup>
<ItemGroup>
<None Include="Resources.resx">
<SubType>Designer</SubType>
</None>
<None Include="Resources.resx" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />

View File

@@ -19,7 +19,6 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lp
{
case DLL_PROCESS_ATTACH:
Trace::RegisterProvider();
[[fallthrough]];
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;

View File

@@ -89,6 +89,8 @@ namespace ColorPickerUI
_themeManager?.Dispose();
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}

View File

@@ -38,21 +38,19 @@ namespace ColorPicker.Behaviors
{
Task.Run(
new Action(() =>
{
Dispatcher.BeginInvoke(
new Action(() =>
{
if (e.LeftButton == MouseButtonState.Pressed)
{
var data = new DataObject();
data.SetData("Source", (sender as FrameworkElement).DataContext);
DragDrop.DoDragDrop(sender as DependencyObject, data, DragDropEffects.Move);
e.Handled = true;
}
}),
null);
}),
CancellationToken.None);
{
Dispatcher.BeginInvoke(
new Action(() =>
{
if (e.LeftButton == MouseButtonState.Pressed)
{
var data = new DataObject();
data.SetData("Source", (sender as FrameworkElement).DataContext);
DragDrop.DoDragDrop(sender as DependencyObject, data, DragDropEffects.Move);
e.Handled = true;
}
}), null);
}), CancellationToken.None);
}
}

View File

@@ -9,17 +9,7 @@
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
<UseWPF>true</UseWPF>
<StartupObject>ColorPicker.Program</StartupObject>
<SelfContained>true</SelfContained>
</PropertyGroup>
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<ProjectGuid>{BA58206B-1493-4C75-BFEA-A85768A1E156}</ProjectGuid>
<OutputType>WinExe</OutputType>

View File

@@ -103,28 +103,28 @@ namespace ColorPicker.Controls
HueGradientSlider.Background = gradientBrush;
}
private static void SetColorVariationsForCurrentColor(DependencyObject d, (double Hue, double Saturation, double Value) hsv)
private static void SetColorVariationsForCurrentColor(DependencyObject d, (double hue, double saturation, double value) hsv)
{
var hueCoefficient = 0;
var hueCoefficient2 = 0;
if (1 - hsv.Value < 0.15)
if (1 - hsv.value < 0.15)
{
hueCoefficient = 1;
}
if (hsv.Value - 0.3 < 0)
if (hsv.value - 0.3 < 0)
{
hueCoefficient2 = 1;
}
var s = hsv.Saturation;
var s = hsv.saturation;
var control = (ColorPickerControl)d;
control.colorVariation1Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Min(hsv.Hue + (hueCoefficient * 8), 360), s, Math.Min(hsv.Value + 0.3, 1)));
control.colorVariation2Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Min(hsv.Hue + (hueCoefficient * 4), 360), s, Math.Min(hsv.Value + 0.15, 1)));
control.colorVariation1Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Min(hsv.hue + (hueCoefficient * 8), 360), s, Math.Min(hsv.value + 0.3, 1)));
control.colorVariation2Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Min(hsv.hue + (hueCoefficient * 4), 360), s, Math.Min(hsv.value + 0.15, 1)));
control.colorVariation3Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Max(hsv.Hue - (hueCoefficient2 * 4), 0), s, Math.Max(hsv.Value - 0.2, 0)));
control.colorVariation4Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Max(hsv.Hue - (hueCoefficient2 * 8), 0), s, Math.Max(hsv.Value - 0.3, 0)));
control.colorVariation3Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Max(hsv.hue - (hueCoefficient2 * 4), 0), s, Math.Max(hsv.value - 0.2, 0)));
control.colorVariation4Button.Background = new SolidColorBrush(HSVColor.RGBFromHSV(Math.Max(hsv.hue - (hueCoefficient2 * 8), 0), s, Math.Max(hsv.value - 0.3, 0)));
}
private void UpdateValueColorGradient(double posX)
@@ -312,9 +312,9 @@ namespace ColorPicker.Controls
{
var hsv = ColorFormatHelper.ConvertToHSVColor(color);
var huePosition = (hsv.Hue / 360) * HueGradientSlider.Maximum;
var saturationPosition = hsv.Saturation * SaturationGradientSlider.Maximum;
var valuePosition = hsv.Value * ValueGradientSlider.Maximum;
var huePosition = (hsv.hue / 360) * HueGradientSlider.Maximum;
var saturationPosition = hsv.saturation * SaturationGradientSlider.Maximum;
var valuePosition = hsv.value * ValueGradientSlider.Maximum;
UpdateHueColorGradient(huePosition);
UpdateSaturationColorGradient(saturationPosition);
UpdateValueColorGradient(valuePosition);

View File

@@ -2,6 +2,7 @@
// 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.Drawing;
namespace ColorPicker.Helpers
@@ -16,7 +17,7 @@ namespace ColorPicker.Helpers
/// </summary>
/// <param name="color">The <see cref="Color"/> to convert</param>
/// <returns>The int / 255d for each value to get value between 0 and 1</returns>
internal static (double Red, double Green, double Blue) ConvertToDouble(Color color)
internal static (double red, double green, double blue) ConvertToDouble(Color color)
=> (color.R / 255d, color.G / 255d, color.B / 255d);
}
}

View File

@@ -5,8 +5,8 @@
using System;
using System.Drawing;
using System.Globalization;
using ColorPicker.Properties;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
namespace ColorPicker.Helpers
{
@@ -34,17 +34,26 @@ namespace ColorPicker.Helpers
/// <param name="colorRepresentationType">The type of the representation</param>
/// <returns>A <see cref="string"/> representation of a color</returns>
internal static string GetStringRepresentation(Color color, string colorRepresentationType, string colorFormat)
{
if (string.IsNullOrEmpty(colorFormat))
=> colorRepresentationType switch
{
return ColorToHex(color);
}
else
{
// get string representation in 2 steps. First replace all color specific number values then in 2nd step replace color name with localisation
return ReplaceName(ColorFormatHelper.GetStringRepresentation(color, colorFormat), color);
}
}
"CMYK" => ColorToCMYK(color),
"HEX" => ColorToHex(color),
"HSB" => ColorToHSB(color),
"HSI" => ColorToHSI(color),
"HSL" => ColorToHSL(color),
"HSV" => ColorToHSV(color),
"HWB" => ColorToHWB(color),
"NCol" => ColorToNCol(color),
"RGB" => ColorToRGB(color),
"CIELAB" => ColorToCIELAB(color),
"CIEXYZ" => ColorToCIEXYZ(color),
"VEC4" => ColorToFloat(color),
"Decimal" => ColorToDecimal(color),
"HEX Int" => ColorToHexInteger(color),
// Fall-back value, when "_userSettings.CopiedColorRepresentation.Value" is incorrect
_ => string.IsNullOrEmpty(colorFormat) ? ColorToHex(color) : ColorFormatHelper.GetStringRepresentation(color, colorFormat),
};
/// <summary>
/// Return a <see cref="string"/> representation of a CMYK color
@@ -121,7 +130,7 @@ namespace ColorPicker.Helpers
/// <returns>a string value number</returns>
private static string ColorToDecimal(Color color)
{
return $"{(color.R * 65536) + (color.G * 256) + color.B}";
return $"{color.R + (color.G * 256) + (color.B * 65536)}";
}
/// <summary>
@@ -274,60 +283,5 @@ namespace ColorPicker.Helpers
+ $"{color.G.ToString(hexFormat, CultureInfo.InvariantCulture)}"
+ $"{color.B.ToString(hexFormat, CultureInfo.InvariantCulture)}";
}
public static string GetColorNameFromColorIdentifier(string colorIdentifier)
{
switch (colorIdentifier)
{
case "TEXT_COLOR_WHITE": return Resources.TEXT_COLOR_WHITE;
case "TEXT_COLOR_BLACK": return Resources.TEXT_COLOR_BLACK;
case "TEXT_COLOR_LIGHTGRAY": return Resources.TEXT_COLOR_LIGHTGRAY;
case "TEXT_COLOR_GRAY": return Resources.TEXT_COLOR_GRAY;
case "TEXT_COLOR_DARKGRAY": return Resources.TEXT_COLOR_DARKGRAY;
case "TEXT_COLOR_CORAL": return Resources.TEXT_COLOR_CORAL;
case "TEXT_COLOR_ROSE": return Resources.TEXT_COLOR_ROSE;
case "TEXT_COLOR_LIGHTORANGE": return Resources.TEXT_COLOR_LIGHTORANGE;
case "TEXT_COLOR_TAN": return Resources.TEXT_COLOR_TAN;
case "TEXT_COLOR_LIGHTYELLOW": return Resources.TEXT_COLOR_LIGHTYELLOW;
case "TEXT_COLOR_LIGHTGREEN": return Resources.TEXT_COLOR_LIGHTGREEN;
case "TEXT_COLOR_LIME": return Resources.TEXT_COLOR_LIME;
case "TEXT_COLOR_AQUA": return Resources.TEXT_COLOR_AQUA;
case "TEXT_COLOR_SKYBLUE": return Resources.TEXT_COLOR_SKYBLUE;
case "TEXT_COLOR_LIGHTTURQUOISE": return Resources.TEXT_COLOR_LIGHTTURQUOISE;
case "TEXT_COLOR_PALEBLUE": return Resources.TEXT_COLOR_PALEBLUE;
case "TEXT_COLOR_LIGHTBLUE": return Resources.TEXT_COLOR_LIGHTBLUE;
case "TEXT_COLOR_ICEBLUE": return Resources.TEXT_COLOR_ICEBLUE;
case "TEXT_COLOR_PERIWINKLE": return Resources.TEXT_COLOR_PERIWINKLE;
case "TEXT_COLOR_LAVENDER": return Resources.TEXT_COLOR_LAVENDER;
case "TEXT_COLOR_PINK": return Resources.TEXT_COLOR_PINK;
case "TEXT_COLOR_RED": return Resources.TEXT_COLOR_RED;
case "TEXT_COLOR_ORANGE": return Resources.TEXT_COLOR_ORANGE;
case "TEXT_COLOR_BROWN": return Resources.TEXT_COLOR_BROWN;
case "TEXT_COLOR_GOLD": return Resources.TEXT_COLOR_GOLD;
case "TEXT_COLOR_YELLOW": return Resources.TEXT_COLOR_YELLOW;
case "TEXT_COLOR_OLIVEGREEN": return Resources.TEXT_COLOR_OLIVEGREEN;
case "TEXT_COLOR_GREEN": return Resources.TEXT_COLOR_GREEN;
case "TEXT_COLOR_BRIGHTGREEN": return Resources.TEXT_COLOR_BRIGHTGREEN;
case "TEXT_COLOR_TEAL": return Resources.TEXT_COLOR_TEAL;
case "TEXT_COLOR_TURQUOISE": return Resources.TEXT_COLOR_TURQUOISE;
case "TEXT_COLOR_BLUE": return Resources.TEXT_COLOR_BLUE;
case "TEXT_COLOR_BLUEGRAY": return Resources.TEXT_COLOR_BLUEGRAY;
case "TEXT_COLOR_INDIGO": return Resources.TEXT_COLOR_INDIGO;
case "TEXT_COLOR_PURPLE": return Resources.TEXT_COLOR_PURPLE;
case "TEXT_COLOR_DARKRED": return Resources.TEXT_COLOR_DARKRED;
case "TEXT_COLOR_DARKYELLOW": return Resources.TEXT_COLOR_DARKYELLOW;
case "TEXT_COLOR_DARKGREEN": return Resources.TEXT_COLOR_DARKGREEN;
case "TEXT_COLOR_DARKTEAL": return Resources.TEXT_COLOR_DARKTEAL;
case "TEXT_COLOR_DARKBLUE": return Resources.TEXT_COLOR_DARKBLUE;
case "TEXT_COLOR_DARKPURPLE": return Resources.TEXT_COLOR_DARKPURPLE;
case "TEXT_COLOR_PLUM": return Resources.TEXT_COLOR_PLUM;
default: return string.Empty;
}
}
public static string ReplaceName(string colorFormat, Color color)
{
return colorFormat.Replace(ColorFormatHelper.GetColorNameParameter(), GetColorNameFromColorIdentifier(ColorNameHelper.GetColorNameIdentifier(color)));
}
}
}

View File

@@ -162,9 +162,12 @@ namespace ColorPicker.Keyboard
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
_keyboardHook?.Dispose();
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}

View File

@@ -4,7 +4,6 @@
using System;
using System.Windows.Media;
using ColorPicker.Helpers;
using ManagedCommon;
namespace ColorPicker.Models
@@ -24,10 +23,7 @@ namespace ColorPicker.Models
return Convert(color);
}
System.Drawing.Color drawingColor = System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B);
// get string representation in 2 steps. First replace all color specific number values then in 2nd step replace color name with localisation
return ColorRepresentationHelper.ReplaceName(ColorFormatHelper.GetStringRepresentation(drawingColor, FormatString), drawingColor);
return ColorFormatHelper.GetStringRepresentation(System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B), FormatString);
}
}
}

View File

@@ -330,384 +330,6 @@ namespace ColorPicker.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Aqua.
/// </summary>
public static string TEXT_COLOR_AQUA {
get {
return ResourceManager.GetString("TEXT_COLOR_AQUA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Black.
/// </summary>
public static string TEXT_COLOR_BLACK {
get {
return ResourceManager.GetString("TEXT_COLOR_BLACK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Blue.
/// </summary>
public static string TEXT_COLOR_BLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_BLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Blue gray.
/// </summary>
public static string TEXT_COLOR_BLUEGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_BLUEGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bright green.
/// </summary>
public static string TEXT_COLOR_BRIGHTGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_BRIGHTGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Brown.
/// </summary>
public static string TEXT_COLOR_BROWN {
get {
return ResourceManager.GetString("TEXT_COLOR_BROWN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Coral.
/// </summary>
public static string TEXT_COLOR_CORAL {
get {
return ResourceManager.GetString("TEXT_COLOR_CORAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark blue.
/// </summary>
public static string TEXT_COLOR_DARKBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark gray.
/// </summary>
public static string TEXT_COLOR_DARKGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark green.
/// </summary>
public static string TEXT_COLOR_DARKGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark purple.
/// </summary>
public static string TEXT_COLOR_DARKPURPLE {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKPURPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark red.
/// </summary>
public static string TEXT_COLOR_DARKRED {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKRED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark teal.
/// </summary>
public static string TEXT_COLOR_DARKTEAL {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKTEAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Dark yellow.
/// </summary>
public static string TEXT_COLOR_DARKYELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_DARKYELLOW", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gold.
/// </summary>
public static string TEXT_COLOR_GOLD {
get {
return ResourceManager.GetString("TEXT_COLOR_GOLD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gray.
/// </summary>
public static string TEXT_COLOR_GRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_GRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Green.
/// </summary>
public static string TEXT_COLOR_GREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_GREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ice blue.
/// </summary>
public static string TEXT_COLOR_ICEBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_ICEBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Indigo.
/// </summary>
public static string TEXT_COLOR_INDIGO {
get {
return ResourceManager.GetString("TEXT_COLOR_INDIGO", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lavender.
/// </summary>
public static string TEXT_COLOR_LAVENDER {
get {
return ResourceManager.GetString("TEXT_COLOR_LAVENDER", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light blue.
/// </summary>
public static string TEXT_COLOR_LIGHTBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light gray.
/// </summary>
public static string TEXT_COLOR_LIGHTGRAY {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTGRAY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light green.
/// </summary>
public static string TEXT_COLOR_LIGHTGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light orange.
/// </summary>
public static string TEXT_COLOR_LIGHTORANGE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTORANGE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light turquoise.
/// </summary>
public static string TEXT_COLOR_LIGHTTURQUOISE {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTTURQUOISE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Light yellow.
/// </summary>
public static string TEXT_COLOR_LIGHTYELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_LIGHTYELLOW", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lime.
/// </summary>
public static string TEXT_COLOR_LIME {
get {
return ResourceManager.GetString("TEXT_COLOR_LIME", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Olive green.
/// </summary>
public static string TEXT_COLOR_OLIVEGREEN {
get {
return ResourceManager.GetString("TEXT_COLOR_OLIVEGREEN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Orange.
/// </summary>
public static string TEXT_COLOR_ORANGE {
get {
return ResourceManager.GetString("TEXT_COLOR_ORANGE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pale blue.
/// </summary>
public static string TEXT_COLOR_PALEBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_PALEBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Periwinkle.
/// </summary>
public static string TEXT_COLOR_PERIWINKLE {
get {
return ResourceManager.GetString("TEXT_COLOR_PERIWINKLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pink.
/// </summary>
public static string TEXT_COLOR_PINK {
get {
return ResourceManager.GetString("TEXT_COLOR_PINK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Plum.
/// </summary>
public static string TEXT_COLOR_PLUM {
get {
return ResourceManager.GetString("TEXT_COLOR_PLUM", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Purple.
/// </summary>
public static string TEXT_COLOR_PURPLE {
get {
return ResourceManager.GetString("TEXT_COLOR_PURPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Red.
/// </summary>
public static string TEXT_COLOR_RED {
get {
return ResourceManager.GetString("TEXT_COLOR_RED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rose.
/// </summary>
public static string TEXT_COLOR_ROSE {
get {
return ResourceManager.GetString("TEXT_COLOR_ROSE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sky blue.
/// </summary>
public static string TEXT_COLOR_SKYBLUE {
get {
return ResourceManager.GetString("TEXT_COLOR_SKYBLUE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tan.
/// </summary>
public static string TEXT_COLOR_TAN {
get {
return ResourceManager.GetString("TEXT_COLOR_TAN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Teal.
/// </summary>
public static string TEXT_COLOR_TEAL {
get {
return ResourceManager.GetString("TEXT_COLOR_TEAL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Turquoise.
/// </summary>
public static string TEXT_COLOR_TURQUOISE {
get {
return ResourceManager.GetString("TEXT_COLOR_TURQUOISE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to White.
/// </summary>
public static string TEXT_COLOR_WHITE {
get {
return ResourceManager.GetString("TEXT_COLOR_WHITE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yellow.
/// </summary>
public static string TEXT_COLOR_YELLOW {
get {
return ResourceManager.GetString("TEXT_COLOR_YELLOW", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Value slider.
/// </summary>

View File

@@ -232,172 +232,4 @@
<data name="Lightest color" xml:space="preserve">
<value>Color light 2</value>
</data>
<data name="TEXT_COLOR_WHITE" xml:space="preserve">
<value>White</value>
<comment>White color</comment>
</data>
<data name="TEXT_COLOR_BLACK" xml:space="preserve">
<value>Black</value>
<comment>Black color</comment>
</data>
<data name="TEXT_COLOR_LIGHTGRAY" xml:space="preserve">
<value>Light gray</value>
<comment>Light gray color</comment>
</data>
<data name="TEXT_COLOR_GRAY" xml:space="preserve">
<value>Gray</value>
<comment>Gray color</comment>
</data>
<data name="TEXT_COLOR_DARKGRAY" xml:space="preserve">
<value>Dark gray</value>
<comment>Dark gray color</comment>
</data>
<data name="TEXT_COLOR_CORAL" xml:space="preserve">
<value>Coral</value>
<comment>Coral color</comment>
</data>
<data name="TEXT_COLOR_ROSE" xml:space="preserve">
<value>Rose</value>
<comment>Rose color</comment>
</data>
<data name="TEXT_COLOR_LIGHTORANGE" xml:space="preserve">
<value>Light orange</value>
<comment>Light orange color</comment>
</data>
<data name="TEXT_COLOR_TAN" xml:space="preserve">
<value>Tan</value>
<comment>Tan color</comment>
</data>
<data name="TEXT_COLOR_LIGHTYELLOW" xml:space="preserve">
<value>Light yellow</value>
<comment>Light yellow color</comment>
</data>
<data name="TEXT_COLOR_LIGHTGREEN" xml:space="preserve">
<value>Light green</value>
<comment>Light green color</comment>
</data>
<data name="TEXT_COLOR_LIME" xml:space="preserve">
<value>Lime</value>
<comment>Lime color</comment>
</data>
<data name="TEXT_COLOR_AQUA" xml:space="preserve">
<value>Aqua</value>
<comment>Aqua color</comment>
</data>
<data name="TEXT_COLOR_SKYBLUE" xml:space="preserve">
<value>Sky blue</value>
<comment>Sky blue color</comment>
</data>
<data name="TEXT_COLOR_LIGHTTURQUOISE" xml:space="preserve">
<value>Light turquoise</value>
<comment>Light turquoise color</comment>
</data>
<data name="TEXT_COLOR_PALEBLUE" xml:space="preserve">
<value>Pale blue</value>
<comment>Pale blue color</comment>
</data>
<data name="TEXT_COLOR_LIGHTBLUE" xml:space="preserve">
<value>Light blue</value>
<comment>Light blue color</comment>
</data>
<data name="TEXT_COLOR_ICEBLUE" xml:space="preserve">
<value>Ice blue</value>
<comment>Ice blue color</comment>
</data>
<data name="TEXT_COLOR_PERIWINKLE" xml:space="preserve">
<value>Periwinkle</value>
<comment>Periwinkle color</comment>
</data>
<data name="TEXT_COLOR_LAVENDER" xml:space="preserve">
<value>Lavender</value>
<comment>Lavender color</comment>
</data>
<data name="TEXT_COLOR_PINK" xml:space="preserve">
<value>Pink</value>
<comment>Pink color</comment>
</data>
<data name="TEXT_COLOR_RED" xml:space="preserve">
<value>Red</value>
<comment>Red color</comment>
</data>
<data name="TEXT_COLOR_ORANGE" xml:space="preserve">
<value>Orange</value>
<comment>Orange color</comment>
</data>
<data name="TEXT_COLOR_BROWN" xml:space="preserve">
<value>Brown</value>
<comment>Brown color</comment>
</data>
<data name="TEXT_COLOR_GOLD" xml:space="preserve">
<value>Gold</value>
<comment>Gold color</comment>
</data>
<data name="TEXT_COLOR_YELLOW" xml:space="preserve">
<value>Yellow</value>
<comment>Yellow color</comment>
</data>
<data name="TEXT_COLOR_OLIVEGREEN" xml:space="preserve">
<value>Olive green</value>
<comment>Olive green color</comment>
</data>
<data name="TEXT_COLOR_GREEN" xml:space="preserve">
<value>Green</value>
<comment>Green color</comment>
</data>
<data name="TEXT_COLOR_BRIGHTGREEN" xml:space="preserve">
<value>Bright green</value>
<comment>Rose color</comment>
</data>
<data name="TEXT_COLOR_TEAL" xml:space="preserve">
<value>Teal</value>
<comment>Teal color</comment>
</data>
<data name="TEXT_COLOR_TURQUOISE" xml:space="preserve">
<value>Turquoise</value>
<comment>Turquoise color</comment>
</data>
<data name="TEXT_COLOR_BLUE" xml:space="preserve">
<value>Blue</value>
<comment>Blue color</comment>
</data>
<data name="TEXT_COLOR_BLUEGRAY" xml:space="preserve">
<value>Blue gray</value>
<comment>Blue gray color</comment>
</data>
<data name="TEXT_COLOR_INDIGO" xml:space="preserve">
<value>Indigo</value>
<comment>Indigo color</comment>
</data>
<data name="TEXT_COLOR_PURPLE" xml:space="preserve">
<value>Purple</value>
<comment>Purple color</comment>
</data>
<data name="TEXT_COLOR_DARKRED" xml:space="preserve">
<value>Dark red</value>
<comment>Dark red color</comment>
</data>
<data name="TEXT_COLOR_DARKYELLOW" xml:space="preserve">
<value>Dark yellow</value>
<comment>Dark yellow color</comment>
</data>
<data name="TEXT_COLOR_DARKGREEN" xml:space="preserve">
<value>Dark green</value>
<comment>Dark green color</comment>
</data>
<data name="TEXT_COLOR_DARKTEAL" xml:space="preserve">
<value>Dark teal</value>
<comment>Dark teal color</comment>
</data>
<data name="TEXT_COLOR_DARKBLUE" xml:space="preserve">
<value>Dark blue</value>
<comment>Dark blue color</comment>
</data>
<data name="TEXT_COLOR_DARKPURPLE" xml:space="preserve">
<value>Dark purple</value>
<comment>Dark purple color</comment>
</data>
<data name="TEXT_COLOR_PLUM" xml:space="preserve">
<value>Plum</value>
<comment>Plum color</comment>
</data>
</root>

View File

@@ -189,7 +189,7 @@ namespace ColorPicker.ViewModels
{
".TXT" => colors.ToTxt(';'),
".JSON" => colors.ToJson(),
_ => string.Empty,
_ => string.Empty
};
File.WriteAllText(dialog.FileName, contentToWrite);

View File

@@ -176,7 +176,7 @@ namespace ColorPicker.ViewModels
{
ColorBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, color.B));
ColorText = ColorRepresentationHelper.GetStringRepresentation(color, _userSettings.CopiedColorRepresentation.Value, _userSettings.CopiedColorRepresentationFormat.Value);
ColorName = ColorRepresentationHelper.GetColorNameFromColorIdentifier(ColorNameHelper.GetColorNameIdentifier(color));
ColorName = ColorNameHelper.GetColorName(color);
}
/// <summary>

View File

@@ -5,6 +5,7 @@
using System;
using System.Drawing;
using System.Globalization;
using ColorPicker.Helpers;
using ManagedCommon;
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -56,13 +57,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToHSLColor(color);
// hue[0°..360°]
Assert.AreEqual(result.Hue, hue, 0.2d);
Assert.AreEqual(result.hue, hue, 0.2d);
// saturation[0..1]
Assert.AreEqual(result.Saturation * 100d, saturation, 0.2d);
Assert.AreEqual(result.saturation * 100d, saturation, 0.2d);
// lightness[0..1]
Assert.AreEqual(result.Lightness * 100d, lightness, 0.2d);
Assert.AreEqual(result.lightness * 100d, lightness, 0.2d);
}
// test values taken from https://de.wikipedia.org/wiki/HSV-Farbraum
@@ -105,13 +106,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToHSVColor(color);
// hue [0°..360°]
Assert.AreEqual(result.Hue, hue, 0.2d);
Assert.AreEqual(result.hue, hue, 0.2d);
// saturation[0..1]
Assert.AreEqual(result.Saturation * 100d, saturation, 0.2d);
Assert.AreEqual(result.saturation * 100d, saturation, 0.2d);
// value[0..1]
Assert.AreEqual(result.Value * 100d, value, 0.2d);
Assert.AreEqual(result.value * 100d, value, 0.2d);
}
// test values taken from https://de.wikipedia.org/wiki/HSV-Farbraum
@@ -154,13 +155,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToHSBColor(color);
// hue [0°..360°]
Assert.AreEqual(result.Hue, hue, 0.2d);
Assert.AreEqual(result.hue, hue, 0.2d);
// saturation[0..1]
Assert.AreEqual(result.Saturation * 100d, saturation, 0.2d);
Assert.AreEqual(result.saturation * 100d, saturation, 0.2d);
// value[0..1]
Assert.AreEqual(result.Brightness * 100d, value, 0.2d);
Assert.AreEqual(result.brightness * 100d, value, 0.2d);
}
[TestMethod]
@@ -198,16 +199,16 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToCMYKColor(color);
// cyan[0..1]
Assert.AreEqual(result.Cyan * 100d, cyan, 0.5d);
Assert.AreEqual(result.cyan * 100d, cyan, 0.5d);
// magenta[0..1]
Assert.AreEqual(result.Magenta * 100d, magenta, 0.5d);
Assert.AreEqual(result.magenta * 100d, magenta, 0.5d);
// yellow[0..1]
Assert.AreEqual(result.Yellow * 100d, yellow, 0.5d);
Assert.AreEqual(result.yellow * 100d, yellow, 0.5d);
// black[0..1]
Assert.AreEqual(result.BlackKey * 100d, blackKey, 0.5d);
Assert.AreEqual(result.blackKey * 100d, blackKey, 0.5d);
}
// values taken from https://en.wikipedia.org/wiki/HSL_and_HSV#Examples
@@ -248,13 +249,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToHSIColor(color);
// hue[0°..360°]
Assert.AreEqual(result.Hue, hue, 0.5d);
Assert.AreEqual(result.hue, hue, 0.5d);
// saturation[0..1]
Assert.AreEqual(result.Saturation * 100d, saturation, 0.5d);
Assert.AreEqual(result.saturation * 100d, saturation, 0.5d);
// intensity[0..1]
Assert.AreEqual(result.Intensity * 100d, intensity, 0.5d);
Assert.AreEqual(result.intensity * 100d, intensity, 0.5d);
}
// values taken from https://en.wikipedia.org/wiki/HSL_and_HSV#Examples
@@ -296,13 +297,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToHWBColor(color);
// hue[0°..360°]
Assert.AreEqual(result.Hue, hue, 0.5d);
Assert.AreEqual(result.hue, hue, 0.5d);
// whiteness[0..1]
Assert.AreEqual(result.Whiteness * 100d, whiteness, 0.5d);
Assert.AreEqual(result.whiteness * 100d, whiteness, 0.5d);
// blackness[0..1]
Assert.AreEqual(result.Blackness * 100d, blackness, 0.5d);
Assert.AreEqual(result.blackness * 100d, blackness, 0.5d);
}
// values taken from https://en.wikipedia.org/wiki/HSL_and_HSV#Examples
@@ -344,13 +345,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToNaturalColor(color);
// hue
Assert.AreEqual(result.Hue, hue);
Assert.AreEqual(result.hue, hue);
// whiteness[0..1]
Assert.AreEqual(result.Whiteness * 100d, whiteness, 0.5d);
Assert.AreEqual(result.whiteness * 100d, whiteness, 0.5d);
// blackness[0..1]
Assert.AreEqual(result.Blackness * 100d, blackness, 0.5d);
Assert.AreEqual(result.blackness * 100d, blackness, 0.5d);
}
[TestMethod]
@@ -400,13 +401,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToCIELABColor(color);
// lightness[0..100]
Assert.AreEqual(Math.Round(result.Lightness, 2), lightness);
Assert.AreEqual(Math.Round(result.lightness, 2), lightness);
// chromaticityA[-128..127]
Assert.AreEqual(Math.Round(result.ChromaticityA, 2), chromaticityA);
Assert.AreEqual(Math.Round(result.chromaticityA, 2), chromaticityA);
// chromaticityB[-128..127]
Assert.AreEqual(Math.Round(result.ChromaticityB, 2), chromaticityB);
Assert.AreEqual(Math.Round(result.chromaticityB, 2), chromaticityB);
}
// The following results are computed using LittleCMS2, an open-source color management engine,
@@ -464,13 +465,13 @@ namespace Microsoft.ColorPicker.UnitTests
var result = ColorFormatHelper.ConvertToCIEXYZColor(color);
// x[0..0.95047]
Assert.AreEqual(Math.Round(result.X * 100, 4), x);
Assert.AreEqual(Math.Round(result.x * 100, 4), x);
// y[0..1]
Assert.AreEqual(Math.Round(result.Y * 100, 4), y);
Assert.AreEqual(Math.Round(result.y * 100, 4), y);
// z[0..1.08883]
Assert.AreEqual(Math.Round(result.Z * 100, 4), z);
Assert.AreEqual(Math.Round(result.z * 100, 4), z);
}
[TestMethod]

View File

@@ -4,7 +4,6 @@
using System.Drawing;
using ColorPicker.Helpers;
using ManagedCommon;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.ColorPicker.UnitTests
@@ -30,7 +29,7 @@ namespace Microsoft.ColorPicker.UnitTests
public void GetStringRepresentationTest(string type, string expected)
{
var result = ColorRepresentationHelper.GetStringRepresentation(Color.Black, type, ColorFormatHelper.GetDefaultFormat(type));
var result = ColorRepresentationHelper.GetStringRepresentation(Color.Black, type, string.Empty);
Assert.AreEqual(result, expected);
}
}

Some files were not shown because too many files have changed in this diff Show More