Compare commits

..

65 Commits

Author SHA1 Message Date
Jaime Bernardo
a510d5e3ce [TextExtractor]Properly initialize PreferredLanguage (#23095) 2023-01-04 15:56:50 +00:00
Jaime Bernardo
9a77c3a87a [Installer]Add missing Json dll to Text Extractor (#23092) 2023-01-04 11:45:45 +00:00
Taras
14ad19e1e3 [QuickAccent]Add setting to sort characters by use frequency (#22847)
* [Quick Accent] add toggle switch to sort characters by usage frequency

* [Quick Accent] if enabled, then sort by frequency for all toolbar triggers

* [Quick Accent] add "start selection from the left" toggle switch

* [Quick Accent] fix error SA1000: The keyword 'new' should not be followed by a space

* Fix C# analyzer build error
2023-01-03 12:44:57 +00:00
sosssego
b1c535a2ce [Analyzers][CPP]Turn on warning 26466 (#22639)
* Turn on warning 26466

* changes from comments
2023-01-03 12:19:07 +00:00
sosssego
6287460614 [Analyzers][CPP] Turn on warning 26403 (#22795) 2023-01-03 12:16:27 +00:00
Laszlo Nemeth
dd62dab831 [TextExtractor] Extend settings with preferred language (#22901)
* [TextExtractor] Extend settings with preferred language

* TextExtractor simplifying code, adding update languages on dropdown opening

* fix typo

* TextExtractor fixing bug with order of languages
2022-12-28 19:54:59 +01:00
Clint Rutkas
1f4ba8f267 unit tests nugets updated (#22952) 2022-12-28 10:43:31 -08:00
Jaime Bernardo
c0b78835ac [GPO]Chore: move asset files to src path (#22906) 2022-12-28 19:01:00 +01:00
Sanidhya Singh
4fe1acab36 Fixes Ordered Lists Numbering (#22944)
- Previously there was a mixture of `1.` `1.` `1.` ... and `1.` `2.` `3.` ... indexing in the readme doc which is changed to a uniform use of  `1.` `1.` `1.` ....
- There were errors in numbering at 2 places which get fixed by this.
2022-12-23 09:09:55 -08:00
Jaime Bernardo
46099058b5 [common]Add null checks to FindDesktopFolderView (#22908) 2022-12-20 19:29:24 +00:00
Jaime Bernardo
4f4810acc4 [MouseHighlighter]Fix crash on non initialized shapes (#22907) 2022-12-20 19:29:05 +00:00
Laszlo Nemeth
3739b771e5 [ColorPicker]Fix localization of color names (#22837)
* [ColorPicker] Restructure to have color names localized

* [ColorPicker] Restrucure code to have localised color names

* Fix analyzer errors

* [ColorPicker] add comments
2022-12-20 15:03:25 +00:00
Ikko Ashimine
37cb62f6eb [ColorPicker]Fix typo in ColorFormatHelper.cs (#22873)
occurence -> occurrence
2022-12-20 15:02:20 +00:00
Jaime Bernardo
0de4750fad [Test]Update Microsoft.NET.Test.Sdk to 17.4.1 (#22900) 2022-12-20 14:22:37 +00:00
Seraphima Zykova
91ffe5e707 [FZEditor]Reduce layout shortcut tooltip delay (#22889) 2022-12-19 16:54:57 +00:00
Seraphima Zykova
d0c9350ac4 [FZEditor]Fix crash when deleting a zone while dragging it (#22884) 2022-12-19 16:51:27 +00:00
sosssego
6244604d03 [Analyzers][CPP]Turn on warning 26475 (#22824) 2022-12-18 16:00:55 +00:00
sosssego
5fd7e2f7e6 [Analyzers][CPP]Turn on warning 26819 (#22796) 2022-12-18 15:58:30 +00:00
Laszlo Nemeth
3cdac58070 [TextExtractor]Select OCR language in context menu (#22777)
* TextExtractor Add language selection.

* TextExtractor adding resources
2022-12-18 15:35:03 +00:00
Davide Giacometti
6d138e80fb [Analyzers] Update StyleCop and enable SA1200 (#22707)
* update StyleCop and enable SA1200

* Fix merge issues

* fix build and added using rule
2022-12-18 13:27:14 +00:00
sosssego
617150cf50 [Analyzers][CPP]Turn on warning 26410 (#22744) 2022-12-18 11:46:06 +00:00
sosssego
d1b55d9ff4 [Analyzers][CPP]Turn on warning 26427 (#22743) 2022-12-18 11:45:19 +00:00
sosssego
2f6d512614 [Analyzers][CPP]Turn on warning 26445 (#22644) 2022-12-18 11:31:43 +00:00
Stefan Markovic
c2325181ea Remove unused Newtonsoft.Json package references (#22812)
* Remove unused Newtonsoft.Json package references
Replace with System.Text.Json in Settings test

* spellcheck

* Remove obsolete test

* Revert settings part

* Revert "Revert settings part"

This reverts commit ad2934ce0b.

* Increase JS heap size in CI
2022-12-16 18:46:07 +01:00
Stefan Markovic
a6c13dcfbe Run settings elevated when PT is running elevated (#22815)
* Run settings elevated when PT is running elevated

* Address PR comment
2022-12-16 15:14:50 +01:00
Niels Laute
f574694cc0 [Settings]Improve Shortcut Control visibility and accessibility (#22813) 2022-12-16 14:03:54 +00:00
Niels Laute
b775d0710f [Settings] Custom color format UI tweaks (#22790)
* Custom color format tweaks

* Delete vs. remove

* Update expect.txt

* [ColorPicker]Support BGR and RGB decimal value formats (#22771)

* ColorPicker add both decimal value formats

* ColorPicker, custom format dialog, resizing columns

* Custom color format tweaks

* Delete vs. remove

* Update expect.txt

* Fix rebase

* Fix error
2022-12-16 10:15:55 +00:00
Jaime Bernardo
b17955c968 [FileLocksmith]Move hanging operations to a distinct thread (#22806) 2022-12-16 09:37:33 +00:00
Taras
0de7781b51 [Quick Accent]Fix the first character selection in the toolbar (#22808) 2022-12-16 09:36:55 +00:00
Jeremy Sinclair
57bde1c54c [ARM64][Build] Prefer Arm64 Build Tools when building from Arm64 devices (#22792)
* Set PreferredToolArchitecture to arm64 if Arm64 processor
2022-12-15 18:40:29 -05:00
sosssego
02aa5cab96 [Analyzers][CPP]Rewrite the ruleset to include cpp core guidelines rules (#22602) 2022-12-15 16:29:00 +00:00
Stefan Markovic
7674a6fe47 Bump WinAppSDK to v1.2 (#22733)
* Bump WinAppSDK to v1.2

* Remove AppWindowTitleBar.IsCustomizationSupported

* Fix resizing and background color
2022-12-15 12:17:56 +01:00
Laszlo Nemeth
96ac6a6a12 [ColorPicker]Support BGR and RGB decimal value formats (#22771)
* ColorPicker add both decimal value formats

* ColorPicker, custom format dialog, resizing columns
2022-12-15 09:33:17 +00:00
Davide Giacometti
5b4e678f14 [Hosts]Warn about duplicated entries (#22606)
* find duplicated entries

* addressed PR feedback

Co-authored-by: Davide <25966642+davidegiacometti@users.noreply.github.com>
2022-12-14 15:52:00 +00:00
Andon Dragomanov
b56e62e5de [QuickAccent]Added support for Macedonian accent letters (#22721)
* Added support for Macedonian accent letters

* Reordering of resources and enums by alphabetical order
2022-12-14 14:56:43 +00:00
char46
a167c8d3ac [Quick Accent]Add Pinyin accents (#22631)
* [Quick Accent]Add Pinyin accents

* Add Mandarin tone.

* Update Languages.cs

* add space before closing brace

* Remove CR from each lines
2022-12-14 14:35:57 +00:00
Stefan Markovic
6ac508fb93 Self-contained .NET (#22217)
* dotnet sc

* MD preview - C# app

 - working self-contained

* Gcode preview - C# app

* DevFiles preview - C# app

* Fix passing path with spaces as cmd arg and monacocpp proj file

* Pdf preview - C# app

* Svg preview - C# app

* Fix comment

* Gcode thumbnail - C# app

TODO:
	- installer
	- why IThumbnailProvider and IIntializeWithFile doesn't work?

* Pdf thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Pdf thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Fix GcodeThumbnailProviderCpp.vcxproj

* Svg thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Fix Svg tests

* Thumbnail providers - installer

* Self-contained Hosts and FileLocksmith

* Fix hardcoded <RuntimeIdentifier>

* Remove unneeded files

* Try to fix Nuget in PR CI

* Prefix new dlls with PowerToys.
Sign new dlls and exes

* Add new .exe files to ProcessList

* ci: debug by listing all env vars

* ci: try setting variable in the right ci file

* Bring back hardcoded RuntimeIdentifier

* ci: Add comment and remove debug action

* Remove unneeded lib

* [WIP] Platform conditional dotnet files & hardlinks

* Cleanup

* Update expect.txt

* Test fix - ARM installer

* Fix uninstall bug

* Update docs

* Fix failing test

* Add dll details

* Minor cleanup

* Improve resizing

* Add some logs

* Test fix - release build

* Remove InvokeOnControlThread

* Test fix: logger initialization

* Fix arm64 installer

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
2022-12-14 13:37:23 +01:00
Stefan Markovic
a2c0febccc [ci]Fix build error introduced by C# tools update (#22779)
* Fix build error introduced by C# tools update

* Remove duplicate project properties - included in Directory.Build.props
2022-12-14 11:43:02 +01:00
Taras
9cf404250b [Quick Accent] fix showing toolbar in the corner position (#22736)
* [Quick Accent] fix showing toolbar in the corner position

* [Quick Accent] set horizontal allignment according to toolbar position

* [Quick Accent] fix spelling mistake
2022-12-14 12:17:38 +02:00
Clint Rutkas
b5f6722ae7 Update to dev setup readme.md (#22687) 2022-12-13 10:13:13 -08:00
Jaime Bernardo
150f26731c [VCM]Only use File Watchers if module is enabled (#22757) 2022-12-13 17:35:23 +00:00
Davide Giacometti
d50b89262c [QuickAccent]Set initial selection when characters change (#22704) 2022-12-13 17:20:29 +00:00
Jaime Bernardo
f465daf585 [Logs]Don't create a thread for each logger (#22755) 2022-12-13 17:16:31 +00:00
Taras
f987a48b3a [Quick Accent]Increase default input delay to 300ms (#22680)
* [Quick Accent] change default input delay and default activation key

* [Quick Accent] use default activation key 'Both' as before

* [Quick Accent] use PowerAccentSettings.DefaultInputTimeMs

* [Quick Accent] add more comments
2022-12-13 17:15:56 +00:00
Laszlo Nemeth
ba0d41f743 [ColorPicker]Fixing decimal value calculation (#22669) 2022-12-13 16:59:57 +00:00
Laszlo Nemeth
9480013868 [Settings][Accessibility] Set name for ShortcutControl (#22622) 2022-12-13 14:14:09 +00:00
Clint Rutkas
96a4e071d6 Enable a new rule for fabric bot to aid in localization triaging (#22740) 2022-12-12 13:12:26 -08:00
sosssego
e42bbaaaf7 [Analyzers][CPP] Turn on warning 4702 (#22285)
* Turn on 4702
unreachable code

* fix warnings that didnt show locally

* add comments about disable warnings

* improve comments

* changes from comments

* fix from PR comments
2022-12-12 17:21:48 +00:00
Laszlo Nemeth
6cbb094cfb [Settings]Fix using navigation items in scan mode (#22545) 2022-12-12 16:34:21 +00:00
Davide Giacometti
cd1b7dbc2c cleaned-up dispose TODO (#22703) 2022-12-10 17:20:10 +01:00
Jaime Bernardo
6b199a1154 [ci]Skip C++ code analysis to speed up release pipelines (#22555)
C++ code analysis is a heavy process, which we are running in the PR CIs already, so code that gets into main should be checked already.
This PR conditionally removes C++ code analysis from the release pipelines. This saves 10-15 minutes in build time.

## Validation Steps Performed
Verified the release CI shaved some time off.
2022-12-09 18:09:26 -06:00
Niels Laute
b6a905709a [QuickAccent]Theming support (#22446)
* Adding theme awereness

* Adding theming colors

* High contrast

* Downgrade ModernWPF package

* Adding ModernWPF and PowerToys.Common.UI to installer

* Removing unused file and MahApps

* Removed MahApps from installer string

* fix projects and setup

* removed PowerAccent

* addressed PR feedback

Co-authored-by: Davide <25966642+davidegiacometti@users.noreply.github.com>
2022-12-09 20:40:00 +00:00
Laszlo Nemeth
e5d001e434 [ColorPicker]Fix format name duplicates (#22565)
* ColorPicker fix format name duplicates

* ColorPicker: extend settings-loading with security code which skips color formats with empty name or duplicate names

* Spell checker fix, typo, sorry
2022-12-09 16:30:06 +00:00
Jaime Bernardo
7d53b9a5b5 [Settings][Awake]Show display option on indefinite (#22596) 2022-12-09 16:27:49 +00:00
sosssego
febe1aa9a0 [Analyzers][CPP] Turn on warnings 26800, 28251, 6387 and 6248 (#22411) 2022-12-09 14:08:51 +00:00
AO2233
a8a618af1d [TextExtractor]Fix error blanks in Japanese OCR (#22443)
* fix error blanks in japanese OCR

Kanji ,Hiragana, Katakana, Hankaku-Katakana do not need blank. (not only the range of CJKUnifiedIdeographs). Maybe there are more symbols that don't require spaces like \u3001 \u3002. But give it to ocr engine to improve may be a better choice ?

* Update ImageMethods.cs

fixing spelling

* Update expect.txt

adding in Hankaku

* Update ImageMethods.cs
2022-12-09 14:07:45 +00:00
Daniel Richter
08d569ccf6 [PTRun] Drag and drop files (#22409)
* [PTRun] Support drag&drop to other application for files in result list

* [PTRun] use file/folder thumbnail as drag image

* (fix spellcheck)

* [PTRun] use _mouseDownResultViewModel.Image to generate the drag image

* fix spelling + refactoring
2022-12-09 13:01:44 +00:00
Laszlo Nemeth
bb92b03156 [ColorPicker]Use the new custom formats when picking colors without editor (#22552)
* ColorPicker fixing 'old' formats still represented in the old pre-defined format in color picker module.

* Fixing color picker tests, adding format strings
2022-12-09 11:21:59 +00:00
sosssego
d8b92662ba [Analyzers][CPP]Turn on warning 4505 (#22301)
* Turn on warning 4505
supress it in the fancyzone tests

* comment on disabled warnings

* improving comments

* change strategy to have less #pragma
2022-12-09 10:58:59 +00:00
Jaime Bernardo
f97cda9196 0.65 changelog (#22501)
Co-authored-by: Clint Rutkas <clint@rutkas.com>
2022-12-06 14:12:42 -08:00
Aaron Junker
759c5a2eb8 Update COMMUNITY.md (#22378) 2022-12-06 07:25:28 +01:00
Jaime Bernardo
d300b007f2 [ImageResizer]Fix silent context menu crash (#22503) 2022-12-05 23:53:59 +00:00
Laszlo Nemeth
ba9e2449f3 [Settings]Better logging when upgrading settings from a old format (#22497)
* SettingUtils fixing error reporting when reading settings in old format

* Making the error message even more informative
2022-12-05 18:52:43 +00:00
Jaime Bernardo
42c77d7d42 [Settings][GPO]Fix warning for FancyZones (#22496) 2022-12-05 17:34:16 +00:00
Laszlo Nemeth
5c01e3a826 [Settings][ColorPicker]Fix issues related to custom color formats (#22493)
* ColorPicker fixing problem settings not sent to CP module (when newly created formats change)

* ColorPicker fixing problem Move Up button diabled for the 2nd element of the color formats list after creating a new color format.
2022-12-05 17:22:32 +00:00
642 changed files with 12896 additions and 15083 deletions

View File

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

View File

@@ -860,6 +860,69 @@
],
"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,26 +46,35 @@
"modules\\FancyZones\\PowerToys.FancyZones.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodePreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.GcodeThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.ManagedTelemetry.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.powerpreview.dll",
"modules\\FileExplorerPreview\\PowerToys.PreviewHandlerCommon.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProviderCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.exe",
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandlerCpp.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.comhost.dll",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.exe",
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProviderCpp.dll",
"modules\\Hosts\\PowerToys.HostsModuleInterface.dll",
"modules\\Hosts\\PowerToys.Hosts.dll",
@@ -76,13 +85,6 @@
"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",
@@ -130,8 +132,6 @@
"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,6 +247,7 @@
"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,6 +9,8 @@ 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,6 +22,7 @@ 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:
@@ -38,6 +39,8 @@ 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
@@ -545,7 +548,7 @@ jobs:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: GPO Files'
inputs:
PathtoPublish: doc\gpo\assets
PathtoPublish: src\gpo\assets
ArtifactName: GroupPolicyObjectsFiles

View File

@@ -62,7 +62,8 @@ $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"))
(-not $_.Name.EndsWith("WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll")) -and
(-not $_.Name.EndsWith("System.Diagnostics.EventLog.Messages.dll"))
)
{
Write-Host "Version not set: " + $_.FullName

View File

@@ -18,10 +18,6 @@ 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.
@@ -87,7 +83,11 @@ 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
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.
### [@Niels9001](https://github.com/niels9001/) - [Niels Laute](https://nielslaute.com/)

View File

@@ -30,19 +30,24 @@
</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>26800;28251;6387;4505;4679;4702;6248;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>4679;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableAnalyzeExternal >true</DisableAnalyzeExternal>
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
<ConformanceMode>false</ConformanceMode>
@@ -115,4 +120,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. 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">
<RuleSet Name="Cpp Rule Set" Description="Based on Microsoft Native Recommended Rules and CPP core guideline rules." ToolsVersion="17.0">
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
<Rule Id="C26100" Action="Info" />
<Rule Id="C26101" Action="Info" />
@@ -10,31 +10,97 @@
<Rule Id="C26116" Action="Info" />
<Rule Id="C26117" Action="Info" />
<Rule Id="C26140" Action="Info" />
<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="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="C26451" Action="Error" />
<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="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="C26495" Action="Error" />
<Rule Id="C26498" Action="Info" />
<Rule Id="C26496" Action="Info" />
<Rule Id="C26497" Action="Info" />
<Rule Id="C26498" Action="Error" />
<Rule Id="C26800" Action="Info" />
<Rule Id="C26810" Action="Info" />
<Rule Id="C26810" Action="Error" />
<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="C26819" Action="Info" />
<Rule Id="C26820" Action="Info" />
<Rule Id="C26827" Action="Info" />
<Rule Id="C26828" 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="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.1.118">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<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-preview1.22464.1">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -421,8 +421,6 @@ 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}"
@@ -470,19 +468,23 @@ 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("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Peek", "Peek", "{17B4FA70-001E-4D33-BBBB-0D142DBC2E20}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MarkdownPreviewHandlerCpp", "src\modules\previewpane\MarkdownPreviewHandlerCpp\MarkdownPreviewHandlerCpp.vcxproj", "{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.UI.WPF", "src\modules\peek\Peek.UI.WPF\Peek.UI.WPF.csproj", "{C0240BC3-95AF-4B38-811A-76E3FD56B576}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GcodePreviewHandlerCpp", "src\modules\previewpane\GcodePreviewHandlerCpp\GcodePreviewHandlerCpp.vcxproj", "{5A5DD09D-723A-44D3-8F2B-293584C3D731}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Peek", "src\modules\peek\peek\peek.vcxproj", "{A1425B53-3D61-4679-8623-E64A0D3D0A48}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MonacoPreviewHandlerCpp", "src\modules\previewpane\MonacoPreviewHandlerCpp\MonacoPreviewHandlerCpp.vcxproj", "{B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.UI", "src\modules\peek\Peek.UI\Peek.UI.csproj", "{9D7A6DE0-7D27-424D-ABAE-41B2161F9A03}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PdfPreviewHandlerCpp", "src\modules\previewpane\PdfPreviewHandlerCpp\PdfPreviewHandlerCpp.vcxproj", "{54F7C616-FD41-4E62-BFF9-015686914F4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.Common", "src\modules\peek\Peek.Common\Peek.Common.csproj", "{17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SvgPreviewHandlerCpp", "src\modules\previewpane\SvgPreviewHandlerCpp\SvgPreviewHandlerCpp.vcxproj", "{143F13E3-D2E3-4D83-B035-356612D99956}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.FilePreviewer", "src\modules\peek\Peek.FilePreviewer\Peek.FilePreviewer.csproj", "{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GcodeThumbnailProviderCpp", "src\modules\previewpane\GcodeThumbnailProviderCpp\GcodeThumbnailProviderCpp.vcxproj", "{56CC2F10-6E41-453D-BE16-C593A5E58482}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIC", "src\modules\peek\WIC\WIC.csproj", "{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}"
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1713,18 +1715,6 @@ 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
@@ -1923,84 +1913,114 @@ 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
{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
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2141,7 +2161,6 @@ 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}
@@ -2163,13 +2182,15 @@ 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}
{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}
{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}
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 6.0.10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/6.0#runtime-desktop-6.0.10).
- [.NET 7.0.0 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/7.0#runtime-desktop-7.0.0).
- [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.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)
- **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)
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,18 +73,15 @@ 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.64 - October 2022 Update
### 0.65 - November 2022 Update
In this release, we focused on releasing new features and improvements.
In this release, we focused on stability and improvements.
**Highlights**
- 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.
- 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.
### Known issues
@@ -92,100 +89,127 @@ In this release, we focused on releasing new features 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
- Detect and put a window on top again if it's no longer 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.
### Color Picker
- Added the hexadecimal integer format. Thanks [@marius-bughiu](https://github.com/marius-bughiu)!
- 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.
### FancyZones
- 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.
- 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)!
### File Locksmith
- Added a new utility: File Locksmith.
- Thanks [@niels9001](https://github.com/niels9001) for the design on the UI!
- 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)
### Group Policy Objects
- 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!
- 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)
### Hosts File Editor
- 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!
- 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)!
### 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)!
### Image Resizer
- Fixed a silent crash when trying to show the tier 1 context menu on Windows 11.
### PowerToys Run
- 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)!
- 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)!
### Quick Accent
- 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.
- 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.
### Screen Ruler
### Runner
- Improved the acrylic brush used in the menu. Thanks [@niels9001](https://github.com/niels9001)!
- Fixed a crash on a racing condition accessing the IPC communication with Settings.
### Settings
- 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)!
- 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.
### 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)!
### Shortcut Guide
- Added a setting to make the shortcuts and taskbar icons have different configurable response times. Thanks [@OkamiWong](https://github.com/OkamiWong)!
### 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.
### Installer
- 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)
- 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.
### Documentation
- Added the core team to COMMUNITY.md
### Development
- 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)!
- 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)!
- Turned on C++ code analysis and incrementally fixing warnings.
- 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)!
- 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)!
#### What is being planned for version 0.65
#### What is being planned for version 0.66
For [v0.65][github-next-release-work], we'll work on below:
For [v0.66][github-next-release-work], we'll work on below:
- Ship .NET self contained and shared between utilities
- Stability / bug fixes
@@ -215,5 +239,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%2F38
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F37
[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

View File

@@ -38,16 +38,17 @@ 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
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`
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`
### 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
2. Navigate to the folder you cloned PowerToys to.
3. Run `git submodule update --init --recursive`
1. Navigate to the folder you cloned PowerToys to.
1. Run `git submodule update --init --recursive`
### Compiling Source Code
@@ -64,22 +65,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.
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)
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)
### Prerequisites for building the MSI installer
1. Install the [WiX Toolset Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension).
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`.
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`.
### Locally building the installer prerequisite projects all at once from the command-line
1. Open a `Developer Command Prompt for VS 2022`
2. Ensure `nuget.exe` is in your `%path%`
3. In the repo root, run these commands:
1. Ensure `nuget.exe` is in your `%path%`
1. In the repo root, run these commands:
```
nuget restore .\tools\BugReportTool\BugReportTool.sln
@@ -95,26 +96,26 @@ msbuild -p:Platform=x64 -p:Configuration=Release .\tools\StylesReportTool\Styles
### Locally compiling the Bug reporting tool
1. Open `tools\BugReportTool\BugReportTool.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
### Locally compiling the Webcam reporting tool
1. Open `tools\WebcamReportTool\WebcamReportTool.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
### Locally compiling the Window styles reporting tool
1. Open `tools\StylesReportTool\StylesReportTool.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
### Locally compiling the installer
1. Open `installer\PowerToysSetup.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu choose `Build Solution`.
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. 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,21 +6,13 @@
<?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"?>
<?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-->
<!--TODO: define to ARM64 Program files once it's available-->
<?define PlatformProgramFiles="[ProgramFiles6432Folder]"?>
<?endif?>
@@ -41,7 +33,6 @@
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" />
@@ -73,26 +64,6 @@
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,6 +15,8 @@
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Management.Deployment.h>
#include "DepsFilesLists.h"
using namespace std;
HINSTANCE DLL_HANDLE = nullptr;
@@ -32,56 +34,6 @@ 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
@@ -504,7 +456,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, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -621,7 +573,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, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -894,7 +846,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to add certificate to store"));
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -926,7 +878,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to install virtual camera driver"));
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -967,7 +919,7 @@ LExit:
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("Failed to uninstall virtual camera driver"));
MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
}
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
@@ -1103,6 +1055,7 @@ const std::wstring PTInteropConsumers[] =
L"modules\\PowerAccent",
L"modules\\FileLocksmith",
L"modules\\Hosts",
L"modules\\FileExplorerPreview",
};
UINT __stdcall CreatePTInteropHardlinksCA(MSIHANDLE hInstall)
@@ -1141,6 +1094,87 @@ 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;
@@ -1213,6 +1247,78 @@ 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;
@@ -1230,7 +1336,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));
std::array<std::wstring_view, 10> processesToTerminate = {
std::array<std::wstring_view, 9> processesToTerminate = {
L"PowerToys.PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.Awake.exe",
@@ -1239,7 +1345,6 @@ 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,6 +7,8 @@ EXPORTS
DeleteWinAppSDKHardlinksCA
CreatePTInteropHardlinksCA
DeletePTInteropHardlinksCA
CreateDotnetRuntimeHardlinksCA
DeleteDotnetRuntimeHardlinksCA
DetectPrevInstallPathCA
RemoveScheduledTasksCA
TelemetryLogInstallSuccessCA

View File

@@ -0,0 +1,535 @@
#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,6 +109,7 @@
<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,6 +14,7 @@
</ClInclude>
<ClInclude Include="resource.h" />
<ClInclude Include="RcResource.h" />
<ClInclude Include="DepsFilesLists.h" />
</ItemGroup>
<ItemGroup>
<None Include="CustomAction.def" />

View File

@@ -8,7 +8,6 @@ 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,7 +12,6 @@ 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,7 +15,8 @@
"newlineAtEndOfFile": "require"
},
"orderingRules": {
"usingDirectivesPlacement": "outsideNamespace"
"usingDirectivesPlacement": "outsideNamespace",
"systemUsingDirectivesFirst": true
}
}
}

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,10 +285,15 @@ namespace ManagedCommon
{ "Xv", 'i' }, // X value int
{ "Yv", 'i' }, // Y value int
{ "Zv", 'i' }, // Z value int
{ "Dv", 'i' }, // Decimal value int
{ "Na", 's' }, // Color name string
{ "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
};
public static string GetColorNameParameter() => "%Na";
private static readonly Dictionary<char, string> FormatTypeToStringFormatters = new Dictionary<char, string>()
{
{ 'b', "b" }, // 0..255 byte
@@ -347,7 +352,7 @@ namespace ManagedCommon
formatString = string.Concat(formatString.AsSpan(0, formatterPosition), GetStringRepresentation(color.Value, paramFormat, paramType), formatString.AsSpan(formatterPosition + paramCount + 1));
}
// search for the next occurence of the formatter char
// search for the next occurrence of the formatter char
formatterPosition = formatString.IndexOf('%', formatterPosition + 1);
}
@@ -447,10 +452,14 @@ 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);
case "Na":
return ColorNameHelper.GetColorName(color);
// Removed Parameter Na, as the color name gets replaced separately, in localised way
// 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 =
{
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,
"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",
};
private static string[] colorNamesMid =
{
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,
"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",
};
private static string[] colorNamesDark =
{
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,
"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",
};
public static string GetColorName(Color color)
public static string GetColorNameIdentifier(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 CommonResources.TEXT_COLOR_WHITE;
return "TEXT_COLOR_WHITE";
}
else if (lum < 20)
{
return CommonResources.TEXT_COLOR_BLACK;
return "TEXT_COLOR_BLACK";
}
if (sat <= 20)
{
if (lum > 170)
{
return CommonResources.TEXT_COLOR_LIGHTGRAY;
return "TEXT_COLOR_LIGHTGRAY";
}
else if (lum > 100)
{
return CommonResources.TEXT_COLOR_GRAY;
return "TEXT_COLOR_GRAY";
}
else
{
return CommonResources.TEXT_COLOR_DARKGRAY;
return "TEXT_COLOR_DARKGRAY";
}
}

View File

@@ -59,383 +59,5 @@ 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,172 +117,4 @@
<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,12 +2,17 @@
#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(UINT(123), object.get_code());
Assert::AreEqual(123U, object.get_code());
}
TEST_METHOD (GetCodeFromJsonString)
{
HotkeyObject object = HotkeyObject::from_json_string(m_defaultHotkeyJson.Stringify());
Assert::AreEqual(UINT(123), object.get_code());
Assert::AreEqual(123U, object.get_code());
}
TEST_METHOD (GetCodeFromSettings)
{
HotkeyObject object = HotkeyObject::from_settings(true, true, true, true, 123);
Assert::AreEqual(UINT(123), object.get_code());
Assert::AreEqual(123U, object.get_code());
}
TEST_METHOD (GetWinPressedFromJson)

View File

@@ -12,6 +12,11 @@
#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,8 +66,6 @@ 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,10 +47,9 @@
</PropertyGroup>
<ItemGroup>
<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" />
<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" />
</ItemGroup>
<ItemGroup>

View File

@@ -203,13 +203,28 @@ 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,8 +44,20 @@ 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 to show Peek
const wchar_t SHOW_PEEK_SHARED_EVENT[] = L"Local\\ShowPeekEvent";
// 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";
// Max DWORD for key code to disable keys.
const DWORD VK_DISABLED = 0x100;

View File

@@ -58,18 +58,24 @@ bool Logger::wasLogFailedShown()
void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring_view logSettingsPath)
{
auto logLevel = getLogLevel(logSettingsPath);
bool newLoggerCreated = false;
try
{
auto sink = make_shared<daily_file_sink_mt>(logFilePath, 0, 0, false, LogSettings::retention);
if (IsDebuggerPresent())
logger = spdlog::get(loggerName);
if (logger == nullptr)
{
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);
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;
}
}
catch (...)
@@ -89,10 +95,14 @@ void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring
return;
}
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));
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->info("{} logger is initialized", loggerName);
}

View File

@@ -15,6 +15,24 @@ 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,6 +67,10 @@ 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.
@@ -126,6 +130,7 @@ 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)
if (result != S_OK || spShellWindows == nullptr)
{
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)
if (result != S_OK || spdisp == nullptr)
{
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)
if (result != S_OK || spBrowser == nullptr)
{
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)
if (result != S_OK || spView == nullptr)
{
Logger::warn(L"Failed to query active shell window. {}", GetErrorString(result));
return false;
}
result = spView->QueryInterface(riid, ppv);
if (result != S_OK)
if (result != S_OK || ppv == nullptr || *ppv == nullptr )
{
Logger::warn(L"Failed to query interface. {}", GetErrorString(result));
return false;

View File

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

View File

@@ -315,11 +315,10 @@ 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;
@@ -331,9 +330,6 @@ 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)
{
@@ -356,13 +352,10 @@ 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"Both" },
{ scope, versionPath, L"Assembly", assemblyKeyValue },
{ scope, versionPath, L"Class", className } };
{ scope, inprocServerPath, L"ThreadingModel", L"Apartment" } };
for (const auto& fileType : fileTypes)
{

View File

@@ -1,6 +1,8 @@
#include "pch.h"
#include "NtdllExtensions.h"
#include <thread>
#include <atomic>
#define STATUS_INFO_LENGTH_MISMATCH ((LONG)0xC0000004)
@@ -165,66 +167,116 @@ std::vector<NtdllExtensions::HandleInfo> NtdllExtensions::handles() noexcept
std::vector<BYTE> object_info_buffer(DefaultResultBufferSize);
for (ULONG i = 0; i < info_ptr->HandleCount; i++)
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)
{
auto handle_info = info_ptr->Handles + i;
DWORD pid = handle_info->ProcessId;
previous_i = i;
HANDLE process_handle = NULL;
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)
// 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++)
{
continue;
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;
}
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 handle_copy;
auto dh_result = DuplicateHandle(process_handle, (HANDLE)handle_info->Handle, GetCurrentProcess(), &handle_copy, 0, 0, DUPLICATE_SAME_ACCESS);
if (dh_result == 0)
offload_function.detach();
do
{
// Ignore this handle.
continue;
}
Sleep(200); // Timeout in milliseconds for detecting that the system hang on getting information for a handle.
if (i >= handle_count)
{
// We're done.
break;
}
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;
}
if (previous_i >= i)
{
// The thread looks like it's hanging on some handle. Let's kill it and resume.
auto object_type_info = (OBJECT_TYPE_INFORMATION*)object_info_buffer.data();
auto type_name = unicode_to_str(object_type_info->Name);
// 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);
std::wstring file_name = file_handle_to_kernel_name(handle_copy, object_info_buffer);
// Close Handles that might be lingering.
if (handle_copy!=NULL)
{
CloseHandle(handle_copy);
}
i++;
break;
}
previous_i = i;
} while (1);
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;
DWORD pid = 0;
std::wstring name;
std::wstring user;
std::vector<std::wstring> modules;

View File

@@ -35,6 +35,7 @@ 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;
@@ -102,7 +103,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))
{
@@ -157,7 +158,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;
@@ -181,7 +182,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)
@@ -230,7 +231,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,6 +20,8 @@
<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,6 +21,15 @@
<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>
@@ -57,9 +66,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.1.5" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<Manifest Include="$(ApplicationManifest)" />

View File

@@ -3,10 +3,7 @@
// 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
@@ -22,24 +19,8 @@ namespace FileLocksmithUI
private void SetTitleBar()
{
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");
}
ExtendsContentIntoTitleBar = true;
SetTitleBar(titleBar);
}
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>false</SelfContained>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

View File

@@ -2,23 +2,20 @@
// 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
@@ -31,7 +28,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,11 +15,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.0" />
<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="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="System.IO.Abstractions" Version="17.2.3" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.2.3" />
</ItemGroup>

View File

@@ -21,6 +21,8 @@
<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}" />
@@ -40,20 +42,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,6 +20,15 @@
<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 -->
@@ -41,8 +50,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.1.5" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<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,10 +3,7 @@
// 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
@@ -17,34 +14,14 @@ namespace Hosts
{
InitializeComponent();
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);
}
}
SetTitleBar();
BringToForeground();
}
private void SetTitleBar()
{
AppWindow window = this.GetAppWindow();
window.TitleBar.ExtendsContentIntoTitleBar = true;
window.TitleBar.ButtonBackgroundColor = Colors.Transparent;
ExtendsContentIntoTitleBar = true;
SetTitleBar(titleBar);
}

View File

@@ -35,6 +35,7 @@ namespace Hosts.Models
{
SetProperty(ref _hosts, value);
OnPropertyChanged(nameof(Valid));
SplittedHosts = _hosts.Split(' ');
}
}
@@ -50,8 +51,13 @@ 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,6 +184,9 @@
<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>
@@ -234,6 +237,10 @@
<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>
@@ -243,6 +250,9 @@
<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,8 +1,9 @@
// 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;
@@ -13,7 +14,6 @@ using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.WinUI;
using Hosts.Helpers;
using Hosts.Models;
using Hosts.Settings;
using Microsoft.UI.Dispatching;
namespace Hosts.ViewModels
@@ -21,7 +21,6 @@ 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;
@@ -34,6 +33,9 @@ namespace Hosts.ViewModels
[ObservableProperty]
private bool _fileChanged;
[ObservableProperty]
private bool _filtered;
[ObservableProperty]
private string _addressFilter;
@@ -44,50 +46,15 @@ namespace Hosts.ViewModels
private string _commentFilter;
[ObservableProperty]
private bool _filtered;
[NotifyPropertyChangedFor(nameof(Entries))]
private bool _showOnlyDuplicates;
[ObservableProperty]
private string _additionalLines;
private ObservableCollection<Entry> _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 ObservableCollection<Entry> Entries => _filtered || _showOnlyDuplicates ? GetFilteredEntries() : _entries;
public ICommand ReadHostsCommand => new RelayCommand(ReadHosts);
@@ -99,12 +66,9 @@ namespace Hosts.ViewModels
public ICommand OpenHostsFileCommand => new RelayCommand(OpenHostsFile);
public MainViewModel(
IHostsService hostService,
IUserSettings userSettings)
public MainViewModel(IHostsService hostService)
{
_hostsService = hostService;
_userSettings = userSettings;
_hostsService.FileChanged += (s, e) =>
{
@@ -116,24 +80,35 @@ 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 existingEntry = Entries.ElementAt(index);
var oldAddress = existingEntry.Address;
var oldHosts = existingEntry.SplittedHosts;
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);
if (Filtered)
{
OnPropertyChanged(nameof(Entries));
}
FindDuplicates(address, hosts);
OnPropertyChanged(nameof(Entries));
}
public void UpdateAdditionalLines(string lines)
@@ -157,7 +132,7 @@ namespace Hosts.ViewModels
await _dispatcherQueue.EnqueueAsync(() =>
{
Entries = new ObservableCollection<Entry>(entries);
_entries = new ObservableCollection<Entry>(entries);
foreach (var e in _entries)
{
@@ -165,17 +140,24 @@ namespace Hosts.ViewModels
}
_entries.CollectionChanged += Entries_CollectionChanged;
OnPropertyChanged(nameof(Entries));
FindDuplicates();
});
});
}
public void ApplyFilters()
{
if (_entries != null)
if (_entries == null)
{
Filtered = !string.IsNullOrWhiteSpace(_addressFilter) || !string.IsNullOrWhiteSpace(_hostsFilter) || !string.IsNullOrWhiteSpace(_commentFilter);
OnPropertyChanged(nameof(Entries));
return;
}
Filtered = !string.IsNullOrWhiteSpace(_addressFilter)
|| !string.IsNullOrWhiteSpace(_hostsFilter)
|| !string.IsNullOrWhiteSpace(_commentFilter);
OnPropertyChanged(nameof(Entries));
}
public void ClearFilters()
@@ -183,6 +165,7 @@ namespace Hosts.ViewModels
AddressFilter = null;
HostsFilter = null;
CommentFilter = null;
ShowOnlyDuplicates = false;
}
public async Task PingSelectedAsync()
@@ -212,8 +195,10 @@ namespace Hosts.ViewModels
private void Entry_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
// Ping should't trigger a file save
if (e.PropertyName == nameof(Entry.Ping) || e.PropertyName == nameof(Entry.Pinging))
// 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))
{
return;
}
@@ -234,6 +219,68 @@ 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,6 +116,9 @@
</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"
@@ -151,7 +154,6 @@
</StackPanel>
</Grid>
<StackPanel
Grid.Row="2"
Orientation="Vertical"
@@ -205,6 +207,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<FlyoutBase.AttachedFlyout>
<MenuFlyout>
@@ -254,6 +257,7 @@
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"
@@ -306,9 +310,18 @@
</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="3"
Grid.Column="4"
Width="40"
MinWidth="0"
HorizontalAlignment="Right"
@@ -384,7 +397,6 @@
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollMode="Enabled"
TextWrapping="Wrap" />
</ContentDialog>
</Grid>
</Page>

View File

@@ -4,7 +4,13 @@
#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,7 +74,12 @@ HRESULT __stdcall PerGlyphOpacityTextRender::DrawGlyphRun(void* /*clientDrawingC
auto opacityEffect = clientDrawingEffect.try_query<IDrawingEffect>();
if (opacityEffect)
_baseBrush->SetOpacity(static_cast<OpacityEffect*>(opacityEffect.get())->alpha);
{
const auto temp_opacity = dynamic_cast<OpacityEffect*>(opacityEffect.get());
assert(nullptr != temp_opacity);
_baseBrush->SetOpacity(temp_opacity->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.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.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.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.1.5\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.1.5\build\native\Microsoft.WindowsAppSDK.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')" />
<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.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.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.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.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')" />
</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.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.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.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.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'))" />
<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'))" />
</Target>
</Project>

View File

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

View File

@@ -197,13 +197,9 @@ 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 = new D3DCaptureState{ dxgiAPI,
std::move(swapChain),
pixelFormat,
std::move(monitorInfo),
continuousCapture };
auto statePtr = std::unique_ptr<D3DCaptureState>(new D3DCaptureState{ dxgiAPI, std::move(swapChain), pixelFormat, std::move(monitorInfo), continuousCapture });
return std::unique_ptr<D3DCaptureState>{ statePtr };
return 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.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.755" targetFramework="native" />
</packages>

View File

@@ -13,11 +13,10 @@ 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,7 +13,6 @@
<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>
@@ -22,6 +21,14 @@
<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 -->
@@ -63,8 +70,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

View File

@@ -204,6 +204,12 @@ 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)
internal static async Task<string> GetRegionsText(Window? passedWindow, Rectangle selectedRegion, Language? preferredLanguage)
{
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);
string? resultText = await ExtractText(bmp, preferredLanguage);
return resultText != null ? resultText.Trim() : string.Empty;
}
internal static async Task<string> GetClickedWord(Window passedWindow, System.Windows.Point clickedPoint)
internal static async Task<string> GetClickedWord(Window passedWindow, System.Windows.Point clickedPoint, Language? preferredLanguage)
{
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,13 +85,18 @@ internal class ImageMethods
System.Windows.Point adjustedPoint = new System.Windows.Point(clickedPoint.X, clickedPoint.Y);
string resultText = await ExtractText(bmp, adjustedPoint);
string resultText = await ExtractText(bmp, preferredLanguage, adjustedPoint);
return resultText.Trim();
}
public static async Task<string> ExtractText(Bitmap bmp, System.Windows.Point? singlePoint = null)
public static async Task<string> ExtractText(Bitmap bmp, Language? preferredLanguage, System.Windows.Point? singlePoint = null)
{
Language? selectedLanguage = GetOCRLanguage();
Language? selectedLanguage = preferredLanguage;
if (selectedLanguage == null)
{
selectedLanguage = GetOCRLanguage();
}
if (selectedLanguage == null)
{
return string.Empty;
@@ -147,7 +152,10 @@ internal class ImageMethods
}
else
{
var cjkRegex = new Regex(@"\p{IsCJKUnifiedIdeographs}");
// 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]");
foreach (OcrLine ocrLine in ocrResult.Lines)
{

View File

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

View File

@@ -3,13 +3,18 @@
// 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;
@@ -30,6 +35,9 @@ 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;
@@ -47,6 +55,52 @@ 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)
@@ -78,7 +132,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)
@@ -259,11 +313,11 @@ public partial class OCROverlay : Window
if (regionScaled.Width < 3 || regionScaled.Height < 3)
{
grabbedText = await ImageMethods.GetClickedWord(this, new Point(xDimScaled, yDimScaled));
grabbedText = await ImageMethods.GetClickedWord(this, new Point(xDimScaled, yDimScaled), selectedLanguage);
}
else
{
grabbedText = await ImageMethods.GetRegionsText(this, regionScaled);
grabbedText = await ImageMethods.GetRegionsText(this, regionScaled, selectedLanguage);
}
if (string.IsNullOrWhiteSpace(grabbedText) == false)

View File

@@ -10,6 +10,15 @@
<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,5 +8,7 @@ public interface IUserSettings
{
SettingItem<string> ActivationShortcut { get; }
SettingItem<string> PreferredLanguage { get; }
void SendSettingsTelemetry();
}

View File

@@ -29,6 +29,7 @@ namespace PowerOCR.Settings
{
_settingsUtils = new SettingsUtils();
ActivationShortcut = new SettingItem<string>(DefaultActivationShortcut);
PreferredLanguage = new SettingItem<string>(string.Empty);
LoadSettingsFromJson();
@@ -38,6 +39,8 @@ 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
@@ -64,6 +67,7 @@ namespace PowerOCR.Settings
if (settings != null)
{
ActivationShortcut.Value = settings.Properties.ActivationShortcut.ToString();
PreferredLanguage.Value = settings.Properties.PreferredLanguage.ToString();
}
retry = false;

View File

@@ -74,7 +74,6 @@ 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,8 +17,15 @@
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PackageProjectUrl>https://awake.den.dev</PackageProjectUrl>
<RepositoryUrl>https://github.com/microsoft/powertoys</RepositoryUrl>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Recommended</AnalysisMode>
<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 -->

View File

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

View File

@@ -30,7 +30,7 @@ using Windows.Win32.System.Power;
namespace Awake
{
internal class Program
internal sealed 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,7 +66,9 @@
<ResourceCompile Include="Generated Files\ColorPicker.rc" />
</ItemGroup>
<ItemGroup>
<None Include="Resources.resx" />
<None Include="Resources.resx">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />

View File

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

View File

@@ -38,19 +38,21 @@ 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,7 +9,17 @@
<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,7 +2,6 @@
// 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
@@ -17,7 +16,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,26 +34,17 @@ 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)
=> colorRepresentationType switch
{
if (string.IsNullOrEmpty(colorFormat))
{
"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),
};
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);
}
}
/// <summary>
/// Return a <see cref="string"/> representation of a CMYK color
@@ -130,7 +121,7 @@ namespace ColorPicker.Helpers
/// <returns>a string value number</returns>
private static string ColorToDecimal(Color color)
{
return $"{color.R + (color.G * 256) + (color.B * 65536)}";
return $"{(color.R * 65536) + (color.G * 256) + color.B}";
}
/// <summary>
@@ -283,5 +274,60 @@ 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,12 +162,9 @@ 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,6 +4,7 @@
using System;
using System.Windows.Media;
using ColorPicker.Helpers;
using ManagedCommon;
namespace ColorPicker.Models
@@ -23,7 +24,10 @@ namespace ColorPicker.Models
return Convert(color);
}
return ColorFormatHelper.GetStringRepresentation(System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B), FormatString);
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);
}
}
}

View File

@@ -330,6 +330,384 @@ 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,4 +232,172 @@
<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 = ColorNameHelper.GetColorName(color);
ColorName = ColorRepresentationHelper.GetColorNameFromColorIdentifier(ColorNameHelper.GetColorNameIdentifier(color));
}
/// <summary>

View File

@@ -5,7 +5,6 @@
using System;
using System.Drawing;
using System.Globalization;
using ColorPicker.Helpers;
using ManagedCommon;
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -57,13 +56,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
@@ -106,13 +105,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
@@ -155,13 +154,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]
@@ -199,16 +198,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
@@ -249,13 +248,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
@@ -297,13 +296,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
@@ -345,13 +344,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]
@@ -401,13 +400,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,
@@ -465,13 +464,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,6 +4,7 @@
using System.Drawing;
using ColorPicker.Helpers;
using ManagedCommon;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.ColorPicker.UnitTests
@@ -29,7 +30,7 @@ namespace Microsoft.ColorPicker.UnitTests
public void GetStringRepresentationTest(string type, string expected)
{
var result = ColorRepresentationHelper.GetStringRepresentation(Color.Black, type, string.Empty);
var result = ColorRepresentationHelper.GetStringRepresentation(Color.Black, type, ColorFormatHelper.GetDefaultFormat(type));
Assert.AreEqual(result, expected);
}
}

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