diff --git a/.github/workflows/cd-sideload-preview.yml b/.github/workflows/cd-sideload-preview.yml index 26b25eb55a75..2c7da7df9938 100644 --- a/.github/workflows/cd-sideload-preview.yml +++ b/.github/workflows/cd-sideload-preview.yml @@ -47,7 +47,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json @@ -74,10 +74,6 @@ jobs: run: | for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_NAME' - - name: Restore Files shell: pwsh run: | @@ -85,14 +81,16 @@ jobs: -t:Restore ` -p:Platform=$env:PLATFORM ` -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -v:quiet - name: Build launcher project shell: pwsh run: | msbuild "$env:LAUNCHER_PROJECT_PATH" ` -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -v:quiet - name: Build & package Files shell: pwsh @@ -107,7 +105,8 @@ jobs: -p:AppxBundle=Always ` -p:UapAppxPackageBuildMode=Sideload ` -p:GenerateAppInstallerFile=True ` - -p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL + -p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL ` + -v:quiet - name: Remove empty files from the packages shell: bash diff --git a/.github/workflows/cd-sideload-stable.yml b/.github/workflows/cd-sideload-stable.yml index 7a6d4a24e22a..00a3396f843f 100644 --- a/.github/workflows/cd-sideload-stable.yml +++ b/.github/workflows/cd-sideload-stable.yml @@ -47,7 +47,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json @@ -74,10 +74,6 @@ jobs: run: | for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_NAME' - - name: Restore Files shell: pwsh run: | @@ -85,14 +81,16 @@ jobs: -t:Restore ` -p:Platform=$env:PLATFORM ` -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -v:quiet - name: Build launcher project shell: pwsh run: | msbuild "$env:LAUNCHER_PROJECT_PATH" ` -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -v:quiet - name: Build & package Files shell: pwsh @@ -107,7 +105,8 @@ jobs: -p:AppxBundle=Always ` -p:UapAppxPackageBuildMode=Sideload ` -p:GenerateAppInstallerFile=True ` - -p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL + -p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL ` + -v:quiet - name: Remove empty files from the packages shell: bash diff --git a/.github/workflows/cd-store-preview.yml b/.github/workflows/cd-store-preview.yml index f4a1df97ab60..0a9c8d652b2c 100644 --- a/.github/workflows/cd-store-preview.yml +++ b/.github/workflows/cd-store-preview.yml @@ -44,7 +44,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json @@ -71,10 +71,6 @@ jobs: run: | for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_NAME' - - name: Restore Files shell: pwsh run: | @@ -82,14 +78,16 @@ jobs: -t:Restore ` -p:Platform=$env:PLATFORM ` -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -v:quiet - name: Build launcher project shell: pwsh run: | msbuild "$env:LAUNCHER_PROJECT_PATH" ` -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -v:quiet - name: Build & package Files shell: pwsh @@ -102,7 +100,8 @@ jobs: -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` -p:AppxPackageDir="$env:APPX_PACKAGE_DIR" ` -p:AppxBundle=Always ` - -p:UapAppxPackageBuildMode=StoreUpload + -p:UapAppxPackageBuildMode=StoreUpload ` + -v:quiet - name: Remove empty files from the packages shell: bash diff --git a/.github/workflows/cd-store-stable.yml b/.github/workflows/cd-store-stable.yml index 1b5113bb106f..e00aa5aa6d7b 100644 --- a/.github/workflows/cd-store-stable.yml +++ b/.github/workflows/cd-store-stable.yml @@ -44,7 +44,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json @@ -71,10 +71,6 @@ jobs: run: | for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_NAME' - - name: Restore Files shell: pwsh run: | @@ -82,14 +78,16 @@ jobs: -t:Restore ` -p:Platform=$env:PLATFORM ` -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -v:quiet - name: Build launcher project shell: pwsh run: | msbuild "$env:LAUNCHER_PROJECT_PATH" ` -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -v:quiet - name: Build & package Files shell: pwsh @@ -102,7 +100,8 @@ jobs: -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` -p:AppxPackageDir="$env:APPX_PACKAGE_DIR" ` -p:AppxBundle=Always ` - -p:UapAppxPackageBuildMode=StoreUpload + -p:UapAppxPackageBuildMode=StoreUpload ` + -v:quiet - name: Remove empty files from the packages shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ced14a40b6f7..415fc84129a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 - name: Install XamlStyler.Console @@ -103,15 +103,11 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_PATH' - - name: Restore Files shell: pwsh run: | @@ -119,7 +115,8 @@ jobs: -t:Restore ` -p:Platform=$env:ARCHITECTURE ` -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -v:quiet - if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE name: Build Files @@ -127,10 +124,10 @@ jobs: msbuild ` $env:PACKAGE_PROJECT_PATH ` -t:Build ` - -clp:ErrorsOnly ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:ARCHITECTURE ` - -p:AppxBundle=Never + -p:AppxBundle=Never ` + -v:quiet - if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE name: Create self signed cert as a pfx file @@ -143,7 +140,6 @@ jobs: $env:PACKAGE_PROJECT_PATH ` -t:Build ` -t:_GenerateAppxPackage ` - -clp:ErrorsOnly ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:ARCHITECTURE ` -p:AppxBundlePlatforms=$env:AUTOMATED_TESTS_ARCHITECTURE ` @@ -153,16 +149,17 @@ jobs: -p:AppxPackageSigningEnabled=true ` -p:PackageCertificateKeyFile=$env:APPX_SELFSIGNED_CERT_PATH ` -p:PackageCertificatePassword="" ` - -p:PackageCertificateThumbprint="" + -p:PackageCertificateThumbprint="" ` + -v:quiet - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION name: Build interaction tests run: | msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` -t:Build ` - -clp:ErrorsOnly ` -p:Configuration=$env:CONFIGURATION ` - -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE + -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE ` + -v:quiet - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION name: Copy tests bin to the artifacts dir @@ -204,7 +201,7 @@ jobs: - name: Checkout the repository uses: actions/checkout@v4 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json diff --git a/.github/workflows/format-xaml.yml b/.github/workflows/format-xaml.yml index a55f8254b09f..33f002998144 100644 --- a/.github/workflows/format-xaml.yml +++ b/.github/workflows/format-xaml.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v4 if: env.CAN_RUN == 1 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v4 - name: Set git identity diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000000..173535a6c335 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,9 @@ + + + + net9.0 + 10.0.22621.0 + 10.0.19041.0 + 10.0.22621.57 + + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 000000000000..6eba73837d51 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,57 @@ + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Files.sln b/Files.sln index bac074bf0609..e96ecb49a05a 100644 --- a/Files.sln +++ b/Files.sln @@ -1,56 +1,56 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.1.32421.90 +VisualStudioVersion = 17.12.35707.178 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A74DCE98-A744-4D71-A2B1-7EE4FED0936B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{481DE2EA-E6CE-4A9C-A220-3B543B95AAA1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{8D626EA8-CB54-BC41-363A-217881BEBA6E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "platforms", "platforms", "{A188C26B-E731-4E0B-9D17-D21CEBD9B43F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.Core.SourceGenerator", "src\Files.Core.SourceGenerator\Files.Core.SourceGenerator.csproj", "{7B50ED23-B535-E658-9542-00885ED406FA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{9F36C2AD-005D-4EA5-A1F1-6BC42773FC85}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.Core.Storage", "src\Files.Core.Storage\Files.Core.Storage.csproj", "{0CD123D7-CAE3-0F58-73C0-8BF39753B788}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Shared", "src\Files.Shared\Files.Shared.csproj", "{94F77692-D47C-48D8-A1A7-645192EF38A4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.Shared", "src\Files.Shared\Files.Shared.csproj", "{6C01E445-3C11-C76F-CE47-0B9A775ACF0A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.Storage", "src\Files.App.Storage\Files.App.Storage.csproj", "{B8051E11-5BF2-49F7-A7C8-E3820DBB8209}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "platforms", "platforms", "{82099983-647E-F067-E69A-CD800643A918}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Core.Storage", "src\Files.Core.Storage\Files.Core.Storage.csproj", "{53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}" +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Files.Package", "src\Files.App (Package)\Files.Package.wapproj", "{66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.BackgroundTasks", "src\Files.App.BackgroundTasks\Files.App.BackgroundTasks.csproj", "{BB1DA0B0-4E5B-4336-961E-DF389482C094}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.BackgroundTasks", "src\Files.App.BackgroundTasks\Files.App.BackgroundTasks.csproj", "{F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.InteractionTests", "tests\Files.InteractionTests\Files.InteractionTests.csproj", "{4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.Controls", "src\Files.App.Controls\Files.App.Controls.csproj", "{98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.OpenDialog", "src\Files.App.OpenDialog\Files.App.OpenDialog.vcxproj", "{A2FF3F3B-8EBC-4108-B99D-1476B7876656}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.CsWin32", "src\Files.App.CsWin32\Files.App.CsWin32.csproj", "{C1C83347-1524-3EBB-6B49-ECE025775668}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.Launcher", "src\Files.App.Launcher\Files.App.Launcher.vcxproj", "{25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App", "src\Files.App\Files.App.csproj", "{6F431D82-A5FF-4833-B5E4-702E1E523126}" - ProjectSection(ProjectDependencies) = postProject - {1EE996D6-885E-4403-A461-26C7A4E14D26} = {1EE996D6-885E-4403-A461-26C7A4E14D26} - {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} - {7756A1A4-17B5-4E6B-9B12-F19AA868A225} = {7756A1A4-17B5-4E6B-9B12-F19AA868A225} - {A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {A2FF3F3B-8EBC-4108-B99D-1476B7876656} - {B3FE3F3B-CECC-4918-B72B-5488C3774125} = {B3FE3F3B-CECC-4918-B72B-5488C3774125} - {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} = {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} - EndProjectSection -EndProject -Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Files.Package", "src\Files.App (Package)\Files.Package.wapproj", "{8F60FD8E-1921-47D6-97B0-D26D7B3A4999}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Core.SourceGenerator", "src\Files.Core.SourceGenerator\Files.Core.SourceGenerator.csproj", "{6FA07816-DE0A-4D49-84E8-38E953A33C87}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.OpenDialog", "src\Files.App.OpenDialog\Files.App.OpenDialog.vcxproj", "{A2FF3F3B-8EBC-4108-B99D-1476B7876656}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.Server", "src\Files.App.Server\Files.App.Server.csproj", "{1EE996D6-885E-4403-A461-26C7A4E14D26}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.OpenDialog.Win32", "src\Files.App.OpenDialog\Files.App.OpenDialog.Win32.vcxproj", "{B3FE3F3B-CECC-4918-B72B-5488C3774125}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.SaveDialog", "src\Files.App.SaveDialog\Files.App.SaveDialog.vcxproj", "{EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.SaveDialog.Win32", "src\Files.App.SaveDialog\Files.App.SaveDialog.Win32.vcxproj", "{7756A1A4-17B5-4E6B-9B12-F19AA868A225}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Files.App.OpenDialog.Win32", "src\Files.App.OpenDialog\Files.App.OpenDialog.Win32.vcxproj", "{B3FE3F3B-CECC-4918-B72B-5488C3774125}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.Server", "src\Files.App.Server\Files.App.Server.csproj", "{A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.Storage", "src\Files.App.Storage\Files.App.Storage.csproj", "{C425951C-86B6-E4C0-724E-047E9A2C8599}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App", "src\Files.App\Files.App.csproj", "{E6BD44A2-F200-6AC3-5A80-68727B1BE71B}" + ProjectSection(ProjectDependencies) = postProject + {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} + {A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {A2FF3F3B-8EBC-4108-B99D-1476B7876656} + {B3FE3F3B-CECC-4918-B72B-5488C3774125} = {B3FE3F3B-CECC-4918-B72B-5488C3774125} + {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} = {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} + {7756A1A4-17B5-4E6B-9B12-F19AA868A225} = {7756A1A4-17B5-4E6B-9B12-F19AA868A225} + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC} = {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC} + EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.UITests", "tests\Files.App.UITests\Files.App.UITests.csproj", "{6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.Controls", "src\Files.App.Controls\Files.App.Controls.csproj", "{83FF8729-CC76-43E2-976F-47F0A187FC7E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.App.UITests", "tests\Files.App.UITests\Files.App.UITests.csproj", "{85D62465-0545-08C0-6135-FB568D81A323}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.CsWin32", "src\Files.App.CsWin32\Files.App.CsWin32.csproj", "{4803E2CB-3E27-447D-94FC-45B5F96E4F7A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.InteractionTests", "tests\Files.InteractionTests\Files.InteractionTests.csproj", "{9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -62,78 +62,96 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|arm64.ActiveCfg = Debug|arm64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|arm64.Build.0 = Debug|arm64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|x64.ActiveCfg = Debug|x64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|x64.Build.0 = Debug|x64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|x86.ActiveCfg = Debug|x86 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Debug|x86.Build.0 = Debug|x86 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|arm64.ActiveCfg = Release|arm64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|arm64.Build.0 = Release|arm64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|x64.ActiveCfg = Release|x64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|x64.Build.0 = Release|x64 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|x86.ActiveCfg = Release|x86 - {94F77692-D47C-48D8-A1A7-645192EF38A4}.Release|x86.Build.0 = Release|x86 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|arm64.ActiveCfg = Debug|arm64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|arm64.Build.0 = Debug|arm64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|x64.ActiveCfg = Debug|x64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|x64.Build.0 = Debug|x64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|x86.ActiveCfg = Debug|x86 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Debug|x86.Build.0 = Debug|x86 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|arm64.ActiveCfg = Release|arm64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|arm64.Build.0 = Release|arm64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|x64.ActiveCfg = Release|x64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|x64.Build.0 = Release|x64 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|x86.ActiveCfg = Release|x86 - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209}.Release|x86.Build.0 = Release|x86 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|arm64.ActiveCfg = Debug|arm64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|arm64.Build.0 = Debug|arm64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|x64.ActiveCfg = Debug|x64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|x64.Build.0 = Debug|x64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|x86.ActiveCfg = Debug|x86 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Debug|x86.Build.0 = Debug|x86 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|arm64.ActiveCfg = Release|arm64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|arm64.Build.0 = Release|arm64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|x64.ActiveCfg = Release|x64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|x64.Build.0 = Release|x64 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|x86.ActiveCfg = Release|x86 - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}.Release|x86.Build.0 = Release|x86 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|arm64.ActiveCfg = Debug|arm64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|arm64.Build.0 = Debug|arm64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|x64.ActiveCfg = Debug|x64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|x64.Build.0 = Debug|x64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|x86.ActiveCfg = Debug|x86 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Debug|x86.Build.0 = Debug|x86 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|arm64.ActiveCfg = Release|arm64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|arm64.Build.0 = Release|arm64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|x64.ActiveCfg = Release|x64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|x64.Build.0 = Release|x64 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|x86.ActiveCfg = Release|x86 - {BB1DA0B0-4E5B-4336-961E-DF389482C094}.Release|x86.Build.0 = Release|x86 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|arm64.ActiveCfg = Debug|arm64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|arm64.Build.0 = Debug|arm64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|x64.ActiveCfg = Debug|x64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|x64.Build.0 = Debug|x64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|x86.ActiveCfg = Debug|x86 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Debug|x86.Build.0 = Debug|x86 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|arm64.ActiveCfg = Release|arm64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|arm64.Build.0 = Release|arm64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|x64.ActiveCfg = Release|x64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|x64.Build.0 = Release|x64 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|x86.ActiveCfg = Release|x86 - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}.Release|x86.Build.0 = Release|x86 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|arm64.ActiveCfg = Debug|arm64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|arm64.Build.0 = Debug|arm64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x64.ActiveCfg = Debug|x64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x64.Build.0 = Debug|x64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x86.ActiveCfg = Debug|Win32 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x86.Build.0 = Debug|Win32 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|arm64.ActiveCfg = Release|arm64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|arm64.Build.0 = Release|arm64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x64.ActiveCfg = Release|x64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x64.Build.0 = Release|x64 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x86.ActiveCfg = Release|Win32 - {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x86.Build.0 = Release|Win32 + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|arm64.Build.0 = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|x64.ActiveCfg = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|x64.Build.0 = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|x86.ActiveCfg = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Debug|x86.Build.0 = Debug|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|arm64.ActiveCfg = Release|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|arm64.Build.0 = Release|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|x64.ActiveCfg = Release|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|x64.Build.0 = Release|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|x86.ActiveCfg = Release|Any CPU + {7B50ED23-B535-E658-9542-00885ED406FA}.Release|x86.Build.0 = Release|Any CPU + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|arm64.ActiveCfg = Debug|arm64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|arm64.Build.0 = Debug|arm64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|x64.ActiveCfg = Debug|x64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|x64.Build.0 = Debug|x64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|x86.ActiveCfg = Debug|x86 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Debug|x86.Build.0 = Debug|x86 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|arm64.ActiveCfg = Release|arm64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|arm64.Build.0 = Release|arm64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|x64.ActiveCfg = Release|x64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|x64.Build.0 = Release|x64 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|x86.ActiveCfg = Release|x86 + {0CD123D7-CAE3-0F58-73C0-8BF39753B788}.Release|x86.Build.0 = Release|x86 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|arm64.ActiveCfg = Debug|arm64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|arm64.Build.0 = Debug|arm64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|x64.ActiveCfg = Debug|x64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|x64.Build.0 = Debug|x64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|x86.ActiveCfg = Debug|x86 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Debug|x86.Build.0 = Debug|x86 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|arm64.ActiveCfg = Release|arm64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|arm64.Build.0 = Release|arm64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|x64.ActiveCfg = Release|x64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|x64.Build.0 = Release|x64 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|x86.ActiveCfg = Release|x86 + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A}.Release|x86.Build.0 = Release|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|arm64.ActiveCfg = Debug|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|arm64.Build.0 = Debug|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|arm64.Deploy.0 = Debug|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x64.ActiveCfg = Debug|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x64.Build.0 = Debug|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x64.Deploy.0 = Debug|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x86.ActiveCfg = Debug|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x86.Build.0 = Debug|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Debug|x86.Deploy.0 = Debug|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|arm64.ActiveCfg = Release|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|arm64.Build.0 = Release|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|arm64.Deploy.0 = Release|arm64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x64.ActiveCfg = Release|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x64.Build.0 = Release|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x64.Deploy.0 = Release|x64 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x86.ActiveCfg = Release|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x86.Build.0 = Release|x86 + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1}.Release|x86.Deploy.0 = Release|x86 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|arm64.ActiveCfg = Debug|arm64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|arm64.Build.0 = Debug|arm64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|x64.ActiveCfg = Debug|x64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|x64.Build.0 = Debug|x64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|x86.ActiveCfg = Debug|x86 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Debug|x86.Build.0 = Debug|x86 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|arm64.ActiveCfg = Release|arm64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|arm64.Build.0 = Release|arm64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|x64.ActiveCfg = Release|x64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|x64.Build.0 = Release|x64 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|x86.ActiveCfg = Release|x86 + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7}.Release|x86.Build.0 = Release|x86 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|arm64.ActiveCfg = Debug|arm64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|arm64.Build.0 = Debug|arm64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|x64.ActiveCfg = Debug|x64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|x64.Build.0 = Debug|x64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|x86.ActiveCfg = Debug|x86 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Debug|x86.Build.0 = Debug|x86 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|arm64.ActiveCfg = Release|arm64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|arm64.Build.0 = Release|arm64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|x64.ActiveCfg = Release|x64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|x64.Build.0 = Release|x64 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|x86.ActiveCfg = Release|x86 + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34}.Release|x86.Build.0 = Release|x86 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|arm64.ActiveCfg = Debug|arm64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|arm64.Build.0 = Debug|arm64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|x64.ActiveCfg = Debug|x64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|x64.Build.0 = Debug|x64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|x86.ActiveCfg = Debug|x86 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Debug|x86.Build.0 = Debug|x86 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|arm64.ActiveCfg = Release|arm64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|arm64.Build.0 = Release|arm64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|x64.ActiveCfg = Release|x64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|x64.Build.0 = Release|x64 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|x86.ActiveCfg = Release|x86 + {C1C83347-1524-3EBB-6B49-ECE025775668}.Release|x86.Build.0 = Release|x86 {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Debug|arm64.ActiveCfg = Debug|arm64 {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Debug|arm64.Build.0 = Debug|arm64 {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Debug|x64.ActiveCfg = Debug|x64 @@ -146,72 +164,30 @@ Global {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Release|x64.Build.0 = Release|x64 {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Release|x86.ActiveCfg = Release|Win32 {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}.Release|x86.Build.0 = Release|Win32 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|arm64.ActiveCfg = Debug|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|arm64.Build.0 = Debug|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|arm64.Deploy.0 = Debug|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x64.ActiveCfg = Debug|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x64.Build.0 = Debug|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x64.Deploy.0 = Debug|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x86.ActiveCfg = Debug|x86 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x86.Build.0 = Debug|x86 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Debug|x86.Deploy.0 = Debug|x86 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|arm64.ActiveCfg = Release|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|arm64.Build.0 = Release|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|arm64.Deploy.0 = Release|arm64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x64.ActiveCfg = Release|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x64.Build.0 = Release|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x64.Deploy.0 = Release|x64 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x86.ActiveCfg = Release|x86 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x86.Build.0 = Release|x86 - {6F431D82-A5FF-4833-B5E4-702E1E523126}.Release|x86.Deploy.0 = Release|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|arm64.ActiveCfg = Debug|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|arm64.Build.0 = Debug|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|arm64.Deploy.0 = Debug|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x64.ActiveCfg = Debug|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x64.Build.0 = Debug|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x64.Deploy.0 = Debug|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x86.ActiveCfg = Debug|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x86.Build.0 = Debug|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Debug|x86.Deploy.0 = Debug|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|arm64.ActiveCfg = Release|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|arm64.Build.0 = Release|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|arm64.Deploy.0 = Release|arm64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x64.ActiveCfg = Release|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x64.Build.0 = Release|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x64.Deploy.0 = Release|x64 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x86.ActiveCfg = Release|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x86.Build.0 = Release|x86 - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Release|x86.Deploy.0 = Release|x86 - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|arm64.ActiveCfg = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|arm64.Build.0 = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.ActiveCfg = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.Build.0 = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x86.ActiveCfg = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x86.Build.0 = Debug|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|arm64.ActiveCfg = Release|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|arm64.Build.0 = Release|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|x64.ActiveCfg = Release|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|x64.Build.0 = Release|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|x86.ActiveCfg = Release|Any CPU - {6FA07816-DE0A-4D49-84E8-38E953A33C87}.Release|x86.Build.0 = Release|Any CPU - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|arm64.ActiveCfg = Debug|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|arm64.Build.0 = Debug|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|arm64.Deploy.0 = Debug|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x64.ActiveCfg = Debug|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x64.Build.0 = Debug|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x64.Deploy.0 = Debug|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x86.ActiveCfg = Debug|x86 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x86.Build.0 = Debug|x86 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Debug|x86.Deploy.0 = Debug|x86 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|arm64.ActiveCfg = Release|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|arm64.Build.0 = Release|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|arm64.Deploy.0 = Release|arm64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x64.ActiveCfg = Release|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x64.Build.0 = Release|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x64.Deploy.0 = Release|x64 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x86.ActiveCfg = Release|x86 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x86.Build.0 = Release|x86 - {1EE996D6-885E-4403-A461-26C7A4E14D26}.Release|x86.Deploy.0 = Release|x86 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|arm64.ActiveCfg = Debug|arm64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|arm64.Build.0 = Debug|arm64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x64.ActiveCfg = Debug|x64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x64.Build.0 = Debug|x64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x86.ActiveCfg = Debug|Win32 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Debug|x86.Build.0 = Debug|Win32 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|arm64.ActiveCfg = Release|arm64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|arm64.Build.0 = Release|arm64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x64.ActiveCfg = Release|x64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x64.Build.0 = Release|x64 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x86.ActiveCfg = Release|Win32 + {A2FF3F3B-8EBC-4108-B99D-1476B7876656}.Release|x86.Build.0 = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.ActiveCfg = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.Build.0 = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.ActiveCfg = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.Build.0 = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x86.ActiveCfg = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x86.Build.0 = Debug|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|arm64.ActiveCfg = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|arm64.Build.0 = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x64.ActiveCfg = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x64.Build.0 = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x86.ActiveCfg = Release|Win32 + {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x86.Build.0 = Release|Win32 {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}.Debug|arm64.ActiveCfg = Debug|arm64 {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}.Debug|arm64.Build.0 = Debug|arm64 {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}.Debug|x64.ActiveCfg = Debug|x64 @@ -229,84 +205,114 @@ Global {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.ActiveCfg = Debug|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.Build.0 = Debug|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x86.ActiveCfg = Debug|Win32 + {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x86.Build.0 = Debug|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|arm64.ActiveCfg = Release|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|arm64.Build.0 = Release|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|x64.ActiveCfg = Release|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|x64.Build.0 = Release|Win32 {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|x86.ActiveCfg = Release|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.ActiveCfg = Debug|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.Build.0 = Debug|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.ActiveCfg = Debug|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.Build.0 = Debug|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x86.ActiveCfg = Debug|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|arm64.ActiveCfg = Release|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|arm64.Build.0 = Release|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x64.ActiveCfg = Release|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x64.Build.0 = Release|Win32 - {B3FE3F3B-CECC-4918-B72B-5488C3774125}.Release|x86.ActiveCfg = Release|Win32 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|arm64.ActiveCfg = Debug|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|arm64.Build.0 = Debug|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|arm64.Deploy.0 = Debug|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x64.ActiveCfg = Debug|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x64.Build.0 = Debug|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x64.Deploy.0 = Debug|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x86.ActiveCfg = Debug|x86 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x86.Build.0 = Debug|x86 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Debug|x86.Deploy.0 = Debug|x86 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|arm64.ActiveCfg = Release|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|arm64.Build.0 = Release|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|arm64.Deploy.0 = Release|arm64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x64.ActiveCfg = Release|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x64.Build.0 = Release|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x64.Deploy.0 = Release|x64 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x86.ActiveCfg = Release|x86 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x86.Build.0 = Release|x86 - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B}.Release|x86.Deploy.0 = Release|x86 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Debug|arm64.ActiveCfg = Debug|arm64 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Debug|x64.ActiveCfg = Debug|x64 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Debug|x64.Build.0 = Debug|x64 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Debug|x86.ActiveCfg = Debug|x86 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Release|arm64.ActiveCfg = Release|arm64 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Release|x64.ActiveCfg = Release|x64 - {83FF8729-CC76-43E2-976F-47F0A187FC7E}.Release|x86.ActiveCfg = Release|x86 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|arm64.ActiveCfg = Debug|arm64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|arm64.Build.0 = Debug|arm64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|x64.ActiveCfg = Debug|x64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|x64.Build.0 = Debug|x64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|x86.ActiveCfg = Debug|x86 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Debug|x86.Build.0 = Debug|x86 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|arm64.ActiveCfg = Release|arm64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|arm64.Build.0 = Release|arm64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|x64.ActiveCfg = Release|x64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|x64.Build.0 = Release|x64 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|x86.ActiveCfg = Release|x86 - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A}.Release|x86.Build.0 = Release|x86 + {7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Release|x86.Build.0 = Release|Win32 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|arm64.ActiveCfg = Debug|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|arm64.Build.0 = Debug|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|arm64.Deploy.0 = Debug|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x64.ActiveCfg = Debug|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x64.Build.0 = Debug|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x64.Deploy.0 = Debug|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x86.ActiveCfg = Debug|x86 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x86.Build.0 = Debug|x86 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Debug|x86.Deploy.0 = Debug|x86 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|arm64.ActiveCfg = Release|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|arm64.Build.0 = Release|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|arm64.Deploy.0 = Release|arm64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x64.ActiveCfg = Release|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x64.Build.0 = Release|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x64.Deploy.0 = Release|x64 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x86.ActiveCfg = Release|x86 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x86.Build.0 = Release|x86 + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC}.Release|x86.Deploy.0 = Release|x86 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|arm64.ActiveCfg = Debug|arm64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|arm64.Build.0 = Debug|arm64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|x64.ActiveCfg = Debug|x64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|x64.Build.0 = Debug|x64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|x86.ActiveCfg = Debug|x86 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Debug|x86.Build.0 = Debug|x86 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|arm64.ActiveCfg = Release|arm64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|arm64.Build.0 = Release|arm64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|x64.ActiveCfg = Release|x64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|x64.Build.0 = Release|x64 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|x86.ActiveCfg = Release|x86 + {C425951C-86B6-E4C0-724E-047E9A2C8599}.Release|x86.Build.0 = Release|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|arm64.ActiveCfg = Debug|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|arm64.Build.0 = Debug|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|arm64.Deploy.0 = Debug|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x64.ActiveCfg = Debug|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x64.Build.0 = Debug|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x64.Deploy.0 = Debug|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x86.ActiveCfg = Debug|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x86.Build.0 = Debug|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Debug|x86.Deploy.0 = Debug|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|arm64.ActiveCfg = Release|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|arm64.Build.0 = Release|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|arm64.Deploy.0 = Release|arm64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x64.ActiveCfg = Release|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x64.Build.0 = Release|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x64.Deploy.0 = Release|x64 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x86.ActiveCfg = Release|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x86.Build.0 = Release|x86 + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B}.Release|x86.Deploy.0 = Release|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|arm64.ActiveCfg = Debug|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|arm64.Build.0 = Debug|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|arm64.Deploy.0 = Debug|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x64.ActiveCfg = Debug|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x64.Build.0 = Debug|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x64.Deploy.0 = Debug|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x86.ActiveCfg = Debug|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x86.Build.0 = Debug|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Debug|x86.Deploy.0 = Debug|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|arm64.ActiveCfg = Release|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|arm64.Build.0 = Release|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|arm64.Deploy.0 = Release|arm64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x64.ActiveCfg = Release|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x64.Build.0 = Release|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x64.Deploy.0 = Release|x64 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x86.ActiveCfg = Release|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x86.Build.0 = Release|x86 + {85D62465-0545-08C0-6135-FB568D81A323}.Release|x86.Deploy.0 = Release|x86 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|arm64.ActiveCfg = Debug|arm64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|arm64.Build.0 = Debug|arm64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|x64.ActiveCfg = Debug|x64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|x64.Build.0 = Debug|x64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|x86.ActiveCfg = Debug|x86 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Debug|x86.Build.0 = Debug|x86 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|arm64.ActiveCfg = Release|arm64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|arm64.Build.0 = Release|arm64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|x64.ActiveCfg = Release|x64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|x64.Build.0 = Release|x64 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|x86.ActiveCfg = Release|x86 + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} = {A74DCE98-A744-4D71-A2B1-7EE4FED0936B} - {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} = {A74DCE98-A744-4D71-A2B1-7EE4FED0936B} - {94F77692-D47C-48D8-A1A7-645192EF38A4} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} - {B8051E11-5BF2-49F7-A7C8-E3820DBB8209} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {53371D77-7AC1-4975-9A2A-5E0EB0B37CE3} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} - {BB1DA0B0-4E5B-4336-961E-DF389482C094} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {4ED01D20-8529-4DEF-8C1B-4E31031AE7E0} = {481DE2EA-E6CE-4A9C-A220-3B543B95AAA1} - {A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {6F431D82-A5FF-4833-B5E4-702E1E523126} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {8F60FD8E-1921-47D6-97B0-D26D7B3A4999} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {6FA07816-DE0A-4D49-84E8-38E953A33C87} = {9F36C2AD-005D-4EA5-A1F1-6BC42773FC85} - {1EE996D6-885E-4403-A461-26C7A4E14D26} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {7756A1A4-17B5-4E6B-9B12-F19AA868A225} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {B3FE3F3B-CECC-4918-B72B-5488C3774125} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {6F5B1C76-6FA1-49C0-9AF5-672BEDF6900B} = {481DE2EA-E6CE-4A9C-A220-3B543B95AAA1} - {83FF8729-CC76-43E2-976F-47F0A187FC7E} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - {4803E2CB-3E27-447D-94FC-45B5F96E4F7A} = {A188C26B-E731-4E0B-9D17-D21CEBD9B43F} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0E62043C-A7A1-4982-9EC9-4CDB2939B776} + {8D626EA8-CB54-BC41-363A-217881BEBA6E} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {7B50ED23-B535-E658-9542-00885ED406FA} = {8D626EA8-CB54-BC41-363A-217881BEBA6E} + {0CD123D7-CAE3-0F58-73C0-8BF39753B788} = {8D626EA8-CB54-BC41-363A-217881BEBA6E} + {6C01E445-3C11-C76F-CE47-0B9A775ACF0A} = {8D626EA8-CB54-BC41-363A-217881BEBA6E} + {82099983-647E-F067-E69A-CD800643A918} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {66AF8DE9-79A0-E1FC-5B6B-E4B41FFDE6A1} = {82099983-647E-F067-E69A-CD800643A918} + {F8B5749F-C6EA-8FE3-B03A-ACE02A8076A7} = {82099983-647E-F067-E69A-CD800643A918} + {98A9E6D7-7C0E-1E78-8CE6-6E42C8A70B34} = {82099983-647E-F067-E69A-CD800643A918} + {C1C83347-1524-3EBB-6B49-ECE025775668} = {82099983-647E-F067-E69A-CD800643A918} + {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {82099983-647E-F067-E69A-CD800643A918} + {A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {82099983-647E-F067-E69A-CD800643A918} + {B3FE3F3B-CECC-4918-B72B-5488C3774125} = {82099983-647E-F067-E69A-CD800643A918} + {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} = {82099983-647E-F067-E69A-CD800643A918} + {7756A1A4-17B5-4E6B-9B12-F19AA868A225} = {82099983-647E-F067-E69A-CD800643A918} + {A9FC40D5-7AA8-6EB5-C5A5-F5075045DBCC} = {82099983-647E-F067-E69A-CD800643A918} + {C425951C-86B6-E4C0-724E-047E9A2C8599} = {82099983-647E-F067-E69A-CD800643A918} + {E6BD44A2-F200-6AC3-5A80-68727B1BE71B} = {82099983-647E-F067-E69A-CD800643A918} + {85D62465-0545-08C0-6135-FB568D81A323} = {0AB3BF05-4346-4AA6-1389-037BE0695223} + {9A20CF5B-549E-FB0A-4791-91CA4FFCCFFF} = {0AB3BF05-4346-4AA6-1389-037BE0695223} EndGlobalSection EndGlobal diff --git a/Files.slnx b/Files.slnx new file mode 100644 index 000000000000..280325f271c2 --- /dev/null +++ b/Files.slnx @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/global.json b/global.json index 62a1920fd79d..22ededbf99dc 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,6 @@ { - "sdk": { - "version": "8.0.303" - } + "sdk": { + "version": "9.0.102", + "rollForward": "latestMajor" + } } diff --git a/nuget.config b/nuget.config index 2d6f8e9827fe..9bff03b5edc1 100644 --- a/nuget.config +++ b/nuget.config @@ -1,6 +1,20 @@  - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App (Package)/Files.Package.wapproj b/src/Files.App (Package)/Files.Package.wapproj index b9ea87f552aa..9fe1a0b05133 100644 --- a/src/Files.App (Package)/Files.Package.wapproj +++ b/src/Files.App (Package)/Files.Package.wapproj @@ -1,11 +1,10 @@ - - + 8f60fd8e-1921-47d6-97b0-d26d7b3a4999 10.0.22621.0 10.0.19041.0 - net8.0-windows$(TargetPlatformVersion);$(AssetTargetFallback) + net9.0-windows$(TargetPlatformVersion);$(AssetTargetFallback) en-US False False @@ -28,18 +27,6 @@ Debug x86 - - Preview - ARM64 - - - Preview - x64 - - - Preview - x86 - Release x86 @@ -60,30 +47,6 @@ Release ARM64 - - Stable - ARM64 - - - Stable - x64 - - - Stable - x86 - - - Store - ARM64 - - - Store - x64 - - - Store - x86 - $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ @@ -107,8 +70,8 @@ - - + + diff --git a/src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj b/src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj index f600ec7346ab..e31ac656a7a1 100644 --- a/src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj +++ b/src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj @@ -1,32 +1,25 @@ - + - net8.0-windows10.0.22621.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) en-US - 10.0.19041.0 + $(MinimalWindowsVersion) true Debug;Release x86;x64;ARM64 win-x86;win-x64;win-arm64 + true true - 10.0.22621.0 + $(TargetWindowsVersion) $(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration) - - TRACE;DEBUG;NETFX_CORE - - - TRACE;RELEASE;NETFX_CORE - true - - - + diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs new file mode 100644 index 000000000000..297e43a3cb73 --- /dev/null +++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs @@ -0,0 +1,164 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace Files.App.Controls +{ + /// + /// The AdaptiveGridView control allows to present information within a Grid View perfectly adjusting the + /// total display available space. It reacts to changes in the layout as well as the content so it can adapt + /// to different form factors automatically. + /// + /// + /// The number and the width of items are calculated based on the + /// screen resolution in order to fully leverage the available screen space. The property ItemsHeight define + /// the items fixed height and the property DesiredWidth sets the minimum width for the elements to add a + /// new column. + /// + public partial class AdaptiveGridView + { + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ItemClickCommandProperty = + DependencyProperty.Register(nameof(ItemClickCommand), typeof(ICommand), typeof(AdaptiveGridView), new PropertyMetadata(null)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ItemHeightProperty = + DependencyProperty.Register(nameof(ItemHeight), typeof(double), typeof(AdaptiveGridView), new PropertyMetadata(double.NaN)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty OneRowModeEnabledProperty = + DependencyProperty.Register(nameof(OneRowModeEnabled), typeof(bool), typeof(AdaptiveGridView), new PropertyMetadata(false, (o, e) => { OnOneRowModeEnabledChanged(o, e.NewValue); })); + + /// + /// Identifies the dependency property. + /// + private static readonly DependencyProperty ItemWidthProperty = + DependencyProperty.Register(nameof(ItemWidth), typeof(double), typeof(AdaptiveGridView), new PropertyMetadata(double.NaN)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty DesiredWidthProperty = + DependencyProperty.Register(nameof(DesiredWidth), typeof(double), typeof(AdaptiveGridView), new PropertyMetadata(double.NaN, DesiredWidthChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty StretchContentForSingleRowProperty = + DependencyProperty.Register(nameof(StretchContentForSingleRow), typeof(bool), typeof(AdaptiveGridView), new PropertyMetadata(true, OnStretchContentForSingleRowPropertyChanged)); + + private static void OnOneRowModeEnabledChanged(DependencyObject d, object newValue) + { + var self = d as AdaptiveGridView; + self.DetermineOneRowMode(); + } + + private static void DesiredWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var self = d as AdaptiveGridView; + self.RecalculateLayout(self.ActualWidth); + } + + private static void OnStretchContentForSingleRowPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var self = d as AdaptiveGridView; + self.RecalculateLayout(self.ActualWidth); + } + + /// + /// Gets or sets the desired width of each item + /// + /// The width of the desired. + public double DesiredWidth + { + get { return (double)GetValue(DesiredWidthProperty); } + set { SetValue(DesiredWidthProperty, value); } + } + + /// + /// Gets or sets a value indicating whether the control should stretch the content to fill at least one row. + /// + /// + /// If set to true (default) and there is only one row of items, the items will be stretched to fill the complete row. + /// If set to false, items will have their normal size, which means a gap can exist at the end of the row. + /// + /// A value indicating whether the control should stretch the content to fill at least one row. + public bool StretchContentForSingleRow + { + get { return (bool)GetValue(StretchContentForSingleRowProperty); } + set { SetValue(StretchContentForSingleRowProperty, value); } + } + + /// + /// Gets or sets the command to execute when an item is clicked and the IsItemClickEnabled property is true. + /// + /// The item click command. + public ICommand ItemClickCommand + { + get { return (ICommand)GetValue(ItemClickCommandProperty); } + set { SetValue(ItemClickCommandProperty, value); } + } + + /// + /// Gets or sets the height of each item in the grid. + /// + /// The height of the item. + public double ItemHeight + { + get { return (double)GetValue(ItemHeightProperty); } + set { SetValue(ItemHeightProperty, value); } + } + + /// + /// Gets or sets a value indicating whether only one row should be displayed. + /// + /// true if only one row is displayed; otherwise, false. + public bool OneRowModeEnabled + { + get { return (bool)GetValue(OneRowModeEnabledProperty); } + set { SetValue(OneRowModeEnabledProperty, value); } + } + + /// + /// Gets the template that defines the panel that controls the layout of items. + /// + /// + /// This property overrides the base ItemsPanel to prevent changing it. + /// + /// + /// An ItemsPanelTemplate that defines the panel to use for the layout of the items. + /// The default value for the ItemsControl is an ItemsPanelTemplate that specifies + /// a StackPanel. + /// + public new ItemsPanelTemplate ItemsPanel => base.ItemsPanel; + + private double ItemWidth + { + get { return (double)GetValue(ItemWidthProperty); } + set { SetValue(ItemWidthProperty, value); } + } + + private static int CalculateColumns(double containerWidth, double itemWidth) + { + var columns = (int)Math.Round(containerWidth / itemWidth); + if (columns == 0) + { + columns = 1; + } + + return columns; + } + } +} diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs new file mode 100644 index 000000000000..d769f57bde2d --- /dev/null +++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs @@ -0,0 +1,269 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.Foundation.Collections; + +namespace Files.App.Controls +{ + /// + /// The AdaptiveGridView control allows to present information within a Grid View perfectly adjusting the + /// total display available space. It reacts to changes in the layout as well as the content so it can adapt + /// to different form factors automatically. + /// + /// + /// The number and the width of items are calculated based on the + /// screen resolution in order to fully leverage the available screen space. The property ItemsHeight define + /// the items fixed height and the property DesiredWidth sets the minimum width for the elements to add a + /// new column. + public partial class AdaptiveGridView : GridView + { + private bool _isLoaded; + private ScrollMode _savedVerticalScrollMode; + private ScrollMode _savedHorizontalScrollMode; + private ScrollBarVisibility _savedVerticalScrollBarVisibility; + private ScrollBarVisibility _savedHorizontalScrollBarVisibility; + private Orientation _savedOrientation; + private bool _needToRestoreScrollStates; + private bool _needContainerMarginForLayout; + + /// + /// Initializes a new instance of the class. + /// + public AdaptiveGridView() + { + IsTabStop = false; + SizeChanged += OnSizeChanged; + ItemClick += OnItemClick; + Items.VectorChanged += ItemsOnVectorChanged; + Loaded += OnLoaded; + Unloaded += OnUnloaded; + + // Prevent issues with higher DPIs and underlying panel. #1803 + UseLayoutRounding = false; + } + + /// + /// Prepares the specified element to display the specified item. + /// + /// The element that's used to display the specified item. + /// The item to display. + protected override void PrepareContainerForItemOverride(DependencyObject obj, object item) + { + base.PrepareContainerForItemOverride(obj, item); + if (obj is FrameworkElement element) + { + var heightBinding = new Binding() + { + Source = this, + Path = new PropertyPath("ItemHeight"), + Mode = BindingMode.TwoWay + }; + + var widthBinding = new Binding() + { + Source = this, + Path = new PropertyPath("ItemWidth"), + Mode = BindingMode.TwoWay + }; + + element.SetBinding(HeightProperty, heightBinding); + element.SetBinding(WidthProperty, widthBinding); + } + + if (obj is ContentControl contentControl) + { + contentControl.HorizontalContentAlignment = HorizontalAlignment.Stretch; + contentControl.VerticalContentAlignment = VerticalAlignment.Stretch; + } + + if (_needContainerMarginForLayout) + { + _needContainerMarginForLayout = false; + RecalculateLayout(ActualWidth); + } + } + + /// + /// Calculates the width of the grid items. + /// + /// The width of the container control. + /// The calculated item width. + protected virtual double CalculateItemWidth(double containerWidth) + { + if (double.IsNaN(DesiredWidth)) + { + return DesiredWidth; + } + + var columns = CalculateColumns(containerWidth, DesiredWidth); + + // If there's less items than there's columns, reduce the column count (if requested); + if (Items != null && Items.Count > 0 && Items.Count < columns && StretchContentForSingleRow) + { + columns = Items.Count; + } + + // subtract the margin from the width so we place the correct width for placement + var fallbackThickness = default(Thickness); + var itemMargin = AdaptiveHeightValueConverter.GetItemMargin(this, fallbackThickness); + if (itemMargin == fallbackThickness) + { + // No style explicitly defined, or no items or no container for the items + // We need to get an actual margin for proper layout + _needContainerMarginForLayout = true; + } + + return (containerWidth / columns) - itemMargin.Left - itemMargin.Right; + } + + /// + /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call + /// ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays + /// in your app. Override this method to influence the default post-template logic of a class. + /// + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + OnOneRowModeEnabledChanged(this, OneRowModeEnabled); + } + + private void ItemsOnVectorChanged(IObservableVector sender, IVectorChangedEventArgs @event) + { + if (!double.IsNaN(ActualWidth)) + { + // If the item count changes, check if more or less columns needs to be rendered, + // in case we were having fewer items than columns. + RecalculateLayout(ActualWidth); + } + } + + private void OnItemClick(object sender, ItemClickEventArgs e) + { + var cmd = ItemClickCommand; + if (cmd != null) + { + if (cmd.CanExecute(e.ClickedItem)) + { + cmd.Execute(e.ClickedItem); + } + } + } + + private void OnSizeChanged(object sender, SizeChangedEventArgs e) + { + // If we are in center alignment, we only care about relayout if the number of columns we can display changes + // Fixes #1737 + if (HorizontalAlignment != HorizontalAlignment.Stretch) + { + var prevColumns = CalculateColumns(e.PreviousSize.Width, DesiredWidth); + var newColumns = CalculateColumns(e.NewSize.Width, DesiredWidth); + + // If the width of the internal list view changes, check if more or less columns needs to be rendered. + if (prevColumns != newColumns) + { + RecalculateLayout(e.NewSize.Width); + } + } + else if (e.PreviousSize.Width != e.NewSize.Width) + { + // We need to recalculate width as our size changes to adjust internal items. + RecalculateLayout(e.NewSize.Width); + } + } + + private void OnLoaded(object sender, RoutedEventArgs e) + { + _isLoaded = true; + DetermineOneRowMode(); + } + + private void OnUnloaded(object sender, RoutedEventArgs e) + { + _isLoaded = false; + } + + private void DetermineOneRowMode() + { + if (_isLoaded) + { + var itemsWrapGridPanel = ItemsPanelRoot as ItemsWrapGrid; + + if (OneRowModeEnabled) + { + var b = new Binding() + { + Source = this, + Path = new PropertyPath("ItemHeight"), + Converter = new AdaptiveHeightValueConverter(), + ConverterParameter = this + }; + + if (itemsWrapGridPanel != null) + { + _savedOrientation = itemsWrapGridPanel.Orientation; + itemsWrapGridPanel.Orientation = Orientation.Vertical; + } + + SetBinding(MaxHeightProperty, b); + + _savedHorizontalScrollMode = ScrollViewer.GetHorizontalScrollMode(this); + _savedVerticalScrollMode = ScrollViewer.GetVerticalScrollMode(this); + _savedHorizontalScrollBarVisibility = ScrollViewer.GetHorizontalScrollBarVisibility(this); + _savedVerticalScrollBarVisibility = ScrollViewer.GetVerticalScrollBarVisibility(this); + _needToRestoreScrollStates = true; + + ScrollViewer.SetVerticalScrollMode(this, ScrollMode.Disabled); + ScrollViewer.SetVerticalScrollBarVisibility(this, ScrollBarVisibility.Hidden); + ScrollViewer.SetHorizontalScrollBarVisibility(this, ScrollBarVisibility.Visible); + ScrollViewer.SetHorizontalScrollMode(this, ScrollMode.Enabled); + } + else + { + ClearValue(MaxHeightProperty); + + if (!_needToRestoreScrollStates) + { + return; + } + + _needToRestoreScrollStates = false; + + if (itemsWrapGridPanel != null) + { + itemsWrapGridPanel.Orientation = _savedOrientation; + } + + ScrollViewer.SetVerticalScrollMode(this, _savedVerticalScrollMode); + ScrollViewer.SetVerticalScrollBarVisibility(this, _savedVerticalScrollBarVisibility); + ScrollViewer.SetHorizontalScrollBarVisibility(this, _savedHorizontalScrollBarVisibility); + ScrollViewer.SetHorizontalScrollMode(this, _savedHorizontalScrollMode); + } + } + } + + private void RecalculateLayout(double containerWidth) + { + var itemsPanel = ItemsPanelRoot as Panel; + var panelMargin = itemsPanel != null ? + itemsPanel.Margin.Left + itemsPanel.Margin.Right : + 0; + var padding = Padding.Left + Padding.Right; + var border = BorderThickness.Left + BorderThickness.Right; + + // width should be the displayable width + containerWidth = containerWidth - padding - panelMargin - border; + if (containerWidth > 0) + { + var newWidth = CalculateItemWidth(containerWidth); + ItemWidth = Math.Floor(newWidth); + } + } + } +} diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs new file mode 100644 index 000000000000..b636700e395a --- /dev/null +++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + internal partial class AdaptiveHeightValueConverter : IValueConverter + { + private Thickness thickness = new Thickness(0, 0, 4, 4); + + public Thickness DefaultItemMargin + { + get { return thickness; } + set { thickness = value; } + } + + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value != null) + { + var gridView = (GridView)parameter; + if (gridView == null) + { + return value; + } + + double.TryParse(value.ToString(), out double height); + + var padding = gridView.Padding; + var margin = GetItemMargin(gridView, DefaultItemMargin); + height = height + margin.Top + margin.Bottom + padding.Top + padding.Bottom; + + return height; + } + + return double.NaN; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + + internal static Thickness GetItemMargin(GridView view, Thickness fallback = default(Thickness)) + { + var setter = view.ItemContainerStyle?.Setters.OfType().FirstOrDefault(s => s.Property == FrameworkElement.MarginProperty); + if (setter != null) + { + return (Thickness)setter.Value; + } + else + { + if (view.Items.Count > 0) + { + var container = (GridViewItem)view.ContainerFromIndex(0); + if (container != null) + { + return container.Margin; + } + } + + // Use the default thickness for a GridViewItem + return fallback; + } + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeItem.Events.cs b/src/Files.App.Controls/BladeView/BladeItem.Events.cs new file mode 100644 index 000000000000..c4dbac9304d0 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeItem.Events.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// The Blade is used as a child in the BladeView + /// + public partial class BladeItem + { + /// + /// Fires when the blade is opened or closed + /// + public event EventHandler? VisibilityChanged; + } +} diff --git a/src/Files.App.Controls/BladeView/BladeItem.Properties.cs b/src/Files.App.Controls/BladeView/BladeItem.Properties.cs new file mode 100644 index 000000000000..33435ea35dd3 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeItem.Properties.cs @@ -0,0 +1,108 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Xaml.Media; +using Microsoft.UI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// The Blade is used as a child in the BladeView + /// + public partial class BladeItem + { + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty TitleBarVisibilityProperty = DependencyProperty.Register(nameof(TitleBarVisibility), typeof(Visibility), typeof(BladeItem), new PropertyMetadata(default(Visibility))); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty TitleBarBackgroundProperty = DependencyProperty.Register(nameof(TitleBarBackground), typeof(Brush), typeof(BladeItem), new PropertyMetadata(default(Brush))); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty CloseButtonBackgroundProperty = DependencyProperty.Register(nameof(CloseButtonBackground), typeof(Brush), typeof(BladeItem), new PropertyMetadata(default(Brush))); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(nameof(IsOpen), typeof(bool), typeof(BladeItem), new PropertyMetadata(true, IsOpenChangedCallback)); + + /// + /// Identifies the dependency property + /// + public static readonly DependencyProperty CloseButtonForegroundProperty = DependencyProperty.Register(nameof(CloseButtonForeground), typeof(Brush), typeof(BladeItem), new PropertyMetadata(new SolidColorBrush(Colors.Black))); + + private WeakReference _parentBladeView; + + /// + /// Gets or sets the foreground color of the close button + /// + public Brush CloseButtonForeground + { + get { return (Brush)GetValue(CloseButtonForegroundProperty); } + set { SetValue(CloseButtonForegroundProperty, value); } + } + + /// + /// Gets or sets the visibility of the title bar for this blade + /// + public Visibility TitleBarVisibility + { + get { return (Visibility)GetValue(TitleBarVisibilityProperty); } + set { SetValue(TitleBarVisibilityProperty, value); } + } + + /// + /// Gets or sets the background color of the title bar + /// + public Brush TitleBarBackground + { + get { return (Brush)GetValue(TitleBarBackgroundProperty); } + set { SetValue(TitleBarBackgroundProperty, value); } + } + + /// + /// Gets or sets the background color of the default close button in the title bar + /// + public Brush CloseButtonBackground + { + get { return (Brush)GetValue(CloseButtonBackgroundProperty); } + set { SetValue(CloseButtonBackgroundProperty, value); } + } + + /// + /// Gets or sets a value indicating whether this blade is opened + /// + public bool IsOpen + { + get { return (bool)GetValue(IsOpenProperty); } + set { SetValue(IsOpenProperty, value); } + } + + internal BladeView ParentBladeView + { + get + { + this._parentBladeView.TryGetTarget(out var bladeView); + return bladeView; + } + set => this._parentBladeView = new WeakReference(value); + } + + private static void IsOpenChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) + { + BladeItem bladeItem = (BladeItem)dependencyObject; + bladeItem.Visibility = bladeItem.IsOpen ? Visibility.Visible : Visibility.Collapsed; + bladeItem.VisibilityChanged?.Invoke(bladeItem, bladeItem.Visibility); + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeItem.cs b/src/Files.App.Controls/BladeView/BladeItem.cs new file mode 100644 index 000000000000..081755adede3 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeItem.cs @@ -0,0 +1,119 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using CommunityToolkit.WinUI; +using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.UI.Xaml.Automation; + +namespace Files.App.Controls +{ + /// + /// The Blade is used as a child in the BladeView + /// + [TemplatePart(Name = "CloseButton", Type = typeof(Button))] + [TemplatePart(Name = "EnlargeButton", Type = typeof(Button))] + public partial class BladeItem : Expander + { + private Button _closeButton; + private Button _enlargeButton; + private double _normalModeWidth; + private bool _loaded = false; + + /// + /// Initializes a new instance of the class. + /// + public BladeItem() + { + DefaultStyleKey = typeof(BladeItem); + + SizeChanged += OnSizeChanged; + Expanding += OnExpanding; + Collapsed += OnCollapsed; + } + + /// + /// Override default OnApplyTemplate to capture child controls + /// + protected override void OnApplyTemplate() + { + _loaded = true; + base.OnApplyTemplate(); + + _closeButton = GetTemplateChild("CloseButton") as Button; + _enlargeButton = GetTemplateChild("EnlargeButton") as Button; + + if (_closeButton == null) + { + return; + } + + _closeButton.Click -= CloseButton_Click; + _closeButton.Click += CloseButton_Click; + + if (_enlargeButton == null) + { + return; + } + + _enlargeButton.Click -= EnlargeButton_Click; + _enlargeButton.Click += EnlargeButton_Click; + } + + /// + private void OnExpanding(Expander sender, ExpanderExpandingEventArgs args) + { + if (_loaded) + { + Width = _normalModeWidth; + VisualStateManager.GoToState(this, "Expanded", true); + var name = "WCT_BladeView_ExpandButton_Collapsed".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); + if (_enlargeButton != null) + { + AutomationProperties.SetName(_enlargeButton, name); + } + } + } + + /// + private void OnCollapsed(Expander sender, ExpanderCollapsedEventArgs args) + { + if (_loaded) + { + Width = double.NaN; + VisualStateManager.GoToState(this, "Collapsed", true); + var name = "WCT_BladeView_ExpandButton_Expanded".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); + if (_enlargeButton != null) + { + AutomationProperties.SetName(_enlargeButton, name); + } + } + } + + /// + /// Creates AutomationPeer () + /// + /// An automation peer for this . + protected override AutomationPeer OnCreateAutomationPeer() + { + return new BladeItemAutomationPeer(this); + } + + private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs) + { + if (IsExpanded) + { + _normalModeWidth = Width; + } + } + + private void CloseButton_Click(object sender, RoutedEventArgs e) + { + IsOpen = false; + } + + private void EnlargeButton_Click(object sender, RoutedEventArgs e) + { + IsExpanded = !IsExpanded; + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs b/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs new file mode 100644 index 000000000000..8b03ea9ab09b --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs @@ -0,0 +1,143 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using CommunityToolkit.WinUI; +using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.UI.Xaml.Automation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// Defines a framework element automation peer for the . + /// + public partial class BladeItemAutomationPeer : FrameworkElementAutomationPeer + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The that is associated with this . + /// + public BladeItemAutomationPeer(BladeItem owner) + : base(owner) + { + } + + private BladeItem OwnerBladeItem + { + get { return this.Owner as BladeItem; } + } + + /// + /// Gets the control type for the element that is associated with the UI Automation peer. + /// + /// The control type. + protected override AutomationControlType GetAutomationControlTypeCore() + { + return AutomationControlType.ListItem; + } + + /// + /// Called by GetClassName that gets a human readable name that, in addition to AutomationControlType, + /// differentiates the control represented by this AutomationPeer. + /// + /// The string that contains the name. + protected override string GetClassNameCore() + { + return Owner.GetType().Name; + } + + /// + /// Called by GetName. + /// + /// + /// Returns the first of these that is not null or empty: + /// - Value returned by the base implementation + /// - Name of the owning BladeItem + /// - BladeItem class name + /// + protected override string GetNameCore() + { + string name = AutomationProperties.GetName(this.OwnerBladeItem); + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + name = this.OwnerBladeItem.Name; + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + name = this.OwnerBladeItem.Header?.ToString(); + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + TextBlock textBlock = this.OwnerBladeItem.FindDescendant(); + if (textBlock != null) + { + return textBlock.Text; + } + + name = base.GetNameCore(); + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + return string.Empty; + } + + /// + /// Returns the size of the set where the element that is associated with the automation peer is located. + /// + /// + /// The size of the set. + /// + protected override int GetSizeOfSetCore() + { + int sizeOfSet = base.GetSizeOfSetCore(); + + if (sizeOfSet != -1) + { + return sizeOfSet; + } + + BladeItem owner = this.OwnerBladeItem; + BladeView parent = owner.ParentBladeView; + sizeOfSet = parent.Items.Count; + + return sizeOfSet; + } + + /// + /// Returns the ordinal position in the set for the element that is associated with the automation peer. + /// + /// + /// The ordinal position in the set. + /// + protected override int GetPositionInSetCore() + { + int positionInSet = base.GetPositionInSetCore(); + + if (positionInSet != -1) + { + return positionInSet; + } + + BladeItem owner = this.OwnerBladeItem; + BladeView parent = owner.ParentBladeView; + positionInSet = parent.IndexFromContainer(owner); + + return positionInSet; + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeMode.cs b/src/Files.App.Controls/BladeView/BladeMode.cs new file mode 100644 index 000000000000..123d36a2d8d5 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeMode.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// The blade mode. + /// + public enum BladeMode + { + /// + /// Default mode : each blade will take the specified Width and Height + /// + Normal, + + /// + /// Fullscreen mode : each blade will take the entire Width and Height of the UI control container (cf ) + /// + Fullscreen + } +} diff --git a/src/Files.App.Controls/BladeView/BladeView.Events.cs b/src/Files.App.Controls/BladeView/BladeView.Events.cs new file mode 100644 index 000000000000..c60e719c876e --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeView.Events.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// A container that hosts controls in a horizontal scrolling list + /// Based on the Azure portal UI + /// + public partial class BladeView + { + /// + /// Fires whenever a is opened + /// + public event EventHandler BladeOpened; + + /// + /// Fires whenever a is closed + /// + public event EventHandler BladeClosed; + } +} diff --git a/src/Files.App.Controls/BladeView/BladeView.Properties.cs b/src/Files.App.Controls/BladeView/BladeView.Properties.cs new file mode 100644 index 000000000000..b651c039504d --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeView.Properties.cs @@ -0,0 +1,115 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.Foundation; + +namespace Files.App.Controls +{ + /// + /// A container that hosts controls in a horizontal scrolling list + /// Based on the Azure portal UI + /// + public partial class BladeView + { + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ActiveBladesProperty = DependencyProperty.Register(nameof(ActiveBlades), typeof(IList), typeof(BladeView), new PropertyMetadata(null)); + + /// + /// Identifies the attached property. + /// + public static readonly DependencyProperty BladeModeProperty = DependencyProperty.RegisterAttached(nameof(BladeMode), typeof(BladeMode), typeof(BladeView), new PropertyMetadata(BladeMode.Normal, OnBladeModeChanged)); + + /// + /// Identifies the attached property. + /// + public static readonly DependencyProperty AutoCollapseCountThresholdProperty = DependencyProperty.RegisterAttached(nameof(AutoCollapseCountThreshold), typeof(int), typeof(BladeView), new PropertyMetadata(int.MaxValue, OnOpenBladesChanged)); + + /// + /// Gets or sets a collection of visible blades + /// + public IList ActiveBlades + { + get { return (IList)GetValue(ActiveBladesProperty); } + set { SetValue(ActiveBladesProperty, value); } + } + + /// + /// Gets or sets a value indicating whether blade mode (ex: whether blades are full screen or not) + /// + public BladeMode BladeMode + { + get { return (BladeMode)GetValue(BladeModeProperty); } + set { SetValue(BladeModeProperty, value); } + } + + /// + /// Gets or sets a value indicating what the overflow amount should be to start auto collapsing blade items + /// + /// + /// For example we put AutoCollapseCountThreshold = 2 + /// This means that each time a blade is added to the bladeview collection, + /// we will validate the amount of added blades that have a title bar visible. + /// If this number get's bigger than AutoCollapseCountThreshold, we will collapse all blades but the last one + /// + /// + /// We don't touch blade items that have no title bar + /// + public int AutoCollapseCountThreshold + { + get { return (int)GetValue(AutoCollapseCountThresholdProperty); } + set { SetValue(AutoCollapseCountThresholdProperty, value); } + } + + private static void OnBladeModeChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) + { + var bladeView = (BladeView)dependencyObject; + + if (bladeView.BladeMode == BladeMode.Fullscreen) + { + // Cache previous values of blade items properties (width & height) + bladeView._cachedBladeItemSizes.Clear(); + + if (bladeView.Items != null) + { + foreach (var item in bladeView.Items) + { + var bladeItem = bladeView.GetBladeItem(item); + bladeView._cachedBladeItemSizes.Add(bladeItem, new Size(bladeItem.Width, bladeItem.Height)); + } + } + + VisualStateManager.GoToState(bladeView, "FullScreen", false); + } + + if (bladeView.BladeMode == BladeMode.Normal) + { + // Reset blade items properties & clear cache + foreach (var kvBladeItemSize in bladeView._cachedBladeItemSizes) + { + kvBladeItemSize.Key.Width = kvBladeItemSize.Value.Width; + kvBladeItemSize.Key.Height = kvBladeItemSize.Value.Height; + } + + bladeView._cachedBladeItemSizes.Clear(); + + VisualStateManager.GoToState(bladeView, "Normal", false); + } + + // Execute change of blade item size + bladeView.AdjustBladeItemSize(); + } + + private static void OnOpenBladesChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) + { + var bladeView = (BladeView)dependencyObject; + bladeView.CycleBlades(); + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeView.cs b/src/Files.App.Controls/BladeView/BladeView.cs new file mode 100644 index 000000000000..2a1ecbb3b250 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeView.cs @@ -0,0 +1,213 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using CommunityToolkit.WinUI; +using Microsoft.UI.Xaml.Automation.Peers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.Foundation; +using Windows.Foundation.Collections; + +namespace Files.App.Controls +{ + /// + /// A container that hosts controls in a horizontal scrolling list + /// Based on the Azure portal UI + /// + public partial class BladeView : ItemsControl + { + private ScrollViewer _scrollViewer; + + private Dictionary _cachedBladeItemSizes = new Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + public BladeView() + { + DefaultStyleKey = typeof(BladeView); + + Items.VectorChanged += ItemsVectorChanged; + + Loaded += (sender, e) => AdjustBladeItemSize(); + SizeChanged += (sender, e) => AdjustBladeItemSize(); + } + + /// + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + CycleBlades(); + AdjustBladeItemSize(); + } + + /// + protected override DependencyObject GetContainerForItemOverride() + { + return new BladeItem(); + } + + /// + protected override bool IsItemItsOwnContainerOverride(object item) + { + return item is BladeItem; + } + + /// + protected override void PrepareContainerForItemOverride(DependencyObject element, object item) + { + var blade = element as BladeItem; + if (blade != null) + { + blade.VisibilityChanged += BladeOnVisibilityChanged; + blade.ParentBladeView = this; + } + + base.PrepareContainerForItemOverride(element, item); + CycleBlades(); + } + + /// + protected override void ClearContainerForItemOverride(DependencyObject element, object item) + { + var blade = element as BladeItem; + if (blade != null) + { + blade.VisibilityChanged -= BladeOnVisibilityChanged; + } + + base.ClearContainerForItemOverride(element, item); + } + + /// + /// Creates AutomationPeer () + /// + /// An automation peer for this . + protected override AutomationPeer OnCreateAutomationPeer() + { + return new BladeViewAutomationPeer(this); + } + + private void CycleBlades() + { + ActiveBlades = new ObservableCollection(); + foreach (var item in Items) + { + BladeItem blade = GetBladeItem(item); + if (blade != null) + { + if (blade.IsOpen) + { + ActiveBlades.Add(blade); + } + } + } + + // For now we skip this feature when blade mode is set to fullscreen + if (AutoCollapseCountThreshold > 0 && BladeMode != BladeMode.Fullscreen && ActiveBlades.Any()) + { + var openBlades = ActiveBlades.Where(item => item.TitleBarVisibility == Visibility.Visible).ToList(); + if (openBlades.Count > AutoCollapseCountThreshold) + { + for (int i = 0; i < openBlades.Count - 1; i++) + { + openBlades[i].IsExpanded = false; + } + } + } + } + + private BladeItem GetBladeItem(object item) + { + BladeItem blade = item as BladeItem; + if (blade == null) + { + blade = (BladeItem)ContainerFromItem(item); + } + + return blade; + } + + private async void BladeOnVisibilityChanged(object sender, Visibility visibility) + { + var blade = sender as BladeItem; + + if (visibility == Visibility.Visible) + { + if (Items == null) + { + return; + } + + var item = ItemFromContainer(blade); + Items.Remove(item); + Items.Add(item); + BladeOpened?.Invoke(this, blade); + ActiveBlades.Add(blade); + UpdateLayout(); + + // Need to do this because of touch. See more information here: https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/760#issuecomment-276466464 + await DispatcherQueue.EnqueueAsync( + () => + { + GetScrollViewer()?.ChangeView(_scrollViewer.ScrollableWidth, null, null); + }, Microsoft.UI.Dispatching.DispatcherQueuePriority.Low); + + return; + } + + BladeClosed?.Invoke(this, blade); + ActiveBlades.Remove(blade); + + var lastBlade = ActiveBlades.LastOrDefault(); + if (lastBlade != null && lastBlade.TitleBarVisibility == Visibility.Visible) + { + lastBlade.IsExpanded = true; + } + } + + private ScrollViewer GetScrollViewer() + { + return _scrollViewer ?? (_scrollViewer = this.FindDescendant()); + } + + private void AdjustBladeItemSize() + { + // Adjust blade items to be full screen + if (BladeMode == BladeMode.Fullscreen && GetScrollViewer() != null) + { + foreach (var item in Items) + { + var blade = GetBladeItem(item); + blade.Width = _scrollViewer.ActualWidth; + blade.Height = _scrollViewer.ActualHeight; + } + } + } + + private void ItemsVectorChanged(IObservableVector sender, IVectorChangedEventArgs e) + { + if (BladeMode == BladeMode.Fullscreen) + { + var bladeItem = GetBladeItem(sender[(int)e.Index]); + if (bladeItem != null) + { + if (!_cachedBladeItemSizes.ContainsKey(bladeItem)) + { + // Execute change of blade item size when a blade item is added in Fullscreen mode + _cachedBladeItemSizes.Add(bladeItem, new Size(bladeItem.Width, bladeItem.Height)); + AdjustBladeItemSize(); + } + } + } + else if (e.CollectionChange == CollectionChange.ItemInserted) + { + UpdateLayout(); + GetScrollViewer()?.ChangeView(_scrollViewer.ScrollableWidth, null, null); + } + } + } +} diff --git a/src/Files.App.Controls/BladeView/BladeView.xaml b/src/Files.App.Controls/BladeView/BladeView.xaml new file mode 100644 index 000000000000..7d9f24796b52 --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeView.xaml @@ -0,0 +1,193 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs b/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs new file mode 100644 index 000000000000..085dfc6c699d --- /dev/null +++ b/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs @@ -0,0 +1,116 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.UI.Xaml.Automation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Files.App.Controls +{ + /// + /// Defines a framework element automation peer for the control. + /// + public partial class BladeViewAutomationPeer : ItemsControlAutomationPeer + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The that is associated with this . + /// + public BladeViewAutomationPeer(BladeView owner) + : base(owner) + { + } + + private BladeView OwningBladeView + { + get + { + return Owner as BladeView; + } + } + + /// + /// Gets the control type for the element that is associated with the UI Automation peer. + /// + /// The control type. + protected override AutomationControlType GetAutomationControlTypeCore() + { + return AutomationControlType.List; + } + + /// + /// Called by GetClassName that gets a human readable name that, in addition to AutomationControlType, + /// differentiates the control represented by this AutomationPeer. + /// + /// The string that contains the name. + protected override string GetClassNameCore() + { + return Owner.GetType().Name; + } + + /// + /// Called by GetName. + /// + /// + /// Returns the first of these that is not null or empty: + /// - Value returned by the base implementation + /// - Name of the owning BladeView + /// - BladeView class name + /// + protected override string GetNameCore() + { + string name = AutomationProperties.GetName(this.OwningBladeView); + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + name = this.OwningBladeView.Name; + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + name = base.GetNameCore(); + if (!string.IsNullOrEmpty(name)) + { + return name; + } + + return string.Empty; + } + + /// + /// Gets the collection of elements that are represented in the UI Automation tree as immediate + /// child elements of the automation peer. + /// + /// The children elements. + protected override IList GetChildrenCore() + { + BladeView owner = OwningBladeView; + + ItemCollection items = owner.Items; + if (items.Count <= 0) + { + return null; + } + + List peers = new List(items.Count); + for (int i = 0; i < items.Count; i++) + { + if (owner.ContainerFromIndex(i) is BladeItem element) + { + peers.Add(FromElement(element) ?? CreatePeerForElement(element)); + } + } + + return peers; + } + } +} diff --git a/src/Files.App.Controls/Files.App.Controls.csproj b/src/Files.App.Controls/Files.App.Controls.csproj index 10a03c18178e..e6f01f2756e9 100644 --- a/src/Files.App.Controls/Files.App.Controls.csproj +++ b/src/Files.App.Controls/Files.App.Controls.csproj @@ -2,23 +2,21 @@ - net8.0-windows10.0.22621.0 - 10.0.19041.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) + $(MinimalWindowsVersion) true - 10.0.19041.0 enable Debug;Release x86;x64;arm64 win-x86;win-x64;win-arm64 - TRACE;DEBUG;NETFX_CORE - TRACE;RELEASE;NETFX_CORE - true + true - - - + + + + diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.Data.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.Data.cs new file mode 100644 index 000000000000..595329fbe3b7 --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.Data.cs @@ -0,0 +1,156 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Files.App.Controls +{ + /// + /// Represents the control that redistributes space between columns or rows of a Grid control. + /// + public partial class GridSplitter + { + /// + /// Enum to indicate whether GridSplitter resizes Columns or Rows + /// + public enum GridResizeDirection + { + /// + /// Determines whether to resize rows or columns based on its Alignment and + /// width compared to height + /// + Auto, + + /// + /// Resize columns when dragging Splitter. + /// + Columns, + + /// + /// Resize rows when dragging Splitter. + /// + Rows + } + + /// + /// Enum to indicate what Columns or Rows the GridSplitter resizes + /// + public enum GridResizeBehavior + { + /// + /// Determine which columns or rows to resize based on its Alignment. + /// + BasedOnAlignment, + + /// + /// Resize the current and next Columns or Rows. + /// + CurrentAndNext, + + /// + /// Resize the previous and current Columns or Rows. + /// + PreviousAndCurrent, + + /// + /// Resize the previous and next Columns or Rows. + /// + PreviousAndNext + } + + /// + /// Enum to indicate the supported gripper cursor types. + /// + public enum GripperCursorType + { + /// + /// Change the cursor based on the splitter direction + /// + Default = -1, + + /// + /// Standard Arrow cursor + /// + Arrow, + + /// + /// Standard Cross cursor + /// + Cross, + + /// + /// Standard Custom cursor + /// + Custom, + + /// + /// Standard Hand cursor + /// + Hand, + + /// + /// Standard Help cursor + /// + Help, + + /// + /// Standard IBeam cursor + /// + IBeam, + + /// + /// Standard SizeAll cursor + /// + SizeAll, + + /// + /// Standard SizeNortheastSouthwest cursor + /// + SizeNortheastSouthwest, + + /// + /// Standard SizeNorthSouth cursor + /// + SizeNorthSouth, + + /// + /// Standard SizeNorthwestSoutheast cursor + /// + SizeNorthwestSoutheast, + + /// + /// Standard SizeWestEast cursor + /// + SizeWestEast, + + /// + /// Standard UniversalNo cursor + /// + UniversalNo, + + /// + /// Standard UpArrow cursor + /// + UpArrow, + + /// + /// Standard Wait cursor + /// + Wait + } + + /// + /// Enum to indicate the behavior of window cursor on grid splitter hover + /// + public enum SplitterCursorBehavior + { + /// + /// Update window cursor on Grid Splitter hover + /// + ChangeOnSplitterHover, + + /// + /// Update window cursor on Grid Splitter Gripper hover + /// + ChangeOnGripperHover + } + } +} diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.Events.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.Events.cs new file mode 100644 index 000000000000..40a346856834 --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.Events.cs @@ -0,0 +1,322 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Input; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Windows.System; +using Windows.UI.Core; + +namespace Files.App.Controls +{ + /// + /// Represents the control that redistributes space between columns or rows of a Grid control. + /// + public partial class GridSplitter + { + // Symbols for GripperBar in Segoe MDL2 Assets + private const string GripperBarVertical = "\xE784"; + private const string GripperBarHorizontal = "\xE76F"; + private const string GripperDisplayFont = "Segoe MDL2 Assets"; + + private void GridSplitter_Loaded(object sender, RoutedEventArgs e) + { + _resizeDirection = GetResizeDirection(); + _resizeBehavior = GetResizeBehavior(); + + // Adding Grip to Grid Splitter + if (Element == default(UIElement)) + { + CreateGripperDisplay(); + Element = _gripperDisplay; + } + + if (_hoverWrapper == null) + { + var hoverWrapper = new GripperHoverWrapper( + CursorBehavior == SplitterCursorBehavior.ChangeOnSplitterHover + ? this + : Element, + _resizeDirection, + GripperCursor, + GripperCustomCursorResource); + ManipulationStarted += hoverWrapper.SplitterManipulationStarted; + ManipulationCompleted += hoverWrapper.SplitterManipulationCompleted; + + _hoverWrapper = hoverWrapper; + } + } + + private void CreateGripperDisplay() + { + if (_gripperDisplay == null) + { + _gripperDisplay = new TextBlock + { + FontFamily = new FontFamily(GripperDisplayFont), + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Foreground = GripperForeground, + Text = _resizeDirection == GridResizeDirection.Columns ? GripperBarVertical : GripperBarHorizontal + }; + _gripperDisplay.SetValue( + Microsoft.UI.Xaml.Automation.AutomationProperties.AccessibilityViewProperty, + Microsoft.UI.Xaml.Automation.Peers.AccessibilityView.Raw); + } + } + + private bool IsCtrlDown() + { + if (Window.Current == null) + { + return false; + } + + var ctrl = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control); + return ctrl.HasFlag(CoreVirtualKeyStates.Down); + } + + /// + protected override void OnKeyDown(KeyRoutedEventArgs e) + { + var step = 1; + if (IsCtrlDown()) + { + step = 5; + } + + if (_resizeDirection == GridResizeDirection.Columns) + { + if (e.Key == VirtualKey.Left) + { + HorizontalMove(-step); + } + else if (e.Key == VirtualKey.Right) + { + HorizontalMove(step); + } + else + { + return; + } + + e.Handled = true; + return; + } + + if (_resizeDirection == GridResizeDirection.Rows) + { + if (e.Key == VirtualKey.Up) + { + VerticalMove(-step); + } + else if (e.Key == VirtualKey.Down) + { + VerticalMove(step); + } + else + { + return; + } + + e.Handled = true; + } + + base.OnKeyDown(e); + } + + /// + protected override void OnManipulationStarted(ManipulationStartedRoutedEventArgs e) + { + // saving the previous state + PreviousCursor = ProtectedCursor; + if (PreviousCursor == null) + { + PreviousCursor = InputSystemCursor.Create(InputSystemCursorShape.Arrow); + } + + _resizeDirection = GetResizeDirection(); + _resizeBehavior = GetResizeBehavior(); + + if (_resizeDirection == GridResizeDirection.Columns) + { + ProtectedCursor = ColumnsSplitterCursor; + } + else if (_resizeDirection == GridResizeDirection.Rows) + { + ProtectedCursor = RowSplitterCursor; + } + + base.OnManipulationStarted(e); + } + + /// + protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e) + { + ProtectedCursor = PreviousCursor; + + base.OnManipulationCompleted(e); + } + + /// + protected override void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e) + { + var horizontalChange = e.Delta.Translation.X; + var verticalChange = e.Delta.Translation.Y; + + if (this.FlowDirection == FlowDirection.RightToLeft) + { + horizontalChange *= -1; + } + + if (_resizeDirection == GridResizeDirection.Columns) + { + if (HorizontalMove(horizontalChange)) + { + return; + } + } + else if (_resizeDirection == GridResizeDirection.Rows) + { + if (VerticalMove(verticalChange)) + { + return; + } + } + + base.OnManipulationDelta(e); + } + + private bool VerticalMove(double verticalChange) + { + if (CurrentRow == null || SiblingRow == null) + { + return true; + } + + // if current row has fixed height then resize it + if (!IsStarRow(CurrentRow)) + { + // No need to check for the row Min height because it is automatically respected + if (!SetRowHeight(CurrentRow, verticalChange, GridUnitType.Pixel)) + { + return true; + } + } + + // if sibling row has fixed width then resize it + else if (!IsStarRow(SiblingRow)) + { + // Would adding to this column make the current column violate the MinWidth? + if (IsValidRowHeight(CurrentRow, verticalChange) == false) + { + return false; + } + + if (!SetRowHeight(SiblingRow, verticalChange * -1, GridUnitType.Pixel)) + { + return true; + } + } + + // if both row haven't fixed height (auto *) + else + { + // change current row height to the new height with respecting the auto + // change sibling row height to the new height relative to current row + // respect the other star row height by setting it's height to it's actual height with stars + + // We need to validate current and sibling height to not cause any unexpected behavior + if (!IsValidRowHeight(CurrentRow, verticalChange) || + !IsValidRowHeight(SiblingRow, verticalChange * -1)) + { + return true; + } + + foreach (var rowDefinition in Resizable.RowDefinitions) + { + if (rowDefinition == CurrentRow) + { + SetRowHeight(CurrentRow, verticalChange, GridUnitType.Star); + } + else if (rowDefinition == SiblingRow) + { + SetRowHeight(SiblingRow, verticalChange * -1, GridUnitType.Star); + } + else if (IsStarRow(rowDefinition)) + { + rowDefinition.Height = new GridLength(rowDefinition.ActualHeight, GridUnitType.Star); + } + } + } + + return false; + } + + private bool HorizontalMove(double horizontalChange) + { + if (CurrentColumn == null || SiblingColumn == null) + { + return true; + } + + // if current column has fixed width then resize it + if (!IsStarColumn(CurrentColumn)) + { + // No need to check for the Column Min width because it is automatically respected + if (!SetColumnWidth(CurrentColumn, horizontalChange, GridUnitType.Pixel)) + { + return true; + } + } + + // if sibling column has fixed width then resize it + else if (!IsStarColumn(SiblingColumn)) + { + // Would adding to this column make the current column violate the MinWidth? + if (IsValidColumnWidth(CurrentColumn, horizontalChange) == false) + { + return false; + } + + if (!SetColumnWidth(SiblingColumn, horizontalChange * -1, GridUnitType.Pixel)) + { + return true; + } + } + + // if both column haven't fixed width (auto *) + else + { + // change current column width to the new width with respecting the auto + // change sibling column width to the new width relative to current column + // respect the other star column width by setting it's width to it's actual width with stars + + // We need to validate current and sibling width to not cause any unexpected behavior + if (!IsValidColumnWidth(CurrentColumn, horizontalChange) || + !IsValidColumnWidth(SiblingColumn, horizontalChange * -1)) + { + return true; + } + + foreach (var columnDefinition in Resizable.ColumnDefinitions) + { + if (columnDefinition == CurrentColumn) + { + SetColumnWidth(CurrentColumn, horizontalChange, GridUnitType.Star); + } + else if (columnDefinition == SiblingColumn) + { + SetColumnWidth(SiblingColumn, horizontalChange * -1, GridUnitType.Star); + } + else if (IsStarColumn(columnDefinition)) + { + columnDefinition.Width = new GridLength(columnDefinition.ActualWidth, GridUnitType.Star); + } + } + } + + return false; + } + } +} diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.Helper.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.Helper.cs new file mode 100644 index 000000000000..aa5c19418cec --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.Helper.cs @@ -0,0 +1,256 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Files.App.Controls +{ + /// + /// Represents the control that redistributes space between columns or rows of a Grid control. + /// + public partial class GridSplitter + { + private static bool IsStarColumn(ColumnDefinition definition) + { + return ((GridLength)definition.GetValue(ColumnDefinition.WidthProperty)).IsStar; + } + + private static bool IsStarRow(RowDefinition definition) + { + return ((GridLength)definition.GetValue(RowDefinition.HeightProperty)).IsStar; + } + + private bool SetColumnWidth(ColumnDefinition columnDefinition, double horizontalChange, GridUnitType unitType) + { + var newWidth = columnDefinition.ActualWidth + horizontalChange; + + var minWidth = columnDefinition.MinWidth; + if (!double.IsNaN(minWidth) && newWidth < minWidth) + { + newWidth = minWidth; + } + + var maxWidth = columnDefinition.MaxWidth; + if (!double.IsNaN(maxWidth) && newWidth > maxWidth) + { + newWidth = maxWidth; + } + + if (newWidth > ActualWidth) + { + columnDefinition.Width = new GridLength(newWidth, unitType); + return true; + } + + return false; + } + + private bool IsValidColumnWidth(ColumnDefinition columnDefinition, double horizontalChange) + { + var newWidth = columnDefinition.ActualWidth + horizontalChange; + + var minWidth = columnDefinition.MinWidth; + if (!double.IsNaN(minWidth) && newWidth < minWidth) + { + return false; + } + + var maxWidth = columnDefinition.MaxWidth; + if (!double.IsNaN(maxWidth) && newWidth > maxWidth) + { + return false; + } + + if (newWidth <= ActualWidth) + { + return false; + } + + return true; + } + + private bool SetRowHeight(RowDefinition rowDefinition, double verticalChange, GridUnitType unitType) + { + var newHeight = rowDefinition.ActualHeight + verticalChange; + + var minHeight = rowDefinition.MinHeight; + if (!double.IsNaN(minHeight) && newHeight < minHeight) + { + newHeight = minHeight; + } + + var maxWidth = rowDefinition.MaxHeight; + if (!double.IsNaN(maxWidth) && newHeight > maxWidth) + { + newHeight = maxWidth; + } + + if (newHeight > ActualHeight) + { + rowDefinition.Height = new GridLength(newHeight, unitType); + return true; + } + + return false; + } + + private bool IsValidRowHeight(RowDefinition rowDefinition, double verticalChange) + { + var newHeight = rowDefinition.ActualHeight + verticalChange; + + var minHeight = rowDefinition.MinHeight; + if (!double.IsNaN(minHeight) && newHeight < minHeight) + { + return false; + } + + var maxHeight = rowDefinition.MaxHeight; + if (!double.IsNaN(maxHeight) && newHeight > maxHeight) + { + return false; + } + + if (newHeight <= ActualHeight) + { + return false; + } + + return true; + } + + // Return the targeted Column based on the resize behavior + private int GetTargetedColumn() + { + var currentIndex = Grid.GetColumn(TargetControl); + return GetTargetIndex(currentIndex); + } + + // Return the sibling Row based on the resize behavior + private int GetTargetedRow() + { + var currentIndex = Grid.GetRow(TargetControl); + return GetTargetIndex(currentIndex); + } + + // Return the sibling Column based on the resize behavior + private int GetSiblingColumn() + { + var currentIndex = Grid.GetColumn(TargetControl); + return GetSiblingIndex(currentIndex); + } + + // Return the sibling Row based on the resize behavior + private int GetSiblingRow() + { + var currentIndex = Grid.GetRow(TargetControl); + return GetSiblingIndex(currentIndex); + } + + // Gets index based on resize behavior for first targeted row/column + private int GetTargetIndex(int currentIndex) + { + switch (_resizeBehavior) + { + case GridResizeBehavior.CurrentAndNext: + return currentIndex; + case GridResizeBehavior.PreviousAndNext: + return currentIndex - 1; + case GridResizeBehavior.PreviousAndCurrent: + return currentIndex - 1; + default: + return -1; + } + } + + // Gets index based on resize behavior for second targeted row/column + private int GetSiblingIndex(int currentIndex) + { + switch (_resizeBehavior) + { + case GridResizeBehavior.CurrentAndNext: + return currentIndex + 1; + case GridResizeBehavior.PreviousAndNext: + return currentIndex + 1; + case GridResizeBehavior.PreviousAndCurrent: + return currentIndex; + default: + return -1; + } + } + + // Checks the control alignment and Width/Height to detect the control resize direction columns/rows + private GridResizeDirection GetResizeDirection() + { + GridResizeDirection direction = ResizeDirection; + + if (direction == GridResizeDirection.Auto) + { + // When HorizontalAlignment is Left, Right or Center, resize Columns + if (HorizontalAlignment != HorizontalAlignment.Stretch) + { + direction = GridResizeDirection.Columns; + } + + // When VerticalAlignment is Top, Bottom or Center, resize Rows + else if (VerticalAlignment != VerticalAlignment.Stretch) + { + direction = GridResizeDirection.Rows; + } + + // Check Width vs Height + else if (ActualWidth <= ActualHeight) + { + direction = GridResizeDirection.Columns; + } + else + { + direction = GridResizeDirection.Rows; + } + } + + return direction; + } + + // Get the resize behavior (Which columns/rows should be resized) based on alignment and Direction + private GridResizeBehavior GetResizeBehavior() + { + GridResizeBehavior resizeBehavior = ResizeBehavior; + + if (resizeBehavior == GridResizeBehavior.BasedOnAlignment) + { + if (_resizeDirection == GridResizeDirection.Columns) + { + switch (HorizontalAlignment) + { + case HorizontalAlignment.Left: + resizeBehavior = GridResizeBehavior.PreviousAndCurrent; + break; + case HorizontalAlignment.Right: + resizeBehavior = GridResizeBehavior.CurrentAndNext; + break; + default: + resizeBehavior = GridResizeBehavior.PreviousAndNext; + break; + } + } + + // resize direction is vertical + else + { + switch (VerticalAlignment) + { + case VerticalAlignment.Top: + resizeBehavior = GridResizeBehavior.PreviousAndCurrent; + break; + case VerticalAlignment.Bottom: + resizeBehavior = GridResizeBehavior.CurrentAndNext; + break; + default: + resizeBehavior = GridResizeBehavior.PreviousAndNext; + break; + } + } + } + + return resizeBehavior; + } + } +} diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.Options.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.Options.cs new file mode 100644 index 000000000000..c3f5bbab84f2 --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.Options.cs @@ -0,0 +1,226 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Input; +using Microsoft.UI.Xaml.Media; + +namespace Files.App.Controls +{ + /// + /// Represents the control that redistributes space between columns or rows of a Grid control. + /// + public partial class GridSplitter + { + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ElementProperty + = DependencyProperty.Register( + nameof(Element), + typeof(UIElement), + typeof(GridSplitter), + new PropertyMetadata(default(UIElement), OnElementPropertyChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ResizeDirectionProperty + = DependencyProperty.Register( + nameof(ResizeDirection), + typeof(GridResizeDirection), + typeof(GridSplitter), + new PropertyMetadata(GridResizeDirection.Auto)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ResizeBehaviorProperty + = DependencyProperty.Register( + nameof(ResizeBehavior), + typeof(GridResizeBehavior), + typeof(GridSplitter), + new PropertyMetadata(GridResizeBehavior.BasedOnAlignment)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty GripperForegroundProperty + = DependencyProperty.Register( + nameof(GripperForeground), + typeof(Brush), + typeof(GridSplitter), + new PropertyMetadata(default(Brush), OnGripperForegroundPropertyChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ParentLevelProperty + = DependencyProperty.Register( + nameof(ParentLevel), + typeof(int), + typeof(GridSplitter), + new PropertyMetadata(default(int))); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty GripperCursorProperty = + DependencyProperty.RegisterAttached( + nameof(GripperCursor), + typeof(InputSystemCursorShape?), + typeof(GridSplitter), + new PropertyMetadata(GripperCursorType.Default, OnGripperCursorPropertyChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty GripperCustomCursorResourceProperty = + DependencyProperty.RegisterAttached( + nameof(GripperCustomCursorResource), + typeof(uint), + typeof(GridSplitter), + new PropertyMetadata(GripperCustomCursorDefaultResource, GripperCustomCursorResourcePropertyChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty CursorBehaviorProperty = + DependencyProperty.RegisterAttached( + nameof(CursorBehavior), + typeof(SplitterCursorBehavior), + typeof(GridSplitter), + new PropertyMetadata(SplitterCursorBehavior.ChangeOnSplitterHover, CursorBehaviorPropertyChanged)); + + /// + /// Gets or sets the visual content of this Grid Splitter + /// + public UIElement Element + { + get { return (UIElement)GetValue(ElementProperty); } + set { SetValue(ElementProperty, value); } + } + + /// + /// Gets or sets whether the Splitter resizes the Columns, Rows, or Both. + /// + public GridResizeDirection ResizeDirection + { + get { return (GridResizeDirection)GetValue(ResizeDirectionProperty); } + + set { SetValue(ResizeDirectionProperty, value); } + } + + /// + /// Gets or sets which Columns or Rows the Splitter resizes. + /// + public GridResizeBehavior ResizeBehavior + { + get { return (GridResizeBehavior)GetValue(ResizeBehaviorProperty); } + + set { SetValue(ResizeBehaviorProperty, value); } + } + + /// + /// Gets or sets the foreground color of grid splitter grip + /// + public Brush GripperForeground + { + get { return (Brush)GetValue(GripperForegroundProperty); } + + set { SetValue(GripperForegroundProperty, value); } + } + + /// + /// Gets or sets the level of the parent grid to resize + /// + public int ParentLevel + { + get { return (int)GetValue(ParentLevelProperty); } + + set { SetValue(ParentLevelProperty, value); } + } + + /// + /// Gets or sets the gripper Cursor type + /// + public GripperCursorType GripperCursor + { + get { return (GripperCursorType)GetValue(GripperCursorProperty); } + set { SetValue(GripperCursorProperty, value); } + } + + /// + /// Gets or sets the gripper Custom Cursor resource number + /// + public int GripperCustomCursorResource + { + get { return (int)GetValue(GripperCustomCursorResourceProperty); } + set { SetValue(GripperCustomCursorResourceProperty, value); } + } + + /// + /// Gets or sets splitter cursor on hover behavior + /// + public SplitterCursorBehavior CursorBehavior + { + get { return (SplitterCursorBehavior)GetValue(CursorBehaviorProperty); } + set { SetValue(CursorBehaviorProperty, value); } + } + + private static void OnGripperForegroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var gridSplitter = (GridSplitter)d; + + if (gridSplitter._gripperDisplay == null) + { + return; + } + + gridSplitter._gripperDisplay.Foreground = gridSplitter.GripperForeground; + } + + private static void OnGripperCursorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var gridSplitter = (GridSplitter)d; + + if (gridSplitter._hoverWrapper == null) + { + return; + } + + gridSplitter._hoverWrapper.GripperCursor = gridSplitter.GripperCursor; + } + + private static void GripperCustomCursorResourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var gridSplitter = (GridSplitter)d; + + if (gridSplitter._hoverWrapper == null) + { + return; + } + + gridSplitter._hoverWrapper.GripperCustomCursorResource = gridSplitter.GripperCustomCursorResource; + } + + private static void CursorBehaviorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var gridSplitter = (GridSplitter)d; + + gridSplitter._hoverWrapper?.UpdateHoverElement(gridSplitter.CursorBehavior == + SplitterCursorBehavior.ChangeOnSplitterHover + ? gridSplitter + : gridSplitter.Element); + } + + private static void OnElementPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var gridSplitter = (GridSplitter)d; + + gridSplitter._hoverWrapper?.UpdateHoverElement(gridSplitter.CursorBehavior == + SplitterCursorBehavior.ChangeOnSplitterHover + ? gridSplitter + : gridSplitter.Element); + } + } +} diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.cs new file mode 100644 index 000000000000..57fe23d20194 --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.cs @@ -0,0 +1,243 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Input; +using Microsoft.UI.Xaml.Automation; +using Microsoft.UI.Xaml.Input; + +namespace Files.App.Controls +{ + /// + /// Represents the control that redistributes space between columns or rows of a Grid control. + /// + public partial class GridSplitter : Control + { + internal const int GripperCustomCursorDefaultResource = -1; + internal static readonly InputCursor ColumnsSplitterCursor = InputSystemCursor.Create(InputSystemCursorShape.SizeWestEast); + internal static readonly InputCursor RowSplitterCursor = InputSystemCursor.Create(InputSystemCursorShape.SizeNorthSouth); + + internal InputCursor PreviousCursor { get; set; } + + private GridResizeDirection _resizeDirection; + private GridResizeBehavior _resizeBehavior; + private GripperHoverWrapper _hoverWrapper; + private TextBlock _gripperDisplay; + + private bool _pressed = false; + private bool _dragging = false; + private bool _pointerEntered = false; + + /// + /// Gets the target parent grid from level + /// + private FrameworkElement TargetControl + { + get + { + if (ParentLevel == 0) + { + return this; + } + + var parent = Parent; + for (int i = 2; i < ParentLevel; i++) + { + var frameworkElement = parent as FrameworkElement; + if (frameworkElement != null) + { + parent = frameworkElement.Parent; + } + } + + return parent as FrameworkElement; + } + } + + /// + /// Gets GridSplitter Container Grid + /// + private Grid Resizable => TargetControl?.Parent as Grid; + + /// + /// Gets the current Column definition of the parent Grid + /// + private ColumnDefinition CurrentColumn + { + get + { + if (Resizable == null) + { + return null; + } + + var gridSplitterTargetedColumnIndex = GetTargetedColumn(); + + if ((gridSplitterTargetedColumnIndex >= 0) + && (gridSplitterTargetedColumnIndex < Resizable.ColumnDefinitions.Count)) + { + return Resizable.ColumnDefinitions[gridSplitterTargetedColumnIndex]; + } + + return null; + } + } + + /// + /// Gets the Sibling Column definition of the parent Grid + /// + private ColumnDefinition SiblingColumn + { + get + { + if (Resizable == null) + { + return null; + } + + var gridSplitterSiblingColumnIndex = GetSiblingColumn(); + + if ((gridSplitterSiblingColumnIndex >= 0) + && (gridSplitterSiblingColumnIndex < Resizable.ColumnDefinitions.Count)) + { + return Resizable.ColumnDefinitions[gridSplitterSiblingColumnIndex]; + } + + return null; + } + } + + /// + /// Gets the current Row definition of the parent Grid + /// + private RowDefinition CurrentRow + { + get + { + if (Resizable == null) + { + return null; + } + + var gridSplitterTargetedRowIndex = GetTargetedRow(); + + if ((gridSplitterTargetedRowIndex >= 0) + && (gridSplitterTargetedRowIndex < Resizable.RowDefinitions.Count)) + { + return Resizable.RowDefinitions[gridSplitterTargetedRowIndex]; + } + + return null; + } + } + + /// + /// Gets the Sibling Row definition of the parent Grid + /// + private RowDefinition SiblingRow + { + get + { + if (Resizable == null) + { + return null; + } + + var gridSplitterSiblingRowIndex = GetSiblingRow(); + + if ((gridSplitterSiblingRowIndex >= 0) + && (gridSplitterSiblingRowIndex < Resizable.RowDefinitions.Count)) + { + return Resizable.RowDefinitions[gridSplitterSiblingRowIndex]; + } + + return null; + } + } + + /// + /// Initializes a new instance of the class. + /// + public GridSplitter() + { + DefaultStyleKey = typeof(GridSplitter); + Loaded += GridSplitter_Loaded; + string automationName = CommunityToolkit.WinUI.StringExtensions.GetLocalized("WCT_GridSplitter_AutomationName", "CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); + AutomationProperties.SetName(this, automationName); + } + + /// + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + // Unhook registered events + Loaded -= GridSplitter_Loaded; + PointerEntered -= GridSplitter_PointerEntered; + PointerExited -= GridSplitter_PointerExited; + PointerPressed -= GridSplitter_PointerPressed; + PointerReleased -= GridSplitter_PointerReleased; + ManipulationStarted -= GridSplitter_ManipulationStarted; + ManipulationCompleted -= GridSplitter_ManipulationCompleted; + + _hoverWrapper?.UnhookEvents(); + + // Register Events + Loaded += GridSplitter_Loaded; + PointerEntered += GridSplitter_PointerEntered; + PointerExited += GridSplitter_PointerExited; + PointerPressed += GridSplitter_PointerPressed; + PointerReleased += GridSplitter_PointerReleased; + ManipulationStarted += GridSplitter_ManipulationStarted; + ManipulationCompleted += GridSplitter_ManipulationCompleted; + + _hoverWrapper?.UpdateHoverElement(Element); + + ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY; + } + + private void GridSplitter_PointerReleased(object sender, PointerRoutedEventArgs e) + { + _pressed = false; + VisualStateManager.GoToState(this, _pointerEntered ? "PointerOver" : "Normal", true); + } + + private void GridSplitter_PointerPressed(object sender, PointerRoutedEventArgs e) + { + _pressed = true; + VisualStateManager.GoToState(this, "Pressed", true); + } + + private void GridSplitter_PointerExited(object sender, PointerRoutedEventArgs e) + { + _pointerEntered = false; + + if (!_pressed && !_dragging) + { + VisualStateManager.GoToState(this, "Normal", true); + } + } + + private void GridSplitter_PointerEntered(object sender, PointerRoutedEventArgs e) + { + _pointerEntered = true; + + if (!_pressed && !_dragging) + { + VisualStateManager.GoToState(this, "PointerOver", true); + } + } + + private void GridSplitter_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) + { + _dragging = false; + _pressed = false; + VisualStateManager.GoToState(this, _pointerEntered ? "PointerOver" : "Normal", true); + } + + private void GridSplitter_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) + { + _dragging = true; + VisualStateManager.GoToState(this, "Pressed", true); + } + } +} diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.xaml b/src/Files.App.Controls/GridSplitter/GridSplitter.xaml new file mode 100644 index 000000000000..849a4285b30a --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs b/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs new file mode 100644 index 000000000000..353e46c3b035 --- /dev/null +++ b/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs @@ -0,0 +1,184 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.UI.Input; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Input; + +namespace Files.App.Controls +{ + internal class GripperHoverWrapper + { + private readonly GridSplitter.GridResizeDirection _gridSplitterDirection; + + private InputCursor _splitterPreviousPointer; + private InputCursor _previousCursor; + private GridSplitter.GripperCursorType _gripperCursor; + private int _gripperCustomCursorResource; + private bool _isDragging; + private UIElement _element; + + internal GridSplitter.GripperCursorType GripperCursor + { + get + { + return _gripperCursor; + } + + set + { + _gripperCursor = value; + } + } + + internal int GripperCustomCursorResource + { + get + { + return _gripperCustomCursorResource; + } + + set + { + _gripperCustomCursorResource = value; + } + } + + /// + /// Initializes a new instance of the class that add cursor change on hover functionality for GridSplitter. + /// + /// UI element to apply cursor change on hover + /// GridSplitter resize direction + /// GridSplitter gripper on hover cursor type + /// GridSplitter gripper custom cursor resource number + internal GripperHoverWrapper(UIElement element, GridSplitter.GridResizeDirection gridSplitterDirection, GridSplitter.GripperCursorType gripperCursor, int gripperCustomCursorResource) + { + _gridSplitterDirection = gridSplitterDirection; + _gripperCursor = gripperCursor; + _gripperCustomCursorResource = gripperCustomCursorResource; + _element = element; + UnhookEvents(); + _element.PointerEntered += Element_PointerEntered; + _element.PointerExited += Element_PointerExited; + } + + internal void UpdateHoverElement(UIElement element) + { + UnhookEvents(); + _element = element; + _element.PointerEntered += Element_PointerEntered; + _element.PointerExited += Element_PointerExited; + } + + private void Element_PointerExited(object sender, PointerRoutedEventArgs e) + { + if (_isDragging) + { + // if dragging don't update the cursor just update the splitter cursor with the last window cursor, + // because the splitter is still using the arrow cursor and will revert to original case when drag completes + _splitterPreviousPointer = _previousCursor; + } + else + { + if (Window.Current != null) + { + // Window.Current.CoreWindow.PointerCursor = _previousCursor; + } + } + } + + private void Element_PointerEntered(object sender, PointerRoutedEventArgs e) + { + // if not dragging + if (!_isDragging) + { + if (Window.Current != null) + { + // _previousCursor = _splitterPreviousPointer = Window.Current.CoreWindow.PointerCursor; + } + + UpdateDisplayCursor(); + } + + // if dragging + else + { + _previousCursor = _splitterPreviousPointer; + } + } + + private void UpdateDisplayCursor() + { + if (Window.Current == null) + { + return; + } + + if (_gripperCursor == GridSplitter.GripperCursorType.Default) + { + if (_gridSplitterDirection == GridSplitter.GridResizeDirection.Columns) + { + // Window.Current.CoreWindow.PointerCursor = GridSplitter.ColumnsSplitterCursor; + } + else if (_gridSplitterDirection == GridSplitter.GridResizeDirection.Rows) + { + // Window.Current.CoreWindow.PointerCursor = GridSplitter.RowSplitterCursor; + } + } + else + { + var inputSystemCursorShape = (InputSystemCursorShape)((int)_gripperCursor); + if (_gripperCursor == GridSplitter.GripperCursorType.Custom) + { + if (_gripperCustomCursorResource > GridSplitter.GripperCustomCursorDefaultResource) + { + // Window.Current.CoreWindow.PointerCursor = InputDesktopResourceCursor.Create((uint)_gripperCustomCursorResource); + } + } + else + { + // Window.Current.CoreWindow.PointerCursor = InputSystemCursor.Create(inputSystemCursorShape); + } + } + } + + internal void SplitterManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) + { + var splitter = sender as GridSplitter; + if (splitter == null) + { + return; + } + + _splitterPreviousPointer = splitter.PreviousCursor; + _isDragging = true; + } + + internal void SplitterManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) + { + var splitter = sender as GridSplitter; + if (splitter == null) + { + return; + } + + if (Window.Current != null) + { + // Window.Current.CoreWindow.PointerCursor = splitter.PreviousCursor = _splitterPreviousPointer; + } + + _isDragging = false; + } + + internal void UnhookEvents() + { + if (_element == null) + { + return; + } + + _element.PointerEntered -= Element_PointerEntered; + _element.PointerExited -= Element_PointerExited; + } + } +} diff --git a/src/Files.App.Controls/ThemedIcon/Data/ThemedIconLayers.cs b/src/Files.App.Controls/ThemedIcon/Data/ThemedIconLayers.cs index c5385fdb3df6..7a9d4f4693a0 100644 --- a/src/Files.App.Controls/ThemedIcon/Data/ThemedIconLayers.cs +++ b/src/Files.App.Controls/ThemedIcon/Data/ThemedIconLayers.cs @@ -6,7 +6,7 @@ namespace Files.App.Controls /// /// A collection of Layers for the ThemedIcon's Layered IconType /// - public sealed class ThemedIconLayers : List + public sealed partial class ThemedIconLayers : List { } } diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs index 18e7cfe16e4c..3a87ce1efc43 100644 --- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs +++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; diff --git a/src/Files.App.Controls/Themes/Generic.xaml b/src/Files.App.Controls/Themes/Generic.xaml index 88feb88b08a7..aa0d91dccce9 100644 --- a/src/Files.App.Controls/Themes/Generic.xaml +++ b/src/Files.App.Controls/Themes/Generic.xaml @@ -46,6 +46,14 @@ + + + + + + + + diff --git a/src/Files.App.Controls/Toolbar/ToolbarItemList.cs b/src/Files.App.Controls/Toolbar/ToolbarItemList.cs index 036b4db92440..ab90a1294fa7 100644 --- a/src/Files.App.Controls/Toolbar/ToolbarItemList.cs +++ b/src/Files.App.Controls/Toolbar/ToolbarItemList.cs @@ -7,7 +7,7 @@ namespace Files.App.Controls /// A collection of Toolbar Items, /// that are included in the IToolbarItemSet interface /// - internal class ToolbarItemList : List + internal partial class ToolbarItemList : List { } } diff --git a/src/Files.App.Controls/Toolbar/ToolbarItemOverflowList.cs b/src/Files.App.Controls/Toolbar/ToolbarItemOverflowList.cs index 185a5c2ae73c..8eb81f37536f 100644 --- a/src/Files.App.Controls/Toolbar/ToolbarItemOverflowList.cs +++ b/src/Files.App.Controls/Toolbar/ToolbarItemOverflowList.cs @@ -7,7 +7,7 @@ namespace Files.App.Controls /// A collection of Toolbar Items which are presented in the Overflow Menu, /// that are included in the IToolbarItemSet interface /// - internal class ToolbarItemOverflowList : List + internal partial class ToolbarItemOverflowList : List { } } diff --git a/src/Files.App.CsWin32/Files.App.CsWin32.csproj b/src/Files.App.CsWin32/Files.App.CsWin32.csproj index 2a1d7733b97e..c5e3eb35d2ff 100644 --- a/src/Files.App.CsWin32/Files.App.CsWin32.csproj +++ b/src/Files.App.CsWin32/Files.App.CsWin32.csproj @@ -2,20 +2,17 @@ - net8.0-windows10.0.22621.0 - 10.0.19041.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) + $(MinimalWindowsVersion) enable true Debug;Release x86;x64;arm64 win-x86;win-x64;win-arm64 - TRACE;DEBUG;NETFX_CORE - TRACE;RELEASE;NETFX_CORE - true - + diff --git a/src/Files.App.Launcher/Files.App.Launcher.vcxproj b/src/Files.App.Launcher/Files.App.Launcher.vcxproj index ffebd7e47f4e..73e529d05a4a 100644 --- a/src/Files.App.Launcher/Files.App.Launcher.vcxproj +++ b/src/Files.App.Launcher/Files.App.Launcher.vcxproj @@ -1,7 +1,6 @@ - - + - + Debug @@ -11,18 +10,6 @@ Debug Win32 - - Preview - arm64 - - - Preview - Win32 - - - Preview - x64 - Release arm64 @@ -39,42 +26,6 @@ Release x64 - - Sideload - arm64 - - - Sideload - Win32 - - - Sideload - x64 - - - Stable - arm64 - - - Stable - Win32 - - - Stable - x64 - - - Store - arm64 - - - Store - Win32 - - - Store - x64 - 16.0 @@ -137,54 +88,6 @@ true - - - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) @@ -209,54 +112,6 @@ true - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - true @@ -269,54 +124,6 @@ true - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - - - - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - true - true - - @@ -329,15 +136,15 @@ - - + + This project references a NuGet package that is not on this computer. To download those packages, use Restore NuGet Packages. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + \ No newline at end of file diff --git a/src/Files.App.Launcher/packages.config b/src/Files.App.Launcher/packages.config index 1b706ca9a10d..2ddc908f46b1 100644 --- a/src/Files.App.Launcher/packages.config +++ b/src/Files.App.Launcher/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/src/Files.App.OpenDialog/Files.App.OpenDialog.Win32.vcxproj b/src/Files.App.OpenDialog/Files.App.OpenDialog.Win32.vcxproj index 598773b450c6..a9dca5ab0bda 100644 --- a/src/Files.App.OpenDialog/Files.App.OpenDialog.Win32.vcxproj +++ b/src/Files.App.OpenDialog/Files.App.OpenDialog.Win32.vcxproj @@ -1,5 +1,4 @@ - - + @@ -11,18 +10,6 @@ Debug Win32 - - Preview - arm64 - - - Preview - Win32 - - - Preview - x64 - Release arm64 @@ -39,42 +26,6 @@ Release x64 - - Sideload - arm64 - - - Sideload - Win32 - - - Sideload - x64 - - - Stable - arm64 - - - Stable - Win32 - - - Stable - x64 - - - Store - arm64 - - - Store - Win32 - - - Store - x64 - @@ -199,78 +150,6 @@ - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -288,74 +167,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -373,74 +184,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - diff --git a/src/Files.App.OpenDialog/Files.App.OpenDialog.vcxproj b/src/Files.App.OpenDialog/Files.App.OpenDialog.vcxproj index 94052383644d..360f87f88699 100644 --- a/src/Files.App.OpenDialog/Files.App.OpenDialog.vcxproj +++ b/src/Files.App.OpenDialog/Files.App.OpenDialog.vcxproj @@ -1,5 +1,4 @@ - - + @@ -11,18 +10,6 @@ Debug Win32 - - Preview - arm64 - - - Preview - Win32 - - - Preview - x64 - Release arm64 @@ -39,42 +26,6 @@ Release x64 - - Sideload - arm64 - - - Sideload - Win32 - - - Sideload - x64 - - - Stable - arm64 - - - Stable - Win32 - - - Stable - x64 - - - Store - arm64 - - - Store - Win32 - - - Store - x64 - @@ -199,78 +150,6 @@ - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -288,74 +167,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -373,74 +184,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - diff --git a/src/Files.App.SaveDialog/Files.App.SaveDialog.Win32.vcxproj b/src/Files.App.SaveDialog/Files.App.SaveDialog.Win32.vcxproj index 093daad2d273..4e10f8e97c96 100644 --- a/src/Files.App.SaveDialog/Files.App.SaveDialog.Win32.vcxproj +++ b/src/Files.App.SaveDialog/Files.App.SaveDialog.Win32.vcxproj @@ -1,5 +1,4 @@ - - + @@ -10,18 +9,6 @@ Debug Win32 - - Preview - arm64 - - - Preview - Win32 - - - Preview - x64 - Release arm64 @@ -38,42 +25,6 @@ Release x64 - - Sideload - arm64 - - - Sideload - Win32 - - - Sideload - x64 - - - Stable - arm64 - - - Stable - Win32 - - - Stable - x64 - - - Store - arm64 - - - Store - Win32 - - - Store - x64 - @@ -198,78 +149,6 @@ - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -287,74 +166,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -372,74 +183,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - diff --git a/src/Files.App.SaveDialog/Files.App.SaveDialog.vcxproj b/src/Files.App.SaveDialog/Files.App.SaveDialog.vcxproj index 9e0232aa2b88..23fc93e0b6e2 100644 --- a/src/Files.App.SaveDialog/Files.App.SaveDialog.vcxproj +++ b/src/Files.App.SaveDialog/Files.App.SaveDialog.vcxproj @@ -1,5 +1,4 @@ - - + Debug @@ -9,18 +8,6 @@ Debug Win32 - - Preview - arm64 - - - Preview - Win32 - - - Preview - x64 - Release arm64 @@ -37,42 +24,6 @@ Release x64 - - Sideload - arm64 - - - Sideload - Win32 - - - Sideload - x64 - - - Stable - arm64 - - - Stable - Win32 - - - Stable - x64 - - - Store - arm64 - - - Store - Win32 - - - Store - x64 - @@ -197,78 +148,6 @@ - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - Win32 - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -286,74 +165,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - MaxSpeed @@ -371,74 +182,6 @@ - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - - MaxSpeed - _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - diff --git a/src/Files.App.Server/Files.App.Server.csproj b/src/Files.App.Server/Files.App.Server.csproj index e1b3088d182f..5a7182926f7e 100644 --- a/src/Files.App.Server/Files.App.Server.csproj +++ b/src/Files.App.Server/Files.App.Server.csproj @@ -1,4 +1,4 @@ - + @@ -6,8 +6,8 @@ en-US Scale|DXFeatureLevel Language=en-US;af;ar;be-BY;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;lt-LT;lv-LV;ms-MY;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant - net8.0-windows10.0.22621.0 - 10.0.19041.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) + $(MinimalWindowsVersion) enable enable Debug;Release @@ -19,7 +19,7 @@ win-arm64 true true - 10.0.22621.0 + $(TargetWindowsVersion) app.manifest False True @@ -29,18 +29,10 @@ true - - TRACE;DEBUG;NETFX_CORE - - - TRACE;RELEASE;NETFX_CORE - true - - - + diff --git a/src/Files.App.Storage/Files.App.Storage.csproj b/src/Files.App.Storage/Files.App.Storage.csproj index d8be755d9c22..89c2a3eb5d58 100644 --- a/src/Files.App.Storage/Files.App.Storage.csproj +++ b/src/Files.App.Storage/Files.App.Storage.csproj @@ -2,8 +2,8 @@ - net8.0-windows10.0.22621.0 - 10.0.19041.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) + $(MinimalWindowsVersion) enable true Debug;Release @@ -12,17 +12,9 @@ - + - - TRACE;DEBUG;NETFX_CORE - - - TRACE;RELEASE;NETFX_CORE - true - - diff --git a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoArchiveAction.cs b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoArchiveAction.cs index eaf355c1ed52..2fd4e5b3c9f5 100644 --- a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoArchiveAction.cs +++ b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoArchiveAction.cs @@ -7,7 +7,7 @@ namespace Files.App.Actions { - internal sealed class CompressIntoArchiveAction : BaseCompressArchiveAction + internal sealed partial class CompressIntoArchiveAction : BaseCompressArchiveAction { public override string Label => "CreateArchive".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoSevenZipAction.cs b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoSevenZipAction.cs index ed25ceb47847..000f30461a59 100644 --- a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoSevenZipAction.cs +++ b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoSevenZipAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CompressIntoSevenZipAction : BaseCompressArchiveAction + internal sealed partial class CompressIntoSevenZipAction : BaseCompressArchiveAction { public override string Label => string.Format("CreateNamedArchive".GetLocalizedResource(), $"{StorageArchiveService.GenerateArchiveNameFromItems(context.SelectedItems)}.7z"); diff --git a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoZipAction.cs b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoZipAction.cs index b1f9bc7afb72..c8d7d11c91e9 100644 --- a/src/Files.App/Actions/Content/Archives/Compress/CompressIntoZipAction.cs +++ b/src/Files.App/Actions/Content/Archives/Compress/CompressIntoZipAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CompressIntoZipAction : BaseCompressArchiveAction + internal sealed partial class CompressIntoZipAction : BaseCompressArchiveAction { public override string Label => string.Format("CreateNamedArchive".GetLocalizedResource(), $"{StorageArchiveService.GenerateArchiveNameFromItems(context.SelectedItems)}.zip"); diff --git a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs index f9aa9dc27bfe..37206ce95d08 100644 --- a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs +++ b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs @@ -11,7 +11,7 @@ namespace Files.App.Actions { - internal sealed class DecompressArchive : BaseDecompressArchiveAction + internal sealed partial class DecompressArchive : BaseDecompressArchiveAction { public override string Label => "ExtractFiles".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHere.cs b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHere.cs index e599e31c289a..b79a236d9c8b 100644 --- a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHere.cs +++ b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHere.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class DecompressArchiveHere : BaseDecompressArchiveAction + internal sealed partial class DecompressArchiveHere : BaseDecompressArchiveAction { public override string Label => "ExtractHere".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHereSmart.cs b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHereSmart.cs index f842879abf8d..a7e29a0c881f 100644 --- a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHereSmart.cs +++ b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveHereSmart.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class DecompressArchiveHereSmart : BaseDecompressArchiveAction + internal sealed partial class DecompressArchiveHereSmart : BaseDecompressArchiveAction { public override string Label => "ExtractHereSmart".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveToChildFolderAction.cs b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveToChildFolderAction.cs index d87d2f3d5a3c..d63bfaca0816 100644 --- a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveToChildFolderAction.cs +++ b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchiveToChildFolderAction.cs @@ -9,7 +9,7 @@ namespace Files.App.Actions { - internal sealed class DecompressArchiveToChildFolderAction : BaseDecompressArchiveAction + internal sealed partial class DecompressArchiveToChildFolderAction : BaseDecompressArchiveAction { public override string Label => ComputeLabel(); diff --git a/src/Files.App/Actions/Content/Background/SetAsAppBackgroundAction.cs b/src/Files.App/Actions/Content/Background/SetAsAppBackgroundAction.cs index ed8254c93179..b99cb68195e6 100644 --- a/src/Files.App/Actions/Content/Background/SetAsAppBackgroundAction.cs +++ b/src/Files.App/Actions/Content/Background/SetAsAppBackgroundAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SetAsAppBackgroundAction : BaseSetAsAction + internal sealed partial class SetAsAppBackgroundAction : BaseSetAsAction { private readonly IAppearanceSettingsService AppearanceSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs b/src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs index 312229ecb01d..d5478264dc6b 100644 --- a/src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs +++ b/src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class SetAsLockscreenBackgroundAction : BaseSetAsAction + internal sealed partial class SetAsLockscreenBackgroundAction : BaseSetAsAction { private readonly IWindowsWallpaperService WindowsWallpaperService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs b/src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs index 240eb3e71db7..72291e69c652 100644 --- a/src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs +++ b/src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class SetAsSlideshowBackgroundAction : BaseSetAsAction + internal sealed partial class SetAsSlideshowBackgroundAction : BaseSetAsAction { private readonly IWindowsWallpaperService WindowsWallpaperService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs b/src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs index 74ae1370f120..52108e4671c7 100644 --- a/src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs +++ b/src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class SetAsWallpaperBackgroundAction : BaseSetAsAction + internal sealed partial class SetAsWallpaperBackgroundAction : BaseSetAsAction { public override string Label => "SetAsBackground".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/ImageManipulation/RotateLeftAction.cs b/src/Files.App/Actions/Content/ImageManipulation/RotateLeftAction.cs index be867d712b4a..4c1bde731492 100644 --- a/src/Files.App/Actions/Content/ImageManipulation/RotateLeftAction.cs +++ b/src/Files.App/Actions/Content/ImageManipulation/RotateLeftAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class RotateLeftAction : BaseRotateAction + internal sealed partial class RotateLeftAction : BaseRotateAction { public override string Label => "RotateLeft".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/ImageManipulation/RotateRightAction.cs b/src/Files.App/Actions/Content/ImageManipulation/RotateRightAction.cs index 3454ca64b524..57ea8461a95e 100644 --- a/src/Files.App/Actions/Content/ImageManipulation/RotateRightAction.cs +++ b/src/Files.App/Actions/Content/ImageManipulation/RotateRightAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class RotateRightAction : BaseRotateAction + internal sealed partial class RotateRightAction : BaseRotateAction { public override string Label => "RotateRight".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Content/Install/InstallCertificateAction.cs b/src/Files.App/Actions/Content/Install/InstallCertificateAction.cs index 82d220330e28..da1e9febc878 100644 --- a/src/Files.App/Actions/Content/Install/InstallCertificateAction.cs +++ b/src/Files.App/Actions/Content/Install/InstallCertificateAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class InstallCertificateAction : ObservableObject, IAction + internal sealed partial class InstallCertificateAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/Install/InstallFontAction.cs b/src/Files.App/Actions/Content/Install/InstallFontAction.cs index ee36353d5462..fcb01ae37d53 100644 --- a/src/Files.App/Actions/Content/Install/InstallFontAction.cs +++ b/src/Files.App/Actions/Content/Install/InstallFontAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class InstallFontAction : ObservableObject, IAction + internal sealed partial class InstallFontAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs b/src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs index 30c88aa18393..2755ff099402 100644 --- a/src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs +++ b/src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class InstallInfDriverAction : ObservableObject, IAction + internal sealed partial class InstallInfDriverAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/PlayAllAction.cs b/src/Files.App/Actions/Content/PlayAllAction.cs index 96e8640d3f10..4763195bf559 100644 --- a/src/Files.App/Actions/Content/PlayAllAction.cs +++ b/src/Files.App/Actions/Content/PlayAllAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class PlayAllAction : ObservableObject, IAction + internal sealed partial class PlayAllAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/PreviewPopup/LaunchPreviewPopupAction.cs b/src/Files.App/Actions/Content/PreviewPopup/LaunchPreviewPopupAction.cs index 59c7ec4dae16..f14220a105c2 100644 --- a/src/Files.App/Actions/Content/PreviewPopup/LaunchPreviewPopupAction.cs +++ b/src/Files.App/Actions/Content/PreviewPopup/LaunchPreviewPopupAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class LaunchPreviewPopupAction : ObservableObject, IAction + internal sealed partial class LaunchPreviewPopupAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/RefreshItemsAction.cs b/src/Files.App/Actions/Content/RefreshItemsAction.cs index 507c80344648..91fee4ecdb66 100644 --- a/src/Files.App/Actions/Content/RefreshItemsAction.cs +++ b/src/Files.App/Actions/Content/RefreshItemsAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class RefreshItemsAction : ObservableObject, IAction + internal sealed partial class RefreshItemsAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/Run/RunAsAdminAction.cs b/src/Files.App/Actions/Content/Run/RunAsAdminAction.cs index f582c32365ec..b6d96450fbf7 100644 --- a/src/Files.App/Actions/Content/Run/RunAsAdminAction.cs +++ b/src/Files.App/Actions/Content/Run/RunAsAdminAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class RunAsAdminAction : BaseRunAsAction + internal sealed partial class RunAsAdminAction : BaseRunAsAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs b/src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs index 4363c02f1234..05f16040560c 100644 --- a/src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs +++ b/src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class RunAsAnotherUserAction : BaseRunAsAction + internal sealed partial class RunAsAnotherUserAction : BaseRunAsAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); public override string Label diff --git a/src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs b/src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs index 81eef347f988..72700b45ce6b 100644 --- a/src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs +++ b/src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class RunWithPowershellAction : ObservableObject, IAction + internal sealed partial class RunWithPowershellAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/Share/ShareItemAction.cs b/src/Files.App/Actions/Content/Share/ShareItemAction.cs index 4e96d55b6887..5f3d9f15c269 100644 --- a/src/Files.App/Actions/Content/Share/ShareItemAction.cs +++ b/src/Files.App/Actions/Content/Share/ShareItemAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class ShareItemAction : ObservableObject, IAction + internal sealed partial class ShareItemAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Content/Tags/OpenAllTaggedActions.cs b/src/Files.App/Actions/Content/Tags/OpenAllTaggedActions.cs index 9f329d89b995..42e70e19c4ed 100644 --- a/src/Files.App/Actions/Content/Tags/OpenAllTaggedActions.cs +++ b/src/Files.App/Actions/Content/Tags/OpenAllTaggedActions.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - sealed class OpenAllTaggedActions: ObservableObject, IAction + sealed partial class OpenAllTaggedActions: ObservableObject, IAction { private readonly IContentPageContext _pageContext; diff --git a/src/Files.App/Actions/Display/GroupAction.cs b/src/Files.App/Actions/Display/GroupAction.cs index 734287b45ca3..6bf54e49d2a9 100644 --- a/src/Files.App/Actions/Display/GroupAction.cs +++ b/src/Files.App/Actions/Display/GroupAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class GroupByNoneAction : GroupByAction + internal sealed partial class GroupByNoneAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.None; @@ -15,7 +15,7 @@ public override string Description => "GroupByNoneDescription".GetLocalizedResource(); } - internal sealed class GroupByNameAction : GroupByAction + internal sealed partial class GroupByNameAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.Name; @@ -27,7 +27,7 @@ public override string Description => "GroupByNameDescription".GetLocalizedResource(); } - internal sealed class GroupByDateModifiedAction : GroupByAction + internal sealed partial class GroupByDateModifiedAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.DateModified; @@ -39,7 +39,7 @@ public override string Description => "GroupByDateModifiedDescription".GetLocalizedResource(); } - internal sealed class GroupByDateCreatedAction : GroupByAction + internal sealed partial class GroupByDateCreatedAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.DateCreated; @@ -51,7 +51,7 @@ public override string Description => "GroupByDateCreatedDescription".GetLocalizedResource(); } - internal sealed class GroupBySizeAction : GroupByAction + internal sealed partial class GroupBySizeAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.Size; @@ -63,7 +63,7 @@ public override string Description => "GroupBySizeDescription".GetLocalizedResource(); } - internal sealed class GroupByTypeAction : GroupByAction + internal sealed partial class GroupByTypeAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.FileType; @@ -75,7 +75,7 @@ public override string Description => "GroupByTypeDescription".GetLocalizedResource(); } - internal sealed class GroupBySyncStatusAction : GroupByAction + internal sealed partial class GroupBySyncStatusAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.SyncStatus; @@ -90,7 +90,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.CloudDrive; } - internal sealed class GroupByTagAction : GroupByAction + internal sealed partial class GroupByTagAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.FileTag; @@ -102,7 +102,7 @@ public override string Description => "GroupByTagDescription".GetLocalizedResource(); } - internal sealed class GroupByOriginalFolderAction : GroupByAction + internal sealed partial class GroupByOriginalFolderAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.OriginalFolder; @@ -117,7 +117,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.RecycleBin; } - internal sealed class GroupByDateDeletedAction : GroupByAction + internal sealed partial class GroupByDateDeletedAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.DateDeleted; @@ -132,7 +132,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.RecycleBin; } - internal sealed class GroupByFolderPathAction : GroupByAction + internal sealed partial class GroupByFolderPathAction : GroupByAction { protected override GroupOption GroupOption => GroupOption.FolderPath; @@ -200,7 +200,7 @@ private void DisplayContext_PropertyChanged(object? sender, PropertyChangedEvent } } - internal sealed class GroupByDateModifiedYearAction : GroupByDateAction + internal sealed partial class GroupByDateModifiedYearAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateModified; @@ -215,7 +215,7 @@ public override string Description => "GroupByDateModifiedYearDescription".GetLocalizedResource(); } - internal sealed class GroupByDateModifiedMonthAction : GroupByDateAction + internal sealed partial class GroupByDateModifiedMonthAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateModified; @@ -230,7 +230,7 @@ public override string Description => "GroupByDateModifiedMonthDescription".GetLocalizedResource(); } - internal sealed class GroupByDateModifiedDayAction : GroupByDateAction + internal sealed partial class GroupByDateModifiedDayAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateModified; @@ -245,7 +245,7 @@ public override string Description => "GroupByDateModifiedDayDescription".GetLocalizedResource(); } - internal sealed class GroupByDateCreatedYearAction : GroupByDateAction + internal sealed partial class GroupByDateCreatedYearAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateCreated; @@ -260,7 +260,7 @@ public override string Description => "GroupByDateCreatedYearDescription".GetLocalizedResource(); } - internal sealed class GroupByDateCreatedMonthAction : GroupByDateAction + internal sealed partial class GroupByDateCreatedMonthAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateCreated; @@ -275,7 +275,7 @@ public override string Description => "GroupByDateCreatedMonthDescription".GetLocalizedResource(); } - internal sealed class GroupByDateCreatedDayAction : GroupByDateAction + internal sealed partial class GroupByDateCreatedDayAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateCreated; @@ -290,7 +290,7 @@ public override string Description => "GroupByDateCreatedDayDescription".GetLocalizedResource(); } - internal sealed class GroupByDateDeletedYearAction : GroupByDateAction + internal sealed partial class GroupByDateDeletedYearAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateDeleted; @@ -308,7 +308,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.RecycleBin; } - internal sealed class GroupByDateDeletedMonthAction : GroupByDateAction + internal sealed partial class GroupByDateDeletedMonthAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateDeleted; @@ -326,7 +326,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.RecycleBin; } - internal sealed class GroupByDateDeletedDayAction : GroupByDateAction + internal sealed partial class GroupByDateDeletedDayAction : GroupByDateAction { protected override GroupOption GroupOption => GroupOption.DateDeleted; @@ -401,7 +401,7 @@ private void DisplayContext_PropertyChanged(object? sender, PropertyChangedEvent } } - internal sealed class GroupAscendingAction : ObservableObject, IToggleAction + internal sealed partial class GroupAscendingAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; @@ -446,7 +446,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) } } - internal sealed class GroupDescendingAction : ObservableObject, IToggleAction + internal sealed partial class GroupDescendingAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; @@ -515,7 +515,7 @@ public Task ExecuteAsync(object? parameter = null) } } - internal sealed class GroupByYearAction : ObservableObject, IToggleAction + internal sealed partial class GroupByYearAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; @@ -560,7 +560,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) } } - internal sealed class GroupByMonthAction : ObservableObject, IToggleAction + internal sealed partial class GroupByMonthAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; diff --git a/src/Files.App/Actions/Display/LayoutAction.cs b/src/Files.App/Actions/Display/LayoutAction.cs index 7e99a6d016fe..e57c6bf27774 100644 --- a/src/Files.App/Actions/Display/LayoutAction.cs +++ b/src/Files.App/Actions/Display/LayoutAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class LayoutDetailsAction : ToggleLayoutAction + internal sealed partial class LayoutDetailsAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.Details; @@ -21,7 +21,7 @@ public override HotKey HotKey => new(Keys.Number1, KeyModifiers.CtrlShift); } - internal sealed class LayoutListAction : ToggleLayoutAction + internal sealed partial class LayoutListAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.List; @@ -39,7 +39,7 @@ public override HotKey HotKey => new(Keys.Number2, KeyModifiers.CtrlShift); } - internal sealed class LayoutCardsAction : ToggleLayoutAction + internal sealed partial class LayoutCardsAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.Cards; @@ -57,7 +57,7 @@ public override HotKey HotKey => new(Keys.Number3, KeyModifiers.CtrlShift); } - internal sealed class LayoutGridAction : ToggleLayoutAction + internal sealed partial class LayoutGridAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.Grid; @@ -75,7 +75,7 @@ public override HotKey HotKey => new(Keys.Number4, KeyModifiers.CtrlShift); } - internal sealed class LayoutColumnsAction : ToggleLayoutAction + internal sealed partial class LayoutColumnsAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.Columns; @@ -93,7 +93,7 @@ public override HotKey HotKey => new(Keys.Number5, KeyModifiers.CtrlShift); } - internal sealed class LayoutAdaptiveAction : ToggleLayoutAction + internal sealed partial class LayoutAdaptiveAction : ToggleLayoutAction { protected override LayoutTypes LayoutType => LayoutTypes.Adaptive; @@ -168,7 +168,7 @@ protected virtual void OnContextChanged(string propertyName) } } - internal sealed class LayoutDecreaseSizeAction : ObservableObject, IAction + internal sealed partial class LayoutDecreaseSizeAction : ObservableObject, IAction { private static readonly IUserSettingsService UserSettingsService = Ioc.Default.GetRequiredService(); private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); @@ -256,7 +256,7 @@ public Task ExecuteAsync(object? parameter = null) } } - internal sealed class LayoutIncreaseSizeAction : ObservableObject, IAction + internal sealed partial class LayoutIncreaseSizeAction : ObservableObject, IAction { private static readonly IUserSettingsService UserSettingsService = Ioc.Default.GetRequiredService(); private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Display/SortAction.cs b/src/Files.App/Actions/Display/SortAction.cs index 1e78176035c9..6e06ca05204d 100644 --- a/src/Files.App/Actions/Display/SortAction.cs +++ b/src/Files.App/Actions/Display/SortAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SortByNameAction : SortByAction + internal sealed partial class SortByNameAction : SortByAction { protected override SortOption SortOption => SortOption.Name; @@ -15,7 +15,7 @@ public override string Description => "SortByNameDescription".GetLocalizedResource(); } - internal sealed class SortByDateModifiedAction : SortByAction + internal sealed partial class SortByDateModifiedAction : SortByAction { protected override SortOption SortOption => SortOption.DateModified; @@ -27,7 +27,7 @@ public override string Description => "SortByDateModifiedDescription".GetLocalizedResource(); } - internal sealed class SortByDateCreatedAction : SortByAction + internal sealed partial class SortByDateCreatedAction : SortByAction { protected override SortOption SortOption => SortOption.DateCreated; @@ -39,7 +39,7 @@ public override string Description => "SortByDateCreatedDescription".GetLocalizedResource(); } - internal sealed class SortBySizeAction : SortByAction + internal sealed partial class SortBySizeAction : SortByAction { protected override SortOption SortOption => SortOption.Size; @@ -51,7 +51,7 @@ public override string Description => "SortBySizeDescription".GetLocalizedResource(); } - internal sealed class SortByTypeAction : SortByAction + internal sealed partial class SortByTypeAction : SortByAction { protected override SortOption SortOption => SortOption.FileType; @@ -63,7 +63,7 @@ public override string Description => "SortByTypeDescription".GetLocalizedResource(); } - internal sealed class SortBySyncStatusAction : SortByAction + internal sealed partial class SortBySyncStatusAction : SortByAction { protected override SortOption SortOption => SortOption.SyncStatus; @@ -78,7 +78,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.CloudDrive; } - internal sealed class SortByTagAction : SortByAction + internal sealed partial class SortByTagAction : SortByAction { protected override SortOption SortOption => SortOption.FileTag; @@ -90,7 +90,7 @@ public override string Description => "SortByTagDescription".GetLocalizedResource(); } - internal sealed class SortByPathAction : SortByAction + internal sealed partial class SortByPathAction : SortByAction { protected override SortOption SortOption => SortOption.Path; @@ -105,7 +105,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.SearchResults; } - internal sealed class SortByOriginalFolderAction : SortByAction + internal sealed partial class SortByOriginalFolderAction : SortByAction { protected override SortOption SortOption => SortOption.OriginalFolder; @@ -120,7 +120,7 @@ protected override bool GetIsExecutable(ContentPageTypes pageType) => pageType is ContentPageTypes.RecycleBin; } - internal sealed class SortByDateDeletedAction : SortByAction + internal sealed partial class SortByDateDeletedAction : SortByAction { protected override SortOption SortOption => SortOption.DateDeleted; @@ -185,7 +185,7 @@ private void DisplayContext_PropertyChanged(object? sender, PropertyChangedEvent } } - internal sealed class SortAscendingAction : ObservableObject, IToggleAction + internal sealed partial class SortAscendingAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; @@ -220,7 +220,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) } } - internal sealed class SortDescendingAction : ObservableObject, IToggleAction + internal sealed partial class SortDescendingAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; diff --git a/src/Files.App/Actions/Display/SortFilesAndFoldersTogetherAction.cs b/src/Files.App/Actions/Display/SortFilesAndFoldersTogetherAction.cs index 49f0311aa0d4..633bf34b709c 100644 --- a/src/Files.App/Actions/Display/SortFilesAndFoldersTogetherAction.cs +++ b/src/Files.App/Actions/Display/SortFilesAndFoldersTogetherAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SortFilesAndFoldersTogetherAction : ObservableObject, IToggleAction + internal sealed partial class SortFilesAndFoldersTogetherAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; diff --git a/src/Files.App/Actions/Display/SortFilesFirstAction.cs b/src/Files.App/Actions/Display/SortFilesFirstAction.cs index b7169e250aef..d2adfcf905ef 100644 --- a/src/Files.App/Actions/Display/SortFilesFirstAction.cs +++ b/src/Files.App/Actions/Display/SortFilesFirstAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SortFilesFirstAction : ObservableObject, IToggleAction + internal sealed partial class SortFilesFirstAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; diff --git a/src/Files.App/Actions/Display/SortFoldersFirstAction.cs b/src/Files.App/Actions/Display/SortFoldersFirstAction.cs index 95b815515c22..731543e63ad7 100644 --- a/src/Files.App/Actions/Display/SortFoldersFirstAction.cs +++ b/src/Files.App/Actions/Display/SortFoldersFirstAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SortFoldersFirstAction : ObservableObject, IToggleAction + internal sealed partial class SortFoldersFirstAction : ObservableObject, IToggleAction { private readonly IDisplayPageContext context; diff --git a/src/Files.App/Actions/FileSystem/AddItemAction.cs b/src/Files.App/Actions/FileSystem/AddItemAction.cs index f67ee1dc9799..acb8316c6772 100644 --- a/src/Files.App/Actions/FileSystem/AddItemAction.cs +++ b/src/Files.App/Actions/FileSystem/AddItemAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class AddItemAction : ObservableObject, IAction + internal sealed partial class AddItemAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/CreateAlternateDataStreamAction.cs b/src/Files.App/Actions/FileSystem/CreateAlternateDataStreamAction.cs index c3f8e57f83e1..19c60104188b 100644 --- a/src/Files.App/Actions/FileSystem/CreateAlternateDataStreamAction.cs +++ b/src/Files.App/Actions/FileSystem/CreateAlternateDataStreamAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class CreateAlternateDataStreamAction : BaseUIAction, IAction + internal sealed partial class CreateAlternateDataStreamAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/CreateFolderAction.cs b/src/Files.App/Actions/FileSystem/CreateFolderAction.cs index 2a0fb3041b5f..c03f341966d9 100644 --- a/src/Files.App/Actions/FileSystem/CreateFolderAction.cs +++ b/src/Files.App/Actions/FileSystem/CreateFolderAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CreateFolderAction : BaseUIAction, IAction + internal sealed partial class CreateFolderAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/CreateFolderWithSelectionAction.cs b/src/Files.App/Actions/FileSystem/CreateFolderWithSelectionAction.cs index 6508e608bda2..25db7ee6bf2a 100644 --- a/src/Files.App/Actions/FileSystem/CreateFolderWithSelectionAction.cs +++ b/src/Files.App/Actions/FileSystem/CreateFolderWithSelectionAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CreateFolderWithSelectionAction : ObservableObject, IAction + internal sealed partial class CreateFolderWithSelectionAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/CreateShortcutAction.cs b/src/Files.App/Actions/FileSystem/CreateShortcutAction.cs index 07656413c7a7..c6af368cd465 100644 --- a/src/Files.App/Actions/FileSystem/CreateShortcutAction.cs +++ b/src/Files.App/Actions/FileSystem/CreateShortcutAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CreateShortcutAction : BaseUIAction, IAction + internal sealed partial class CreateShortcutAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs b/src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs index 4600caecf206..84059f46f1cf 100644 --- a/src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs +++ b/src/Files.App/Actions/FileSystem/CreateShortcutFromDialogAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CreateShortcutFromDialogAction : BaseUIAction, IAction + internal sealed partial class CreateShortcutFromDialogAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/DeleteItemAction.cs b/src/Files.App/Actions/FileSystem/DeleteItemAction.cs index bbf6d762fb36..42433abae93b 100644 --- a/src/Files.App/Actions/FileSystem/DeleteItemAction.cs +++ b/src/Files.App/Actions/FileSystem/DeleteItemAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class DeleteItemAction : BaseDeleteAction, IAction + internal sealed partial class DeleteItemAction : BaseDeleteAction, IAction { public string Label => "Delete".GetLocalizedResource(); diff --git a/src/Files.App/Actions/FileSystem/DeleteItemPermanentlyAction.cs b/src/Files.App/Actions/FileSystem/DeleteItemPermanentlyAction.cs index 64b1f08d227e..2358a4adf5eb 100644 --- a/src/Files.App/Actions/FileSystem/DeleteItemPermanentlyAction.cs +++ b/src/Files.App/Actions/FileSystem/DeleteItemPermanentlyAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class DeleteItemPermanentlyAction : BaseDeleteAction, IAction + internal sealed partial class DeleteItemPermanentlyAction : BaseDeleteAction, IAction { public string Label => "DeletePermanently".GetLocalizedResource(); diff --git a/src/Files.App/Actions/FileSystem/EmptyRecycleBinAction.cs b/src/Files.App/Actions/FileSystem/EmptyRecycleBinAction.cs index 42ccd2526b90..c7bdb9e56ca0 100644 --- a/src/Files.App/Actions/FileSystem/EmptyRecycleBinAction.cs +++ b/src/Files.App/Actions/FileSystem/EmptyRecycleBinAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class EmptyRecycleBinAction : BaseUIAction, IAction + internal sealed partial class EmptyRecycleBinAction : BaseUIAction, IAction { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); private readonly StatusCenterViewModel StatusCenterViewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs index 637d67340818..7e4b54c3de16 100644 --- a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs @@ -9,7 +9,7 @@ namespace Files.App.Actions { - internal sealed class FlattenFolderAction : ObservableObject, IAction + internal sealed partial class FlattenFolderAction : ObservableObject, IAction { private readonly IContentPageContext context; private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/FormatDriveAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveAction.cs index efeb2330768c..a0c269b05607 100644 --- a/src/Files.App/Actions/FileSystem/FormatDriveAction.cs +++ b/src/Files.App/Actions/FileSystem/FormatDriveAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal class FormatDriveAction : ObservableObject, IAction + internal partial class FormatDriveAction : ObservableObject, IAction { private readonly IContentPageContext context = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs index cd35caffd0ae..d15a67720666 100644 --- a/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs +++ b/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class FormatDriveFromHomeAction : FormatDriveAction + internal sealed partial class FormatDriveFromHomeAction : FormatDriveAction { private IHomePageContext HomePageContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs index 819576ed35e9..6dbd267dae79 100644 --- a/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs +++ b/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class FormatDriveFromSidebarAction : FormatDriveAction + internal sealed partial class FormatDriveFromSidebarAction : FormatDriveAction { private ISidebarContext SidebarContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/OpenFileLocationAction.cs b/src/Files.App/Actions/FileSystem/OpenFileLocationAction.cs index ea0334781af2..4388054bec59 100644 --- a/src/Files.App/Actions/FileSystem/OpenFileLocationAction.cs +++ b/src/Files.App/Actions/FileSystem/OpenFileLocationAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class OpenFileLocationAction : ObservableObject, IAction + internal sealed partial class OpenFileLocationAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/OpenItemAction.cs b/src/Files.App/Actions/FileSystem/OpenItemAction.cs index 663690abf70b..adcc0ae5a630 100644 --- a/src/Files.App/Actions/FileSystem/OpenItemAction.cs +++ b/src/Files.App/Actions/FileSystem/OpenItemAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class OpenItemAction : ObservableObject, IAction + internal sealed partial class OpenItemAction : ObservableObject, IAction { private readonly IContentPageContext context; @@ -50,7 +50,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) } } - internal sealed class OpenItemWithApplicationPickerAction : ObservableObject, IAction + internal sealed partial class OpenItemWithApplicationPickerAction : ObservableObject, IAction { private readonly IContentPageContext context; @@ -91,7 +91,7 @@ private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) } } - internal sealed class OpenParentFolderAction : ObservableObject, IAction + internal sealed partial class OpenParentFolderAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/PasteItemAction.cs b/src/Files.App/Actions/FileSystem/PasteItemAction.cs index 32fd49fa7077..7e098e8b4fdf 100644 --- a/src/Files.App/Actions/FileSystem/PasteItemAction.cs +++ b/src/Files.App/Actions/FileSystem/PasteItemAction.cs @@ -11,7 +11,7 @@ namespace Files.App.Actions { - internal sealed class PasteItemAction : ObservableObject, IAction + internal sealed partial class PasteItemAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/PasteItemAsShortcutAction.cs b/src/Files.App/Actions/FileSystem/PasteItemAsShortcutAction.cs index b42fe1e39e98..d9eefec06c16 100644 --- a/src/Files.App/Actions/FileSystem/PasteItemAsShortcutAction.cs +++ b/src/Files.App/Actions/FileSystem/PasteItemAsShortcutAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class PasteItemAsShortcutAction : ObservableObject, IAction + internal sealed partial class PasteItemAsShortcutAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs b/src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs index 9eeb6e2fe0e7..51467b783c04 100644 --- a/src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs +++ b/src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class PasteItemToSelectionAction : BaseUIAction, IAction + internal sealed partial class PasteItemToSelectionAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/RenameAction.cs b/src/Files.App/Actions/FileSystem/RenameAction.cs index 1e2d9e0d2f4b..c42bd7ab0409 100644 --- a/src/Files.App/Actions/FileSystem/RenameAction.cs +++ b/src/Files.App/Actions/FileSystem/RenameAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class RenameAction : ObservableObject, IAction + internal sealed partial class RenameAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/RestoreAllRecycleBinAction.cs b/src/Files.App/Actions/FileSystem/RestoreAllRecycleBinAction.cs index 430ca25a7fe9..d00768113ba3 100644 --- a/src/Files.App/Actions/FileSystem/RestoreAllRecycleBinAction.cs +++ b/src/Files.App/Actions/FileSystem/RestoreAllRecycleBinAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class RestoreAllRecycleBinAction : BaseUIAction, IAction + internal sealed partial class RestoreAllRecycleBinAction : BaseUIAction, IAction { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/FileSystem/RestoreRecycleBinAction.cs b/src/Files.App/Actions/FileSystem/RestoreRecycleBinAction.cs index 5fad38d71fb8..d667d3ad920f 100644 --- a/src/Files.App/Actions/FileSystem/RestoreRecycleBinAction.cs +++ b/src/Files.App/Actions/FileSystem/RestoreRecycleBinAction.cs @@ -7,7 +7,7 @@ namespace Files.App.Actions { - internal sealed class RestoreRecycleBinAction : BaseUIAction, IAction + internal sealed partial class RestoreRecycleBinAction : BaseUIAction, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/FileSystem/Transfer/CopyItemAction.cs b/src/Files.App/Actions/FileSystem/Transfer/CopyItemAction.cs index 646fdd39faed..38335da27760 100644 --- a/src/Files.App/Actions/FileSystem/Transfer/CopyItemAction.cs +++ b/src/Files.App/Actions/FileSystem/Transfer/CopyItemAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class CopyItemAction : BaseTransferItemAction, IAction + internal sealed partial class CopyItemAction : BaseTransferItemAction, IAction { public string Label => "Copy".GetLocalizedResource(); diff --git a/src/Files.App/Actions/FileSystem/Transfer/CutItemAction.cs b/src/Files.App/Actions/FileSystem/Transfer/CutItemAction.cs index 4833ffb2d93e..da02935114fb 100644 --- a/src/Files.App/Actions/FileSystem/Transfer/CutItemAction.cs +++ b/src/Files.App/Actions/FileSystem/Transfer/CutItemAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class CutItemAction : BaseTransferItemAction, IAction + internal sealed partial class CutItemAction : BaseTransferItemAction, IAction { public string Label => "Cut".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Git/GitFetchAction.cs b/src/Files.App/Actions/Git/GitFetchAction.cs index bc7132208811..6face6e15cc0 100644 --- a/src/Files.App/Actions/Git/GitFetchAction.cs +++ b/src/Files.App/Actions/Git/GitFetchAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class GitFetchAction : ObservableObject, IAction + internal sealed partial class GitFetchAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Git/GitInitAction.cs b/src/Files.App/Actions/Git/GitInitAction.cs index 8ae4e5dd59a0..33c304cbdbba 100644 --- a/src/Files.App/Actions/Git/GitInitAction.cs +++ b/src/Files.App/Actions/Git/GitInitAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - sealed class GitInitAction : ObservableObject, IAction + sealed partial class GitInitAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Git/GitPullAction.cs b/src/Files.App/Actions/Git/GitPullAction.cs index d038829e0685..d1f76cecca26 100644 --- a/src/Files.App/Actions/Git/GitPullAction.cs +++ b/src/Files.App/Actions/Git/GitPullAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class GitPullAction : ObservableObject, IAction + internal sealed partial class GitPullAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Git/GitPushAction.cs b/src/Files.App/Actions/Git/GitPushAction.cs index 0a0df5ee02df..fd50bf117c3a 100644 --- a/src/Files.App/Actions/Git/GitPushAction.cs +++ b/src/Files.App/Actions/Git/GitPushAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class GitPushAction : ObservableObject, IAction + internal sealed partial class GitPushAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Git/GitSyncAction.cs b/src/Files.App/Actions/Git/GitSyncAction.cs index 2b2dd292d58e..ad92a31392f7 100644 --- a/src/Files.App/Actions/Git/GitSyncAction.cs +++ b/src/Files.App/Actions/Git/GitSyncAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class GitSyncAction : ObservableObject, IAction + internal sealed partial class GitSyncAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Global/EnterCompactOverlayAction.cs b/src/Files.App/Actions/Global/EnterCompactOverlayAction.cs index 88b52718517d..18b4cc33a0b4 100644 --- a/src/Files.App/Actions/Global/EnterCompactOverlayAction.cs +++ b/src/Files.App/Actions/Global/EnterCompactOverlayAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class EnterCompactOverlayAction : ObservableObject, IAction + internal sealed partial class EnterCompactOverlayAction : ObservableObject, IAction { private readonly IWindowContext windowContext; diff --git a/src/Files.App/Actions/Global/ExitCompactOverlayAction.cs b/src/Files.App/Actions/Global/ExitCompactOverlayAction.cs index b0c85e78ce52..934877fe0c4e 100644 --- a/src/Files.App/Actions/Global/ExitCompactOverlayAction.cs +++ b/src/Files.App/Actions/Global/ExitCompactOverlayAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class ExitCompactOverlayAction : ObservableObject, IAction + internal sealed partial class ExitCompactOverlayAction : ObservableObject, IAction { private readonly IWindowContext windowContext; diff --git a/src/Files.App/Actions/Global/RedoAction.cs b/src/Files.App/Actions/Global/RedoAction.cs index 16d643137949..a19bd7ce26a5 100644 --- a/src/Files.App/Actions/Global/RedoAction.cs +++ b/src/Files.App/Actions/Global/RedoAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class RedoAction : ObservableObject, IAction + internal sealed partial class RedoAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Global/SearchAction.cs b/src/Files.App/Actions/Global/SearchAction.cs index f1db107df5cd..4f1851ce18e4 100644 --- a/src/Files.App/Actions/Global/SearchAction.cs +++ b/src/Files.App/Actions/Global/SearchAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class SearchAction : ObservableObject, IAction + internal sealed partial class SearchAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Global/ToggleCompactOverlayAction.cs b/src/Files.App/Actions/Global/ToggleCompactOverlayAction.cs index bea7d4c55a58..88e41efe474f 100644 --- a/src/Files.App/Actions/Global/ToggleCompactOverlayAction.cs +++ b/src/Files.App/Actions/Global/ToggleCompactOverlayAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class ToggleCompactOverlayAction : ObservableObject, IToggleAction + internal sealed partial class ToggleCompactOverlayAction : ObservableObject, IToggleAction { private readonly IWindowContext windowContext; diff --git a/src/Files.App/Actions/Global/UndoAction.cs b/src/Files.App/Actions/Global/UndoAction.cs index fb3aeffde7aa..c5c5a2c86c16 100644 --- a/src/Files.App/Actions/Global/UndoAction.cs +++ b/src/Files.App/Actions/Global/UndoAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class UndoAction : ObservableObject, IAction + internal sealed partial class UndoAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/AddHorizontalPaneAction.cs b/src/Files.App/Actions/Navigation/AddHorizontalPaneAction.cs index b816f9d363dc..cbcd03d99523 100644 --- a/src/Files.App/Actions/Navigation/AddHorizontalPaneAction.cs +++ b/src/Files.App/Actions/Navigation/AddHorizontalPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class AddHorizontalPaneAction : ObservableObject, IAction + internal sealed partial class AddHorizontalPaneAction : ObservableObject, IAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Navigation/AddVerticalPaneAction.cs b/src/Files.App/Actions/Navigation/AddVerticalPaneAction.cs index cb816ae84035..fbd9b2fa10d0 100644 --- a/src/Files.App/Actions/Navigation/AddVerticalPaneAction.cs +++ b/src/Files.App/Actions/Navigation/AddVerticalPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class AddVerticalPaneAction : ObservableObject, IAction + internal sealed partial class AddVerticalPaneAction : ObservableObject, IAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Navigation/ArrangePanesHorizontallyAction.cs b/src/Files.App/Actions/Navigation/ArrangePanesHorizontallyAction.cs index 6665ece58161..6d19d9eade3c 100644 --- a/src/Files.App/Actions/Navigation/ArrangePanesHorizontallyAction.cs +++ b/src/Files.App/Actions/Navigation/ArrangePanesHorizontallyAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ArrangePanesHorizontallyAction : ObservableObject, IToggleAction + internal sealed partial class ArrangePanesHorizontallyAction : ObservableObject, IToggleAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); private readonly IMultiPanesContext MultiPanesContext = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Navigation/ArrangePanesVerticallyAction.cs b/src/Files.App/Actions/Navigation/ArrangePanesVerticallyAction.cs index d7c5142ffb23..f44d53772f98 100644 --- a/src/Files.App/Actions/Navigation/ArrangePanesVerticallyAction.cs +++ b/src/Files.App/Actions/Navigation/ArrangePanesVerticallyAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ArrangePanesVerticallyAction : ObservableObject, IToggleAction + internal sealed partial class ArrangePanesVerticallyAction : ObservableObject, IToggleAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); private readonly IMultiPanesContext MultiPanesContext = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Navigation/CloseActivePaneAction.cs b/src/Files.App/Actions/Navigation/CloseActivePaneAction.cs index fddf55b8e277..844e3a3eaa71 100644 --- a/src/Files.App/Actions/Navigation/CloseActivePaneAction.cs +++ b/src/Files.App/Actions/Navigation/CloseActivePaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseActivePaneAction : ObservableObject, IAction + internal sealed partial class CloseActivePaneAction : ObservableObject, IAction { private IContentPageContext ContentPageContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Navigation/CloseAllTabsAction.cs b/src/Files.App/Actions/Navigation/CloseAllTabsAction.cs index 0a6258bb5b04..49f80dbc6ce5 100644 --- a/src/Files.App/Actions/Navigation/CloseAllTabsAction.cs +++ b/src/Files.App/Actions/Navigation/CloseAllTabsAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseAllTabsAction : CloseTabBaseAction + internal sealed partial class CloseAllTabsAction : CloseTabBaseAction { public override string Label => Strings.CloseAllTabs.GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseOtherTabsCurrentAction.cs b/src/Files.App/Actions/Navigation/CloseOtherTabsCurrentAction.cs index 1134aa6b5a2d..135bf046c91c 100644 --- a/src/Files.App/Actions/Navigation/CloseOtherTabsCurrentAction.cs +++ b/src/Files.App/Actions/Navigation/CloseOtherTabsCurrentAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseOtherTabsCurrentAction : CloseTabBaseAction + internal sealed partial class CloseOtherTabsCurrentAction : CloseTabBaseAction { public override string Label => "CloseOtherTabs".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseOtherTabsSelectedAction.cs b/src/Files.App/Actions/Navigation/CloseOtherTabsSelectedAction.cs index 66b902814e33..148edacb4422 100644 --- a/src/Files.App/Actions/Navigation/CloseOtherTabsSelectedAction.cs +++ b/src/Files.App/Actions/Navigation/CloseOtherTabsSelectedAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseOtherTabsSelectedAction : CloseTabBaseAction + internal sealed partial class CloseOtherTabsSelectedAction : CloseTabBaseAction { public override string Label => "CloseOtherTabs".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseSelectedTabAction.cs b/src/Files.App/Actions/Navigation/CloseSelectedTabAction.cs index 9c93cf0124c5..5cff3c9ff0b7 100644 --- a/src/Files.App/Actions/Navigation/CloseSelectedTabAction.cs +++ b/src/Files.App/Actions/Navigation/CloseSelectedTabAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseSelectedTabAction : CloseTabBaseAction + internal sealed partial class CloseSelectedTabAction : CloseTabBaseAction { public override string Label => "CloseTab".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseTabsToTheLeftCurrentAction.cs b/src/Files.App/Actions/Navigation/CloseTabsToTheLeftCurrentAction.cs index 18528a974802..55feaa766f3f 100644 --- a/src/Files.App/Actions/Navigation/CloseTabsToTheLeftCurrentAction.cs +++ b/src/Files.App/Actions/Navigation/CloseTabsToTheLeftCurrentAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseTabsToTheLeftCurrentAction : CloseTabBaseAction + internal sealed partial class CloseTabsToTheLeftCurrentAction : CloseTabBaseAction { public override string Label => "CloseTabsToTheLeft".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseTabsToTheLeftSelectedAction.cs b/src/Files.App/Actions/Navigation/CloseTabsToTheLeftSelectedAction.cs index 453c1e7aff49..49be5f1d9900 100644 --- a/src/Files.App/Actions/Navigation/CloseTabsToTheLeftSelectedAction.cs +++ b/src/Files.App/Actions/Navigation/CloseTabsToTheLeftSelectedAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseTabsToTheLeftSelectedAction : CloseTabBaseAction + internal sealed partial class CloseTabsToTheLeftSelectedAction : CloseTabBaseAction { public override string Label => "CloseTabsToTheLeft".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseTabsToTheRightCurrentAction.cs b/src/Files.App/Actions/Navigation/CloseTabsToTheRightCurrentAction.cs index b90531e95924..755bf8c6c728 100644 --- a/src/Files.App/Actions/Navigation/CloseTabsToTheRightCurrentAction.cs +++ b/src/Files.App/Actions/Navigation/CloseTabsToTheRightCurrentAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseTabsToTheRightCurrentAction : CloseTabBaseAction + internal sealed partial class CloseTabsToTheRightCurrentAction : CloseTabBaseAction { public override string Label => "CloseTabsToTheRight".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/CloseTabsToTheRightSelectedAction.cs b/src/Files.App/Actions/Navigation/CloseTabsToTheRightSelectedAction.cs index 1ac4684ca157..7cd09ff12144 100644 --- a/src/Files.App/Actions/Navigation/CloseTabsToTheRightSelectedAction.cs +++ b/src/Files.App/Actions/Navigation/CloseTabsToTheRightSelectedAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class CloseTabsToTheRightSelectedAction : CloseTabBaseAction + internal sealed partial class CloseTabsToTheRightSelectedAction : CloseTabBaseAction { public override string Label => "CloseTabsToTheRight".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Navigation/DuplicateSelectedTabAction.cs b/src/Files.App/Actions/Navigation/DuplicateSelectedTabAction.cs index 59046120f68e..7f389e185b2e 100644 --- a/src/Files.App/Actions/Navigation/DuplicateSelectedTabAction.cs +++ b/src/Files.App/Actions/Navigation/DuplicateSelectedTabAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class DuplicateSelectedTabAction : ObservableObject, IAction + internal sealed partial class DuplicateSelectedTabAction : ObservableObject, IAction { private readonly IMultitaskingContext context; diff --git a/src/Files.App/Actions/Navigation/FocusOtherPane.cs b/src/Files.App/Actions/Navigation/FocusOtherPane.cs index 2b5cb1e9d8c9..31d192967576 100644 --- a/src/Files.App/Actions/Navigation/FocusOtherPane.cs +++ b/src/Files.App/Actions/Navigation/FocusOtherPane.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class FocusOtherPaneAction : ObservableObject, IAction + internal sealed partial class FocusOtherPaneAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/NavigateBackAction.cs b/src/Files.App/Actions/Navigation/NavigateBackAction.cs index a7a5ed056e88..86ddc0610499 100644 --- a/src/Files.App/Actions/Navigation/NavigateBackAction.cs +++ b/src/Files.App/Actions/Navigation/NavigateBackAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class NavigateBackAction : ObservableObject, IAction + internal sealed partial class NavigateBackAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/NavigateForwardAction.cs b/src/Files.App/Actions/Navigation/NavigateForwardAction.cs index 52893bd4a4aa..b1b53acd7b92 100644 --- a/src/Files.App/Actions/Navigation/NavigateForwardAction.cs +++ b/src/Files.App/Actions/Navigation/NavigateForwardAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class NavigateForwardAction : ObservableObject, IAction + internal sealed partial class NavigateForwardAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/NavigateHomeAction.cs b/src/Files.App/Actions/Navigation/NavigateHomeAction.cs index e74f41dd8625..5d3a1ad992ec 100644 --- a/src/Files.App/Actions/Navigation/NavigateHomeAction.cs +++ b/src/Files.App/Actions/Navigation/NavigateHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class NavigateHomeAction : ObservableObject, IAction + internal sealed partial class NavigateHomeAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/NavigateUpAction.cs b/src/Files.App/Actions/Navigation/NavigateUpAction.cs index fe1cad0546d5..91c593999c43 100644 --- a/src/Files.App/Actions/Navigation/NavigateUpAction.cs +++ b/src/Files.App/Actions/Navigation/NavigateUpAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class NavigateUpAction : ObservableObject, IAction + internal sealed partial class NavigateUpAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Navigation/NextTabAction.cs b/src/Files.App/Actions/Navigation/NextTabAction.cs index 80f59cdaf86f..f9e43e0df370 100644 --- a/src/Files.App/Actions/Navigation/NextTabAction.cs +++ b/src/Files.App/Actions/Navigation/NextTabAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class NextTabAction : ObservableObject, IAction + internal sealed partial class NextTabAction : ObservableObject, IAction { private readonly IMultitaskingContext multitaskingContext; diff --git a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneAction.cs b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneAction.cs index aad102d0d032..4935f12a3694 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewPaneAction : BaseOpenInNewPaneAction + internal sealed partial class OpenInNewPaneAction : BaseOpenInNewPaneAction { } } diff --git a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromHomeAction.cs b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromHomeAction.cs index 0eb6ea66478e..90123bc1ec46 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromHomeAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewPaneFromHomeAction : BaseOpenInNewPaneAction + internal sealed partial class OpenInNewPaneFromHomeAction : BaseOpenInNewPaneAction { public override bool IsExecutable => HomePageContext.IsAnyItemRightClicked && diff --git a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromSidebarAction.cs b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromSidebarAction.cs index 5ab8db8456ca..a1feb4033803 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromSidebarAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewPane/OpenInNewPaneFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewPaneFromSidebarAction : BaseOpenInNewPaneAction + internal sealed partial class OpenInNewPaneFromSidebarAction : BaseOpenInNewPaneAction { public override bool IsExecutable => SidebarContext.IsItemRightClicked && diff --git a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabAction.cs b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabAction.cs index 531142b2f205..b9e8c086d80f 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewTabAction : BaseOpenInNewTabAction + internal sealed partial class OpenInNewTabAction : BaseOpenInNewTabAction { } } diff --git a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromHomeAction.cs b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromHomeAction.cs index 28bbbb9bca45..c81c353bda27 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromHomeAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewTabFromHomeAction : BaseOpenInNewTabAction + internal sealed partial class OpenInNewTabFromHomeAction : BaseOpenInNewTabAction { public override bool IsExecutable => HomePageContext.IsAnyItemRightClicked && diff --git a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromSidebarAction.cs b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromSidebarAction.cs index 004b7e8e16b8..5c0acfcecdeb 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromSidebarAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewTab/OpenInNewTabFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewTabFromSidebarAction : BaseOpenInNewTabAction + internal sealed partial class OpenInNewTabFromSidebarAction : BaseOpenInNewTabAction { public override bool IsExecutable => SidebarContext.IsItemRightClicked && diff --git a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowAction.cs b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowAction.cs index 07acc8d763f0..9f29a92a2522 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewWindowAction : BaseOpenInNewWindowAction + internal sealed partial class OpenInNewWindowAction : BaseOpenInNewWindowAction { } } diff --git a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromHomeAction.cs b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromHomeAction.cs index 5f3db048c43f..b6cad4d7176b 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromHomeAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewWindowFromHomeAction : BaseOpenInNewWindowAction + internal sealed partial class OpenInNewWindowFromHomeAction : BaseOpenInNewWindowAction { public override HotKey HotKey => HotKey.None; diff --git a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromSidebarAction.cs b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromSidebarAction.cs index ce5058e4481a..4844fbd46296 100644 --- a/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromSidebarAction.cs +++ b/src/Files.App/Actions/Navigation/OpenInNewWindow/OpenInNewWindowFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenInNewWindowFromSidebarAction : BaseOpenInNewWindowAction + internal sealed partial class OpenInNewWindowFromSidebarAction : BaseOpenInNewWindowAction { public override HotKey HotKey => HotKey.None; diff --git a/src/Files.App/Actions/Navigation/PreviousTabAction.cs b/src/Files.App/Actions/Navigation/PreviousTabAction.cs index e53aa5a377fb..198a98157671 100644 --- a/src/Files.App/Actions/Navigation/PreviousTabAction.cs +++ b/src/Files.App/Actions/Navigation/PreviousTabAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal sealed class PreviousTabAction : ObservableObject, IAction + internal sealed partial class PreviousTabAction : ObservableObject, IAction { private readonly IMultitaskingContext multitaskingContext; diff --git a/src/Files.App/Actions/Navigation/ReopenClosedTabAction.cs b/src/Files.App/Actions/Navigation/ReopenClosedTabAction.cs index 953858bea834..855546e5a88e 100644 --- a/src/Files.App/Actions/Navigation/ReopenClosedTabAction.cs +++ b/src/Files.App/Actions/Navigation/ReopenClosedTabAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class ReopenClosedTabAction : ObservableObject, IAction + internal sealed partial class ReopenClosedTabAction : ObservableObject, IAction { private readonly IMultitaskingContext context; diff --git a/src/Files.App/Actions/Open/EditInNotepadAction.cs b/src/Files.App/Actions/Open/EditInNotepadAction.cs index ec10a947a039..cd7d145a3611 100644 --- a/src/Files.App/Actions/Open/EditInNotepadAction.cs +++ b/src/Files.App/Actions/Open/EditInNotepadAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class EditInNotepadAction : ObservableObject, IAction + internal sealed partial class EditInNotepadAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Open/OpenClassicPropertiesAction.cs b/src/Files.App/Actions/Open/OpenClassicPropertiesAction.cs index 90ed266ef09a..868057846cc3 100644 --- a/src/Files.App/Actions/Open/OpenClassicPropertiesAction.cs +++ b/src/Files.App/Actions/Open/OpenClassicPropertiesAction.cs @@ -7,7 +7,7 @@ namespace Files.App.Actions { - internal sealed class OpenClassicPropertiesAction : ObservableObject, IAction + internal sealed partial class OpenClassicPropertiesAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Open/OpenInVSCodeAction.cs b/src/Files.App/Actions/Open/OpenInVSCodeAction.cs index c9a064c8d65b..ffb26efd988d 100644 --- a/src/Files.App/Actions/Open/OpenInVSCodeAction.cs +++ b/src/Files.App/Actions/Open/OpenInVSCodeAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class OpenInVSCodeAction : ObservableObject, IAction + internal sealed partial class OpenInVSCodeAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Open/OpenPropertiesAction.cs b/src/Files.App/Actions/Open/OpenPropertiesAction.cs index 61e5d37cbf73..c5555c26da49 100644 --- a/src/Files.App/Actions/Open/OpenPropertiesAction.cs +++ b/src/Files.App/Actions/Open/OpenPropertiesAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenPropertiesAction : ObservableObject, IAction + internal sealed partial class OpenPropertiesAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Open/OpenReleaseNotesAction.cs b/src/Files.App/Actions/Open/OpenReleaseNotesAction.cs index ceed1808eaae..67b0b890940f 100644 --- a/src/Files.App/Actions/Open/OpenReleaseNotesAction.cs +++ b/src/Files.App/Actions/Open/OpenReleaseNotesAction.cs @@ -1,11 +1,9 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; - namespace Files.App.Actions { - internal sealed class OpenReleaseNotesAction : ObservableObject, IAction + internal sealed partial class OpenReleaseNotesAction : ObservableObject, IAction { private readonly IDialogService DialogService = Ioc.Default.GetRequiredService(); private readonly IUpdateService UpdateService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenRepoInVSCodeAction.cs b/src/Files.App/Actions/Open/OpenRepoInVSCodeAction.cs index 59e26a989197..abe1e14a5399 100644 --- a/src/Files.App/Actions/Open/OpenRepoInVSCodeAction.cs +++ b/src/Files.App/Actions/Open/OpenRepoInVSCodeAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class OpenRepoInVSCodeAction : ObservableObject, IAction + internal sealed partial class OpenRepoInVSCodeAction : ObservableObject, IAction { private readonly IContentPageContext _context; diff --git a/src/Files.App/Actions/Open/OpenSettingsAction.cs b/src/Files.App/Actions/Open/OpenSettingsAction.cs index 07de65eef1b8..262ea3dd462c 100644 --- a/src/Files.App/Actions/Open/OpenSettingsAction.cs +++ b/src/Files.App/Actions/Open/OpenSettingsAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class OpenSettingsAction : BaseUIAction, IAction + internal sealed partial class OpenSettingsAction : BaseUIAction, IAction { private readonly IDialogService dialogService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenStorageSenseAction.cs b/src/Files.App/Actions/Open/OpenStorageSenseAction.cs index 65a955b42afe..76cb0ccba062 100644 --- a/src/Files.App/Actions/Open/OpenStorageSenseAction.cs +++ b/src/Files.App/Actions/Open/OpenStorageSenseAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal class OpenStorageSenseAction : ObservableObject, IAction + internal partial class OpenStorageSenseAction : ObservableObject, IAction { private readonly IContentPageContext context = Ioc.Default.GetRequiredService(); private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenStorageSenseFromHomeAction.cs b/src/Files.App/Actions/Open/OpenStorageSenseFromHomeAction.cs index 8a12d7a12809..c53306aafb26 100644 --- a/src/Files.App/Actions/Open/OpenStorageSenseFromHomeAction.cs +++ b/src/Files.App/Actions/Open/OpenStorageSenseFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenStorageSenseFromHomeAction : OpenStorageSenseAction + internal sealed partial class OpenStorageSenseFromHomeAction : OpenStorageSenseAction { private IHomePageContext HomePageContext { get; } = Ioc.Default.GetRequiredService(); private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenStorageSenseFromSidebarAction.cs b/src/Files.App/Actions/Open/OpenStorageSenseFromSidebarAction.cs index 5326899bce44..4901ab49db72 100644 --- a/src/Files.App/Actions/Open/OpenStorageSenseFromSidebarAction.cs +++ b/src/Files.App/Actions/Open/OpenStorageSenseFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenStorageSenseFromSidebarAction : OpenStorageSenseAction + internal sealed partial class OpenStorageSenseFromSidebarAction : OpenStorageSenseAction { private ISidebarContext SidebarContext { get; } = Ioc.Default.GetRequiredService(); private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenTerminalAction.cs b/src/Files.App/Actions/Open/OpenTerminalAction.cs index 286d5667581f..2a60f9375081 100644 --- a/src/Files.App/Actions/Open/OpenTerminalAction.cs +++ b/src/Files.App/Actions/Open/OpenTerminalAction.cs @@ -6,7 +6,7 @@ namespace Files.App.Actions { - internal class OpenTerminalAction : ObservableObject, IAction + internal partial class OpenTerminalAction : ObservableObject, IAction { private readonly IContentPageContext context; diff --git a/src/Files.App/Actions/Open/OpenTerminalAsAdminAction.cs b/src/Files.App/Actions/Open/OpenTerminalAsAdminAction.cs index ae4b79a61cc7..c1deb9acd848 100644 --- a/src/Files.App/Actions/Open/OpenTerminalAsAdminAction.cs +++ b/src/Files.App/Actions/Open/OpenTerminalAsAdminAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenTerminalAsAdminAction : OpenTerminalAction + internal sealed partial class OpenTerminalAsAdminAction : OpenTerminalAction { public override string Label => "OpenTerminalAsAdmin".GetLocalizedResource(); diff --git a/src/Files.App/Actions/Open/OpenTerminalFromHomeAction.cs b/src/Files.App/Actions/Open/OpenTerminalFromHomeAction.cs index db68f27fde6b..dc5776bb22ef 100644 --- a/src/Files.App/Actions/Open/OpenTerminalFromHomeAction.cs +++ b/src/Files.App/Actions/Open/OpenTerminalFromHomeAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenTerminalFromHomeAction : OpenTerminalAction + internal sealed partial class OpenTerminalFromHomeAction : OpenTerminalAction { private IHomePageContext HomePageContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Open/OpenTerminalFromSidebarAction.cs b/src/Files.App/Actions/Open/OpenTerminalFromSidebarAction.cs index 224ad45f94e6..2c439c4379a7 100644 --- a/src/Files.App/Actions/Open/OpenTerminalFromSidebarAction.cs +++ b/src/Files.App/Actions/Open/OpenTerminalFromSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class OpenTerminalFromSidebarAction : OpenTerminalAction + internal sealed partial class OpenTerminalFromSidebarAction : OpenTerminalAction { private ISidebarContext SidebarContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Show/ToggleDetailsPaneAction.cs b/src/Files.App/Actions/Show/ToggleDetailsPaneAction.cs index 883d12db57df..cd292c1a4b26 100644 --- a/src/Files.App/Actions/Show/ToggleDetailsPaneAction.cs +++ b/src/Files.App/Actions/Show/ToggleDetailsPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleDetailsPaneAction : ObservableObject, IAction + internal sealed partial class ToggleDetailsPaneAction : ObservableObject, IAction { private readonly InfoPaneViewModel infoPaneViewModel = Ioc.Default.GetRequiredService(); private readonly IInfoPaneSettingsService infoPaneSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Show/ToggleDotFilesSettingAction.cs b/src/Files.App/Actions/Show/ToggleDotFilesSettingAction.cs index a62f7290e9dd..9811a60a1504 100644 --- a/src/Files.App/Actions/Show/ToggleDotFilesSettingAction.cs +++ b/src/Files.App/Actions/Show/ToggleDotFilesSettingAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleDotFilesSettingAction : ObservableObject, IToggleAction + internal sealed partial class ToggleDotFilesSettingAction : ObservableObject, IToggleAction { private readonly IFoldersSettingsService FoldersSettingsService; diff --git a/src/Files.App/Actions/Show/ToggleInfoPaneAction.cs b/src/Files.App/Actions/Show/ToggleInfoPaneAction.cs index 3b317352a6a1..c32bc249901d 100644 --- a/src/Files.App/Actions/Show/ToggleInfoPaneAction.cs +++ b/src/Files.App/Actions/Show/ToggleInfoPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleInfoPaneAction : ObservableObject, IToggleAction + internal sealed partial class ToggleInfoPaneAction : ObservableObject, IToggleAction { private readonly InfoPaneViewModel viewModel; diff --git a/src/Files.App/Actions/Show/TogglePreviewPaneAction.cs b/src/Files.App/Actions/Show/TogglePreviewPaneAction.cs index 4dab997565da..19feb74c862a 100644 --- a/src/Files.App/Actions/Show/TogglePreviewPaneAction.cs +++ b/src/Files.App/Actions/Show/TogglePreviewPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class TogglePreviewPaneAction : ObservableObject, IAction + internal sealed partial class TogglePreviewPaneAction : ObservableObject, IAction { private readonly InfoPaneViewModel infoPaneViewModel = Ioc.Default.GetRequiredService(); private readonly IInfoPaneSettingsService infoPaneSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Show/ToggleShelfPaneAction.cs b/src/Files.App/Actions/Show/ToggleShelfPaneAction.cs index 6d8c8d3ba808..43ff818fa7fa 100644 --- a/src/Files.App/Actions/Show/ToggleShelfPaneAction.cs +++ b/src/Files.App/Actions/Show/ToggleShelfPaneAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleShelfPaneAction : ObservableObject, IToggleAction + internal sealed partial class ToggleShelfPaneAction : ObservableObject, IToggleAction { private readonly IGeneralSettingsService generalSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Show/ToggleShowFileExtensionsAction.cs b/src/Files.App/Actions/Show/ToggleShowFileExtensionsAction.cs index 02e9cf714369..62da66b2b434 100644 --- a/src/Files.App/Actions/Show/ToggleShowFileExtensionsAction.cs +++ b/src/Files.App/Actions/Show/ToggleShowFileExtensionsAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleShowFileExtensionsAction : ObservableObject, IToggleAction + internal sealed partial class ToggleShowFileExtensionsAction : ObservableObject, IToggleAction { private readonly IFoldersSettingsService settings; diff --git a/src/Files.App/Actions/Show/ToggleShowHiddenItemsAction.cs b/src/Files.App/Actions/Show/ToggleShowHiddenItemsAction.cs index 70740675e95f..0a7b05a7264d 100644 --- a/src/Files.App/Actions/Show/ToggleShowHiddenItemsAction.cs +++ b/src/Files.App/Actions/Show/ToggleShowHiddenItemsAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleShowHiddenItemsAction : ObservableObject, IToggleAction + internal sealed partial class ToggleShowHiddenItemsAction : ObservableObject, IToggleAction { private readonly IFoldersSettingsService settings; diff --git a/src/Files.App/Actions/Show/ToggleToolbarAction.cs b/src/Files.App/Actions/Show/ToggleToolbarAction.cs index 8aab352215e6..aff01980e745 100644 --- a/src/Files.App/Actions/Show/ToggleToolbarAction.cs +++ b/src/Files.App/Actions/Show/ToggleToolbarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class ToggleToolbarAction : ObservableObject, IToggleAction + internal sealed partial class ToggleToolbarAction : ObservableObject, IToggleAction { private IAppearanceSettingsService AppearanceSettingsService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Actions/Sidebar/PinFolderToSidebarAction.cs b/src/Files.App/Actions/Sidebar/PinFolderToSidebarAction.cs index 660025f54aa9..1194407a93a3 100644 --- a/src/Files.App/Actions/Sidebar/PinFolderToSidebarAction.cs +++ b/src/Files.App/Actions/Sidebar/PinFolderToSidebarAction.cs @@ -5,7 +5,7 @@ namespace Files.App.Actions { - internal sealed class PinFolderToSidebarAction : ObservableObject, IAction + internal sealed partial class PinFolderToSidebarAction : ObservableObject, IAction { private readonly IContentPageContext context; private readonly IQuickAccessService service; diff --git a/src/Files.App/Actions/Sidebar/UnpinFolderToSidebarAction.cs b/src/Files.App/Actions/Sidebar/UnpinFolderToSidebarAction.cs index a962eb6f2f58..d282e570b383 100644 --- a/src/Files.App/Actions/Sidebar/UnpinFolderToSidebarAction.cs +++ b/src/Files.App/Actions/Sidebar/UnpinFolderToSidebarAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal sealed class UnpinFolderFromSidebarAction : ObservableObject, IAction + internal sealed partial class UnpinFolderFromSidebarAction : ObservableObject, IAction { private readonly IContentPageContext context; private readonly IQuickAccessService service; diff --git a/src/Files.App/App.xaml.cs b/src/Files.App/App.xaml.cs index d5a535f9300f..a7b67a98829f 100644 --- a/src/Files.App/App.xaml.cs +++ b/src/Files.App/App.xaml.cs @@ -1,7 +1,6 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; using Files.App.Helpers.Application; using Microsoft.Extensions.Logging; using Microsoft.UI.Xaml; @@ -81,10 +80,6 @@ async Task ActivateAsync() MainWindow.Instance.ShowSplashScreen(); } - // Start tracking app usage - if (appActivationArguments.Data is Windows.ApplicationModel.Activation.IActivatedEventArgs activationEventArgs) - SystemInformation.Instance.TrackAppUse(activationEventArgs); - // Configure the DI (dependency injection) container var host = AppLifecycleHelper.ConfigureHost(); Ioc.Default.ConfigureServices(host.Services); diff --git a/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe b/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe deleted file mode 100644 index e5765b6216f8..000000000000 Binary files a/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe and /dev/null differ diff --git a/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe.sha256 b/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe.sha256 index ade8fe992695..3b4d7012842d 100644 --- a/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe.sha256 +++ b/src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe.sha256 @@ -1 +1 @@ -cc957911eb0abac03d457a70f1c6ff03eeabd0d05548806ff801998d7218b48d +83f9dfee3c40c31ab2319cc0cf94c0f754aadf483ffe4aa6de16b1413ddb83c8 diff --git a/src/Files.App/Assets/Libraries/Microsoft.UI.winmd b/src/Files.App/Assets/Libraries/Microsoft.UI.winmd index 82e094e3e8c4..ce9ff6630baa 100644 Binary files a/src/Files.App/Assets/Libraries/Microsoft.UI.winmd and b/src/Files.App/Assets/Libraries/Microsoft.UI.winmd differ diff --git a/src/Files.App/Constants.cs b/src/Files.App/Constants.cs index 2465c6f6de23..b92eb22f08a0 100644 --- a/src/Files.App/Constants.cs +++ b/src/Files.App/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; +using Windows.ApplicationModel; namespace Files.App { @@ -207,7 +207,7 @@ public static class ExternalUrl public const string PrivacyPolicyUrl = @"https://files.community/privacy"; public const string SupportUsUrl = @"https://github.com/sponsors/yaira2"; public const string CrowdinUrl = @"https://crowdin.com/project/files-app"; - public static readonly string ReleaseNotesUrl= $"https://files.community/blog/posts/v{SystemInformation.Instance.ApplicationVersion.Major}-{SystemInformation.Instance.ApplicationVersion.Minor}-{SystemInformation.Instance.ApplicationVersion.Build}?minimal"; + public static readonly string ReleaseNotesUrl= $"https://files.community/blog/posts/v{Package.Current.Id.Version.Major}-{Package.Current.Id.Version.Minor}-{Package.Current.Id.Version.Build}?minimal"; } public static class DocsPath diff --git a/src/Files.App/Converters/BoolToSelectionModeConverter.cs b/src/Files.App/Converters/BoolToSelectionModeConverter.cs index 8c43c79ac8ce..1eaa8e2bacb8 100644 --- a/src/Files.App/Converters/BoolToSelectionModeConverter.cs +++ b/src/Files.App/Converters/BoolToSelectionModeConverter.cs @@ -6,7 +6,7 @@ namespace Files.App.Converters { - internal sealed class BoolToSelectionModeConverter : IValueConverter + internal sealed partial class BoolToSelectionModeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/ConflictResolveOptionToIndexConverter.cs b/src/Files.App/Converters/ConflictResolveOptionToIndexConverter.cs index 8b01105bba98..74f41dfa338d 100644 --- a/src/Files.App/Converters/ConflictResolveOptionToIndexConverter.cs +++ b/src/Files.App/Converters/ConflictResolveOptionToIndexConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class ConflictResolveOptionToIndexConverter : IValueConverter + internal sealed partial class ConflictResolveOptionToIndexConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/Converters.cs b/src/Files.App/Converters/Converters.cs index 9b9c4f8eb10e..fa33750df405 100644 --- a/src/Files.App/Converters/Converters.cs +++ b/src/Files.App/Converters/Converters.cs @@ -119,7 +119,7 @@ internal abstract class ToObjectConverter : ValueConverter /// /// Converts a boolean to and from a visibility value. /// - internal sealed class InverseBooleanConverter : ValueConverter + internal sealed partial class InverseBooleanConverter : ValueConverter { /// /// Converts a source value to the target type. @@ -146,7 +146,7 @@ protected override bool ConvertBack(bool value, object? parameter, string? langu } } - internal sealed class NullToTrueConverter : ValueConverter + internal sealed partial class NullToTrueConverter : ValueConverter { /// /// Determines whether an inverse conversion should take place. @@ -179,7 +179,7 @@ protected override bool Convert(object? value, object? parameter, string? langua } } - internal sealed class StringNullOrWhiteSpaceToTrueConverter : ValueConverter + internal sealed partial class StringNullOrWhiteSpaceToTrueConverter : ValueConverter { /// /// Determines whether an inverse conversion should take place. @@ -212,7 +212,7 @@ protected override string ConvertBack(bool value, object? parameter, string? lan } } - internal sealed class NullToVisibilityCollapsedConverter : ValueConverter + internal sealed partial class NullToVisibilityCollapsedConverter : ValueConverter { /// /// Converts a source value to the target type. diff --git a/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs b/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs index 939f6407d6e3..f919197467e0 100644 --- a/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs +++ b/src/Files.App/Converters/DateTimeOffsetToStringConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class DateTimeOffsetToStringConverter : IValueConverter + internal sealed partial class DateTimeOffsetToStringConverter : IValueConverter { private static readonly IDateTimeFormatter formatter = Ioc.Default.GetService(); diff --git a/src/Files.App/Converters/DoubleArrayToStringConverter.cs b/src/Files.App/Converters/DoubleArrayToStringConverter.cs index 66d5b713d70f..8c9f377c9528 100644 --- a/src/Files.App/Converters/DoubleArrayToStringConverter.cs +++ b/src/Files.App/Converters/DoubleArrayToStringConverter.cs @@ -6,7 +6,7 @@ namespace Files.App.Converters { - internal sealed class DoubleArrayToStringConverter : IValueConverter + internal sealed partial class DoubleArrayToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/DoubleToStringConverter.cs b/src/Files.App/Converters/DoubleToStringConverter.cs index 88e1639d9ab7..da2646ede853 100644 --- a/src/Files.App/Converters/DoubleToStringConverter.cs +++ b/src/Files.App/Converters/DoubleToStringConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class DoubleToStringConverter : IValueConverter + internal sealed partial class DoubleToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/EnumToBoolConverter.cs b/src/Files.App/Converters/EnumToBoolConverter.cs index 3ec08d63c141..db3e73b2f91c 100644 --- a/src/Files.App/Converters/EnumToBoolConverter.cs +++ b/src/Files.App/Converters/EnumToBoolConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class EnumToBoolConverter : IValueConverter + internal sealed partial class EnumToBoolConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/EnumToHumanizedConverter.cs b/src/Files.App/Converters/EnumToHumanizedConverter.cs index 3cbcd6d26c40..c66038e8369b 100644 --- a/src/Files.App/Converters/EnumToHumanizedConverter.cs +++ b/src/Files.App/Converters/EnumToHumanizedConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class EnumToHumanizedConverter : IValueConverter + internal sealed partial class EnumToHumanizedConverter : IValueConverter { public string EnumTypeName { get; set; } = string.Empty; diff --git a/src/Files.App/Converters/EnumToStringConverter.cs b/src/Files.App/Converters/EnumToStringConverter.cs index 07ca5042de3e..fe61c41ea5ee 100644 --- a/src/Files.App/Converters/EnumToStringConverter.cs +++ b/src/Files.App/Converters/EnumToStringConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class EnumToStringConverter : IValueConverter + internal sealed partial class EnumToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/GenericEnumConverter.cs b/src/Files.App/Converters/GenericEnumConverter.cs index 1660b760bde9..a704326bbe7a 100644 --- a/src/Files.App/Converters/GenericEnumConverter.cs +++ b/src/Files.App/Converters/GenericEnumConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class GenericEnumConverter : IValueConverter + internal sealed partial class GenericEnumConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/ImageModelToImageConverter.cs b/src/Files.App/Converters/ImageModelToImageConverter.cs index 767ef0b4eac4..52763c680f2d 100644 --- a/src/Files.App/Converters/ImageModelToImageConverter.cs +++ b/src/Files.App/Converters/ImageModelToImageConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class ImageModelToImageConverter : IValueConverter + internal sealed partial class ImageModelToImageConverter : IValueConverter { public object? Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/StatusCenterStateToBrushConverter.cs b/src/Files.App/Converters/StatusCenterStateToBrushConverter.cs index f8245c06ec55..8b8a53606563 100644 --- a/src/Files.App/Converters/StatusCenterStateToBrushConverter.cs +++ b/src/Files.App/Converters/StatusCenterStateToBrushConverter.cs @@ -7,7 +7,7 @@ namespace Files.App.Converters { - public sealed class StatusCenterStateToBrushConverter : DependencyObject, IValueConverter + public sealed partial class StatusCenterStateToBrushConverter : DependencyObject, IValueConverter { public static readonly DependencyProperty InProgressBackgroundBrushProperty = DependencyProperty.Register(nameof(InProgressBackgroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); diff --git a/src/Files.App/Converters/StatusCenterStateToStateIconConverter.cs b/src/Files.App/Converters/StatusCenterStateToStateIconConverter.cs index 5afd11eb45d9..6b90b0934bff 100644 --- a/src/Files.App/Converters/StatusCenterStateToStateIconConverter.cs +++ b/src/Files.App/Converters/StatusCenterStateToStateIconConverter.cs @@ -9,7 +9,7 @@ namespace Files.App.Converters { - class StatusCenterStateToStateIconConverter : IValueConverter + partial class StatusCenterStateToStateIconConverter : IValueConverter { public object? Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/StorageDeleteOptionToBooleanConverter.cs b/src/Files.App/Converters/StorageDeleteOptionToBooleanConverter.cs index 4c062e63dd33..5fb6f1f429f8 100644 --- a/src/Files.App/Converters/StorageDeleteOptionToBooleanConverter.cs +++ b/src/Files.App/Converters/StorageDeleteOptionToBooleanConverter.cs @@ -6,7 +6,7 @@ namespace Files.App.Converters { - internal sealed class StorageDeleteOptionToBooleanConverter : IValueConverter + internal sealed partial class StorageDeleteOptionToBooleanConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/StringArrayToStringConverter.cs b/src/Files.App/Converters/StringArrayToStringConverter.cs index 233c6f31482e..f1abe47443c4 100644 --- a/src/Files.App/Converters/StringArrayToStringConverter.cs +++ b/src/Files.App/Converters/StringArrayToStringConverter.cs @@ -6,7 +6,7 @@ namespace Files.App.Converters { - internal sealed class StringArrayToStringConverter : IValueConverter + internal sealed partial class StringArrayToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/StringToBrushConverter.cs b/src/Files.App/Converters/StringToBrushConverter.cs index 1348ddeaf08e..b7b647492631 100644 --- a/src/Files.App/Converters/StringToBrushConverter.cs +++ b/src/Files.App/Converters/StringToBrushConverter.cs @@ -8,7 +8,7 @@ namespace Files.App.Converters { - internal sealed class StringToBrushConverter : IValueConverter + internal sealed partial class StringToBrushConverter : IValueConverter { public object? Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/UInt32ToStringConverter.cs b/src/Files.App/Converters/UInt32ToStringConverter.cs index 8b106cfe7e05..51d5e3f723b4 100644 --- a/src/Files.App/Converters/UInt32ToStringConverter.cs +++ b/src/Files.App/Converters/UInt32ToStringConverter.cs @@ -5,7 +5,7 @@ namespace Files.App.Converters { - internal sealed class UInt32ToStringConverter : IValueConverter + internal sealed partial class UInt32ToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Converters/VisibilityInvertConverter.cs b/src/Files.App/Converters/VisibilityInvertConverter.cs index 5ad3e96ba356..62bab14ea8cf 100644 --- a/src/Files.App/Converters/VisibilityInvertConverter.cs +++ b/src/Files.App/Converters/VisibilityInvertConverter.cs @@ -6,7 +6,7 @@ namespace Files.App.Converters { - internal sealed class VisibilityInvertConverter : IValueConverter + internal sealed partial class VisibilityInvertConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/src/Files.App/Data/AppModels/SingleFileDatabaseModel.cs b/src/Files.App/Data/AppModels/SingleFileDatabaseModel.cs index eff6c179e827..162d14a84083 100644 --- a/src/Files.App/Data/AppModels/SingleFileDatabaseModel.cs +++ b/src/Files.App/Data/AppModels/SingleFileDatabaseModel.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.AppModels { /// - public sealed class SingleFileDatabaseModel : BaseDatabaseModel + public sealed partial class SingleFileDatabaseModel : BaseDatabaseModel { private readonly string _fileName; private readonly IModifiableFolder _settingsFolder; diff --git a/src/Files.App/Data/Behaviors/StickyHeaderBehavior.cs b/src/Files.App/Data/Behaviors/StickyHeaderBehavior.cs index 1f28a2b854cc..29fafb438288 100644 --- a/src/Files.App/Data/Behaviors/StickyHeaderBehavior.cs +++ b/src/Files.App/Data/Behaviors/StickyHeaderBehavior.cs @@ -1,9 +1,9 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; -using CommunityToolkit.WinUI.UI.Animations.Expressions; -using CommunityToolkit.WinUI.UI.Behaviors; +using CommunityToolkit.WinUI; +using CommunityToolkit.WinUI.Animations.Expressions; +using CommunityToolkit.WinUI.Behaviors; using Microsoft.UI.Composition; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/Data/Commands/ActionCommand.cs b/src/Files.App/Data/Commands/ActionCommand.cs index 24314109dd53..d3a413ce2721 100644 --- a/src/Files.App/Data/Commands/ActionCommand.cs +++ b/src/Files.App/Data/Commands/ActionCommand.cs @@ -10,7 +10,7 @@ namespace Files.App.Data.Commands { [DebuggerDisplay("Command {Code}")] - internal sealed class ActionCommand : ObservableObject, IRichCommand + internal sealed partial class ActionCommand : ObservableObject, IRichCommand { private IActionsSettingsService ActionsSettingsService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index ba0b307b0b76..f0e656b11943 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.Commands { - internal sealed class CommandManager : ICommandManager + internal sealed partial class CommandManager : ICommandManager { // Dependency injections diff --git a/src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs b/src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs index a82a7b6e002f..404ce87a9a5c 100644 --- a/src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Commands { - internal sealed class ModifiableCommandManager : IModifiableCommandManager + internal sealed partial class ModifiableCommandManager : IModifiableCommandManager { private static readonly ICommandManager Commands = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Commands/ModifiableCommand.cs b/src/Files.App/Data/Commands/ModifiableCommand.cs index 16ce4f0d301e..7b468d96ea62 100644 --- a/src/Files.App/Data/Commands/ModifiableCommand.cs +++ b/src/Files.App/Data/Commands/ModifiableCommand.cs @@ -10,7 +10,7 @@ namespace Files.App.Data.Commands { [DebuggerDisplay("Command {Code} (Modifiable)")] - internal sealed class ModifiableCommand : ObservableObject, IRichCommand + internal sealed partial class ModifiableCommand : ObservableObject, IRichCommand { public event EventHandler? CanExecuteChanged; diff --git a/src/Files.App/Data/Commands/NoneCommand.cs b/src/Files.App/Data/Commands/NoneCommand.cs index d7c43e24c751..8163fb28d72d 100644 --- a/src/Files.App/Data/Commands/NoneCommand.cs +++ b/src/Files.App/Data/Commands/NoneCommand.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.Commands { [DebuggerDisplay("Command None")] - internal sealed class NoneCommand : IRichCommand + internal sealed partial class NoneCommand : IRichCommand { public event EventHandler? CanExecuteChanged { add { } remove { } } public event PropertyChangingEventHandler? PropertyChanging { add { } remove { } } diff --git a/src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs b/src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs index ab27b91595c0..dd0a64d05cce 100644 --- a/src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs +++ b/src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Contexts { - internal sealed class ContentPageContext : ObservableObject, IContentPageContext + internal sealed partial class ContentPageContext : ObservableObject, IContentPageContext { private static readonly IReadOnlyList emptyItems = Enumerable.Empty().ToImmutableList(); diff --git a/src/Files.App/Data/Contexts/DisplayPage/DisplayPageContext.cs b/src/Files.App/Data/Contexts/DisplayPage/DisplayPageContext.cs index 1cb483a2c7ea..36810ae274fd 100644 --- a/src/Files.App/Data/Contexts/DisplayPage/DisplayPageContext.cs +++ b/src/Files.App/Data/Contexts/DisplayPage/DisplayPageContext.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Contexts { - internal sealed class DisplayPageContext : ObservableObject, IDisplayPageContext + internal sealed partial class DisplayPageContext : ObservableObject, IDisplayPageContext { private readonly IMultiPanesContext context = Ioc.Default.GetRequiredService(); private readonly IFoldersSettingsService settings = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Contexts/HomePage/HomePageContext.cs b/src/Files.App/Data/Contexts/HomePage/HomePageContext.cs index 67169eae2d43..66264479a439 100644 --- a/src/Files.App/Data/Contexts/HomePage/HomePageContext.cs +++ b/src/Files.App/Data/Contexts/HomePage/HomePageContext.cs @@ -7,7 +7,7 @@ namespace Files.App.Data.Contexts { - public sealed class HomePageContext : ObservableObject, IHomePageContext + public sealed partial class HomePageContext : ObservableObject, IHomePageContext { private static readonly ImmutableList emptyTaggedItems = Enumerable.Empty().ToImmutableList(); diff --git a/src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs b/src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs index 0efde88276b5..e1ae0e50760e 100644 --- a/src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs +++ b/src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs @@ -7,7 +7,7 @@ namespace Files.App.Data.Contexts { - internal sealed class MultitaskingContext : ObservableObject, IMultitaskingContext + internal sealed partial class MultitaskingContext : ObservableObject, IMultitaskingContext { private bool isPopupOpen = false; diff --git a/src/Files.App/Data/Contexts/SideBar/SideBarContext.cs b/src/Files.App/Data/Contexts/SideBar/SideBarContext.cs index 4a1ac902c2c9..142771ba7155 100644 --- a/src/Files.App/Data/Contexts/SideBar/SideBarContext.cs +++ b/src/Files.App/Data/Contexts/SideBar/SideBarContext.cs @@ -4,7 +4,7 @@ namespace Files.App.Data.Contexts { /// - internal sealed class SidebarContext : ObservableObject, ISidebarContext + internal sealed partial class SidebarContext : ObservableObject, ISidebarContext { private readonly PinnedFoldersManager favoriteModel = App.QuickAccessManager.Model; diff --git a/src/Files.App/Data/Contexts/Tags/TagsContext.cs b/src/Files.App/Data/Contexts/Tags/TagsContext.cs index 9a01046fa20e..729e9f11a364 100644 --- a/src/Files.App/Data/Contexts/Tags/TagsContext.cs +++ b/src/Files.App/Data/Contexts/Tags/TagsContext.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Contexts { - sealed class TagsContext : ITagsContext + sealed partial class TagsContext : ITagsContext { private static readonly IReadOnlyList<(string path, bool isFolder)> _emptyTaggedItemsList = Enumerable.Empty<(string path, bool isFolder)>().ToImmutableList(); diff --git a/src/Files.App/Data/Contexts/Window/WindowContext.cs b/src/Files.App/Data/Contexts/Window/WindowContext.cs index 90088113803e..c99560efd16f 100644 --- a/src/Files.App/Data/Contexts/Window/WindowContext.cs +++ b/src/Files.App/Data/Contexts/Window/WindowContext.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Contexts { /// - internal sealed class WindowContext : ObservableObject, IWindowContext + internal sealed partial class WindowContext : ObservableObject, IWindowContext { private IWindowsSecurityService WindowsSecurityService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Contracts/IResourcesService.cs b/src/Files.App/Data/Contracts/IResourcesService.cs index 305b706d386a..aa8874ec7198 100644 --- a/src/Files.App/Data/Contracts/IResourcesService.cs +++ b/src/Files.App/Data/Contracts/IResourcesService.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using System.Drawing; +using Windows.UI; namespace Files.App.Data.Contracts { diff --git a/src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs b/src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs index e9cb0ce66f44..e97b64c744b8 100644 --- a/src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs +++ b/src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Files.App.Helpers.ContextFlyouts; using Files.Shared.Helpers; using Microsoft.UI.Input; diff --git a/src/Files.App/Data/Items/AccessControlEntry.cs b/src/Files.App/Data/Items/AccessControlEntry.cs index 47df2d735379..4b23f437b7a3 100644 --- a/src/Files.App/Data/Items/AccessControlEntry.cs +++ b/src/Files.App/Data/Items/AccessControlEntry.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Items /// /// Represents an access control entry (ACE). /// - public sealed class AccessControlEntry : ObservableObject + public sealed partial class AccessControlEntry : ObservableObject { /// /// Whether the path indicates folder or not diff --git a/src/Files.App/Data/Items/AccessControlList.cs b/src/Files.App/Data/Items/AccessControlList.cs index ba1149015c97..c409c8b471fa 100644 --- a/src/Files.App/Data/Items/AccessControlList.cs +++ b/src/Files.App/Data/Items/AccessControlList.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Items /// /// Represents an access control list (ACL). /// - public sealed class AccessControlList : ObservableObject + public sealed partial class AccessControlList : ObservableObject { /// /// Object path. diff --git a/src/Files.App/Data/Items/AccessControlPrincipal.cs b/src/Files.App/Data/Items/AccessControlPrincipal.cs index 6b695a3bb27a..bb6757957bcc 100644 --- a/src/Files.App/Data/Items/AccessControlPrincipal.cs +++ b/src/Files.App/Data/Items/AccessControlPrincipal.cs @@ -10,7 +10,7 @@ namespace Files.App.Data.Items /// /// Represents a principal of an ACE or an owner of an ACL. /// - public sealed class AccessControlPrincipal : ObservableObject + public sealed partial class AccessControlPrincipal : ObservableObject { /// /// Account type. @@ -66,34 +66,27 @@ public string? FullNameHumanized public string FullNameHumanizedWithBrackes => string.IsNullOrEmpty(Domain) ? string.Empty : $"({Domain}\\{Name})"; - public unsafe AccessControlPrincipal(string sid) + public AccessControlPrincipal(string sid) { if (string.IsNullOrEmpty(sid)) return; Sid = sid; - PSID lpSid = default; - SID_NAME_USE snu = default; + PInvoke.ConvertStringSidToSid(sid, out var lpSid); - fixed (char* cSid = sid) - PInvoke.ConvertStringSidToSid(new PCWSTR(cSid), &lpSid); - - PWSTR lpName = default; - PWSTR lpDomain = default; + char[] lpName = []; + char[] lpDomain = []; uint cchName = 0, cchDomainName = 0; // Get size of account name and domain name - bool bResult = PInvoke.LookupAccountSid(new PCWSTR(), lpSid, lpName, &cchName, lpDomain, &cchDomainName, null); + bool bResult = PInvoke.LookupAccountSid(string.Empty, lpSid, lpName, ref cchName, lpDomain, ref cchDomainName, out _); // Ensure requested capacity - fixed (char* cName = new char[cchName]) - lpName = new(cName); - - fixed (char* cDomain = new char[cchDomainName]) - lpDomain = new(cDomain); + lpName = new char[cchName]; + lpDomain = new char[cchDomainName]; // Get account name and domain - bResult = PInvoke.LookupAccountSid(new PCWSTR(), lpSid, lpName, &cchName, lpDomain, &cchDomainName, &snu); + bResult = PInvoke.LookupAccountSid(string.Empty, lpSid, lpName, ref cchName, lpDomain, ref cchDomainName, out var snu); if(!bResult) return; @@ -118,16 +111,14 @@ var x when if (snu == SID_NAME_USE.SidTypeUser || snu == SID_NAME_USE.SidTypeAlias) { uint size = 256; - fixed (char* cDomain = new char[size]) - lpDomain = new(cDomain); - + lpDomain = new char[size]; bResult = PInvoke.GetComputerName(lpDomain, ref size); if (!bResult) return; } - Name = lpName.ToString(); - Domain = lpDomain.ToString().ToLower(); + Name = lpName.AsSpan().ToString(); + Domain = lpDomain.AsSpan().ToString().ToLower(); IsValid = true; } diff --git a/src/Files.App/Data/Items/AccessMaskItem.cs b/src/Files.App/Data/Items/AccessMaskItem.cs index 71e3dcf0a8dc..8f5e1853cda6 100644 --- a/src/Files.App/Data/Items/AccessMaskItem.cs +++ b/src/Files.App/Data/Items/AccessMaskItem.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Items /// /// Represents an access mask details, such as its name and changeability. /// - public sealed class AccessMaskItem : ObservableObject + public sealed partial class AccessMaskItem : ObservableObject { public string AccessMaskName { get; set; } diff --git a/src/Files.App/Data/Items/DetailsLayoutColumnItem.cs b/src/Files.App/Data/Items/DetailsLayoutColumnItem.cs index 8bf28c3c01a6..5fa0971b91a4 100644 --- a/src/Files.App/Data/Items/DetailsLayoutColumnItem.cs +++ b/src/Files.App/Data/Items/DetailsLayoutColumnItem.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.Items /// /// Represents item for a column shown in . /// - public sealed class DetailsLayoutColumnItem : ObservableObject + public sealed partial class DetailsLayoutColumnItem : ObservableObject { private const int GRID_SPLITTER_WIDTH = 12; diff --git a/src/Files.App/Data/Items/DriveItem.cs b/src/Files.App/Data/Items/DriveItem.cs index 6c72c3769c41..d6484b3a3e8f 100644 --- a/src/Files.App/Data/Items/DriveItem.cs +++ b/src/Files.App/Data/Items/DriveItem.cs @@ -11,7 +11,7 @@ namespace Files.App.Data.Items { - public sealed class DriveItem : ObservableObject, INavigationControlItem, ILocatableFolder + public sealed partial class DriveItem : ObservableObject, INavigationControlItem, ILocatableFolder { private BitmapImage icon; public BitmapImage Icon diff --git a/src/Files.App/Data/Items/FileTagItem.cs b/src/Files.App/Data/Items/FileTagItem.cs index f81728ceda3e..e96360583815 100644 --- a/src/Files.App/Data/Items/FileTagItem.cs +++ b/src/Files.App/Data/Items/FileTagItem.cs @@ -9,7 +9,7 @@ namespace Files.App.Data.Items { - public sealed class FileTagItem : ObservableObject, INavigationControlItem + public sealed partial class FileTagItem : ObservableObject, INavigationControlItem { public string Text { get; set; } diff --git a/src/Files.App/Data/Items/ListedItem.cs b/src/Files.App/Data/Items/ListedItem.cs index 5519d4bd7158..16fc8b137fd3 100644 --- a/src/Files.App/Data/Items/ListedItem.cs +++ b/src/Files.App/Data/Items/ListedItem.cs @@ -16,7 +16,7 @@ namespace Files.App.Utils { - public class ListedItem : ObservableObject, IGroupableItem + public partial class ListedItem : ObservableObject, IGroupableItem { protected static IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); @@ -462,7 +462,7 @@ public void UpdateContainsFilesFolders() } } - public sealed class RecycleBinItem : ListedItem + public sealed partial class RecycleBinItem : ListedItem { public RecycleBinItem(string folderRelativeId) : base(folderRelativeId) { @@ -491,7 +491,7 @@ public DateTimeOffset ItemDateDeletedReal public string ItemOriginalFolderName => Path.GetFileName(ItemOriginalFolder); } - public sealed class FtpItem : ListedItem + public sealed partial class FtpItem : ListedItem { public FtpItem(FtpListItem item, string folder) : base(null) { @@ -527,7 +527,7 @@ public FtpItem(FtpListItem item, string folder) : base(null) }; } - public sealed class ShortcutItem : ListedItem, IShortcutItem + public sealed partial class ShortcutItem : ListedItem, IShortcutItem { public ShortcutItem(string folderRelativeId) : base(folderRelativeId) { @@ -552,7 +552,7 @@ public override string Name public override bool IsExecutable => FileExtensionHelpers.IsExecutableFile(TargetPath, true); } - public sealed class ZipItem : ListedItem + public sealed partial class ZipItem : ListedItem { public ZipItem(string folderRelativeId) : base(folderRelativeId) { @@ -576,7 +576,7 @@ public ZipItem() : base() { } } - public sealed class LibraryItem : ListedItem + public sealed partial class LibraryItem : ListedItem { public LibraryItem(LibraryLocationItem library) : base(null) { @@ -603,7 +603,7 @@ public LibraryItem(LibraryLocationItem library) : base(null) public ReadOnlyCollection Folders { get; } } - public sealed class AlternateStreamItem : ListedItem + public sealed partial class AlternateStreamItem : ListedItem { public string MainStreamPath => ItemPath.Substring(0, ItemPath.LastIndexOf(':')); public string MainStreamName => Path.GetFileName(MainStreamPath); @@ -623,7 +623,7 @@ public override string Name } } - public class GitItem : ListedItem, IGitItem + public partial class GitItem : ListedItem, IGitItem { private volatile int statusPropertiesInitialized = 0; public bool StatusPropertiesInitialized @@ -699,7 +699,7 @@ public string? GitLastCommitFullSha set => SetProperty(ref _GitLastCommitFullSha, value); } } - public sealed class GitShortcutItem : GitItem, IShortcutItem + public sealed partial class GitShortcutItem : GitItem, IShortcutItem { private volatile int statusPropertiesInitialized = 0; public bool StatusPropertiesInitialized diff --git a/src/Files.App/Data/Items/LocationItem.cs b/src/Files.App/Data/Items/LocationItem.cs index d99bef33cdde..b8fd8a2073c3 100644 --- a/src/Files.App/Data/Items/LocationItem.cs +++ b/src/Files.App/Data/Items/LocationItem.cs @@ -9,7 +9,7 @@ namespace Files.App.Data.Items { - public class LocationItem : ObservableObject, INavigationControlItem + public partial class LocationItem : ObservableObject, INavigationControlItem { public BitmapImage icon; public BitmapImage Icon @@ -122,7 +122,7 @@ public int CompareTo(INavigationControlItem other) } } - public sealed class RecycleBinLocationItem : LocationItem + public sealed partial class RecycleBinLocationItem : LocationItem { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Items/ModifiableActionItem.cs b/src/Files.App/Data/Items/ModifiableActionItem.cs index b68864552bbb..e0be7c53fd50 100644 --- a/src/Files.App/Data/Items/ModifiableActionItem.cs +++ b/src/Files.App/Data/Items/ModifiableActionItem.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.Items /// /// Represents item for a hotkey that is registered for a . /// - public class ModifiableActionItem : ObservableObject + public partial class ModifiableActionItem : ObservableObject { public CommandCodes CommandCode { get; set; } diff --git a/src/Files.App/Data/Items/NavigationBarSuggestionItem.cs b/src/Files.App/Data/Items/NavigationBarSuggestionItem.cs index 03a5127154da..46912d9ed444 100644 --- a/src/Files.App/Data/Items/NavigationBarSuggestionItem.cs +++ b/src/Files.App/Data/Items/NavigationBarSuggestionItem.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Items { - public sealed class NavigationBarSuggestionItem : ObservableObject + public sealed partial class NavigationBarSuggestionItem : ObservableObject { private string? _Text; public string? Text diff --git a/src/Files.App/Data/Items/NavigationViewItemButtonStyleItem.cs b/src/Files.App/Data/Items/NavigationViewItemButtonStyleItem.cs index cdcd89bc3708..6232a04a268f 100644 --- a/src/Files.App/Data/Items/NavigationViewItemButtonStyleItem.cs +++ b/src/Files.App/Data/Items/NavigationViewItemButtonStyleItem.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Items { - public sealed class NavigationViewItemButtonStyleItem : ObservableObject + public sealed partial class NavigationViewItemButtonStyleItem : ObservableObject { public string? Name; diff --git a/src/Files.App/Data/Items/SidebarLibraryItem.cs b/src/Files.App/Data/Items/SidebarLibraryItem.cs index ee62c0b19953..d3f0cda6f2ef 100644 --- a/src/Files.App/Data/Items/SidebarLibraryItem.cs +++ b/src/Files.App/Data/Items/SidebarLibraryItem.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Items { - public sealed class LibraryLocationItem : LocationItem + public sealed partial class LibraryLocationItem : LocationItem { public string DefaultSaveFolder { get; } diff --git a/src/Files.App/Data/Items/WidgetContainerItem.cs b/src/Files.App/Data/Items/WidgetContainerItem.cs index f36628314067..8184c5f2300b 100644 --- a/src/Files.App/Data/Items/WidgetContainerItem.cs +++ b/src/Files.App/Data/Items/WidgetContainerItem.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.Items /// /// Represents an item of Files widget container. /// - public sealed class WidgetContainerItem : ObservableObject, IDisposable + public sealed partial class WidgetContainerItem : ObservableObject, IDisposable { // Fields diff --git a/src/Files.App/Data/Items/WidgetDriveCardItem.cs b/src/Files.App/Data/Items/WidgetDriveCardItem.cs index 08e3d1136831..c8d41ed31d4a 100644 --- a/src/Files.App/Data/Items/WidgetDriveCardItem.cs +++ b/src/Files.App/Data/Items/WidgetDriveCardItem.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Items { - public sealed class WidgetDriveCardItem : WidgetCardItem, IWidgetCardItem, IComparable + public sealed partial class WidgetDriveCardItem : WidgetCardItem, IWidgetCardItem, IComparable { private byte[] thumbnailData; diff --git a/src/Files.App/Data/Items/WidgetFolderCardItem.cs b/src/Files.App/Data/Items/WidgetFolderCardItem.cs index f0cc5c7bdeea..caf832438501 100644 --- a/src/Files.App/Data/Items/WidgetFolderCardItem.cs +++ b/src/Files.App/Data/Items/WidgetFolderCardItem.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Items { - public sealed class WidgetFolderCardItem : WidgetCardItem, IWidgetCardItem + public sealed partial class WidgetFolderCardItem : WidgetCardItem, IWidgetCardItem { // Fields diff --git a/src/Files.App/Data/Items/WidgetRecentItem.cs b/src/Files.App/Data/Items/WidgetRecentItem.cs index 717796886235..ec26009caefb 100644 --- a/src/Files.App/Data/Items/WidgetRecentItem.cs +++ b/src/Files.App/Data/Items/WidgetRecentItem.cs @@ -10,7 +10,7 @@ namespace Files.App.Data.Items /// /// Represents an item for recent item of File Explorer on Windows. /// - public sealed class RecentItem : WidgetCardItem, IEquatable, IDisposable + public sealed partial class RecentItem : WidgetCardItem, IEquatable, IDisposable { private BitmapImage? _Icon; /// diff --git a/src/Files.App/Data/Items/WindowEx.cs b/src/Files.App/Data/Items/WindowEx.cs index 782788918989..b19f3ba449f8 100644 --- a/src/Files.App/Data/Items/WindowEx.cs +++ b/src/Files.App/Data/Items/WindowEx.cs @@ -18,7 +18,7 @@ namespace Files.App.Data.Items /// /// Represents base class to extend its features. /// - public unsafe class WindowEx : Window, IDisposable + public unsafe partial class WindowEx : Window, IDisposable { private bool _isInitialized; private readonly WNDPROC _oldWndProc; @@ -54,20 +54,6 @@ public bool IsMaximizable if (AppWindow.Presenter is OverlappedPresenter overlapped) overlapped.IsMaximizable = value; - - if (value) - { - // WORKAROUND: - // https://github.com/microsoft/microsoft-ui-xaml/issues/8431 - // NOTE: - // Indicates to the Shell that the window should not be treated as full-screen - // not to mess up the taskbar when being full-screen mode. - // This property should only be set if the "Automatically hide the taskbar" in Windows 11, - // or "Automatically hide the taskbar in desktop mode" in Windows 10 is enabled. - // Setting this property when the setting is disabled will result in the taskbar overlapping the application. - if (AppLifecycleHelper.IsAutoHideTaskbarEnabled()) - Win32PInvoke.SetPropW(WindowHandle, "NonRudeHWND", new IntPtr(1)); - } } } @@ -275,7 +261,7 @@ private LRESULT NewWindowProc(HWND param0, uint param1, WPARAM param2, LPARAM pa } case 0x0024: /*WM_GETMINMAXINFO*/ { - var dpi = PInvoke.GetDpiForWindow(new(param0)); + var dpi = PInvoke.GetDpiForWindow(param0); float scalingFactor = (float)dpi / 96; var minMaxInfo = Marshal.PtrToStructure(param3); diff --git a/src/Files.App/Data/Items/WslDistroItem.cs b/src/Files.App/Data/Items/WslDistroItem.cs index 512d7077c10f..4d9c2898a606 100644 --- a/src/Files.App/Data/Items/WslDistroItem.cs +++ b/src/Files.App/Data/Items/WslDistroItem.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Items { - public sealed class WslDistroItem : ObservableObject, INavigationControlItem + public sealed partial class WslDistroItem : ObservableObject, INavigationControlItem { public string Text { get; set; } diff --git a/src/Files.App/Data/Models/AppModel.cs b/src/Files.App/Data/Models/AppModel.cs index 663cc219f80d..63577cfd65c6 100644 --- a/src/Files.App/Data/Models/AppModel.cs +++ b/src/Files.App/Data/Models/AppModel.cs @@ -7,7 +7,7 @@ namespace Files.App.Data.Models { - public sealed class AppModel : ObservableObject + public sealed partial class AppModel : ObservableObject { public AppModel() { diff --git a/src/Files.App/Data/Models/ColumnsViewModel.cs b/src/Files.App/Data/Models/ColumnsViewModel.cs index b21b9253063b..6a2dc1ece173 100644 --- a/src/Files.App/Data/Models/ColumnsViewModel.cs +++ b/src/Files.App/Data/Models/ColumnsViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Models { - public sealed class ColumnsViewModel : ObservableObject + public sealed partial class ColumnsViewModel : ObservableObject { private DetailsLayoutColumnItem iconColumn = new() { diff --git a/src/Files.App/Data/Models/CurrentInstanceViewModel.cs b/src/Files.App/Data/Models/CurrentInstanceViewModel.cs index f91b664acc5f..8bdcd4a74747 100644 --- a/src/Files.App/Data/Models/CurrentInstanceViewModel.cs +++ b/src/Files.App/Data/Models/CurrentInstanceViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Models { - public sealed class CurrentInstanceViewModel : ObservableObject + public sealed partial class CurrentInstanceViewModel : ObservableObject { // TODO: // In the future, we should consolidate these public variables into diff --git a/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs b/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs index ab41f1b170c1..abcdb97c09ba 100644 --- a/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs +++ b/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class StatusBarViewModel : ObservableObject + public sealed partial class StatusBarViewModel : ObservableObject { private IContentPageContext ContentPageContext { get; } = Ioc.Default.GetRequiredService(); private IDevToolsSettingsService DevToolsSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Models/DisposableArray.cs b/src/Files.App/Data/Models/DisposableArray.cs index 727981b19d66..1125fdacc6c7 100644 --- a/src/Files.App/Data/Models/DisposableArray.cs +++ b/src/Files.App/Data/Models/DisposableArray.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Models { - public sealed class DisposableArray : FreeableStore + public sealed partial class DisposableArray : FreeableStore { public byte[] Bytes { get; } diff --git a/src/Files.App/Data/Models/DrivesViewModel.cs b/src/Files.App/Data/Models/DrivesViewModel.cs index db34cdef134d..7d6cf1cfdb84 100644 --- a/src/Files.App/Data/Models/DrivesViewModel.cs +++ b/src/Files.App/Data/Models/DrivesViewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.Data.Models { - public sealed class DrivesViewModel : ObservableObject, IDisposable + public sealed partial class DrivesViewModel : ObservableObject, IDisposable { public ObservableCollection Drives { diff --git a/src/Files.App/Data/Models/HashInfoItem.cs b/src/Files.App/Data/Models/HashInfoItem.cs index 02f1901b751b..6a266be32697 100644 --- a/src/Files.App/Data/Models/HashInfoItem.cs +++ b/src/Files.App/Data/Models/HashInfoItem.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Models { - public sealed class HashInfoItem : ObservableObject + public sealed partial class HashInfoItem : ObservableObject { private string _Algorithm; public string Algorithm diff --git a/src/Files.App/Data/Models/ListedTagViewModel.cs b/src/Files.App/Data/Models/ListedTagViewModel.cs index 764c768b936d..e8390610c8df 100644 --- a/src/Files.App/Data/Models/ListedTagViewModel.cs +++ b/src/Files.App/Data/Models/ListedTagViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.Data.Models { - public sealed class ListedTagViewModel : ObservableObject + public sealed partial class ListedTagViewModel : ObservableObject { private TagViewModel _Tag; public TagViewModel Tag diff --git a/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs b/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs index a89c7113a4a1..18ac59ddf185 100644 --- a/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs +++ b/src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.Data.Models { - public sealed class SelectedItemsPropertiesViewModel : ObservableObject + public sealed partial class SelectedItemsPropertiesViewModel : ObservableObject { private static readonly IDateTimeFormatter dateTimeFormatter = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Models/SuggestionModel.cs b/src/Files.App/Data/Models/SuggestionModel.cs index a1f591be0d47..c147a8c1eab1 100644 --- a/src/Files.App/Data/Models/SuggestionModel.cs +++ b/src/Files.App/Data/Models/SuggestionModel.cs @@ -5,7 +5,7 @@ namespace Files.App.Data.Models { - public sealed class SuggestionModel : ObservableObject + public sealed partial class SuggestionModel : ObservableObject { public bool IsRecentSearch { get; set; } = false; diff --git a/src/Files.App/Data/TemplateSelectors/FileSystemDialogItemSelector.cs b/src/Files.App/Data/TemplateSelectors/FileSystemDialogItemSelector.cs index 153060eb4e46..49e2009f474d 100644 --- a/src/Files.App/Data/TemplateSelectors/FileSystemDialogItemSelector.cs +++ b/src/Files.App/Data/TemplateSelectors/FileSystemDialogItemSelector.cs @@ -6,7 +6,7 @@ namespace Files.App.Data.TemplateSelectors { - internal sealed class FileSystemDialogItemSelector : BaseTemplateSelector + internal sealed partial class FileSystemDialogItemSelector : BaseTemplateSelector { public DataTemplate? ConflictItemDataTemplate { get; set; } diff --git a/src/Files.App/Data/TemplateSelectors/PathBreadcrumbItemSelector.cs b/src/Files.App/Data/TemplateSelectors/PathBreadcrumbItemSelector.cs index e8319834e22c..a63112ba2723 100644 --- a/src/Files.App/Data/TemplateSelectors/PathBreadcrumbItemSelector.cs +++ b/src/Files.App/Data/TemplateSelectors/PathBreadcrumbItemSelector.cs @@ -9,7 +9,7 @@ namespace Files.App.Data.TemplateSelectors /// /// Provides template selector for Path Breadcrumb template items. /// - internal sealed class PathBreadcrumbItemSelector : DataTemplateSelector + internal sealed partial class PathBreadcrumbItemSelector : DataTemplateSelector { public DataTemplate? ParentItems { get; set; } diff --git a/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs b/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs index 7f6c00db7f05..a7dff2a0ce5e 100644 --- a/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs +++ b/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs @@ -105,7 +105,7 @@ private void ViewModel_PropertyChanged(object? _, PropertyChangedEventArgs e) PasswordBox.Focus(FocusState.Programmatic); } - private sealed class DialogViewModel : ObservableObject + private sealed partial class DialogViewModel : ObservableObject { private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Dialogs/CredentialDialog.xaml b/src/Files.App/Dialogs/CredentialDialog.xaml index 62712c8eb6e5..0bc09d4e24c2 100644 --- a/src/Files.App/Dialogs/CredentialDialog.xaml +++ b/src/Files.App/Dialogs/CredentialDialog.xaml @@ -3,7 +3,7 @@ x:Class="Files.App.Dialogs.CredentialDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters" + xmlns:converters="using:CommunityToolkit.WinUI.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" diff --git a/src/Files.App/Dialogs/DynamicDialog.xaml b/src/Files.App/Dialogs/DynamicDialog.xaml index 737b7f342d3b..df66b5d052c2 100644 --- a/src/Files.App/Dialogs/DynamicDialog.xaml +++ b/src/Files.App/Dialogs/DynamicDialog.xaml @@ -6,7 +6,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="{x:Bind ViewModel.TitleText, Mode=OneWay}" CloseButtonClick="ContentDialog_CloseButtonClick" @@ -53,9 +52,9 @@ Content="{x:Bind ViewModel.DisplayControl, Mode=OneWay}"> - - - + + + diff --git a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml index 3e8ddcf5ee2d..3242597f40f2 100644 --- a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml +++ b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml @@ -8,7 +8,7 @@ xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:templateselectors="using:Files.App.Data.TemplateSelectors" - xmlns:tvc="using:CommunityToolkit.WinUI.UI.Converters" + xmlns:tvc="using:CommunityToolkit.WinUI.Converters" xmlns:vm="using:Files.App.ViewModels.Dialogs.FileSystemDialog" x:Name="RootDialog" Title="{x:Bind ViewModel.Title, Mode=OneWay}" diff --git a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs index 9e8819c0cac7..36e78ab6f6fd 100644 --- a/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs +++ b/src/Files.App/Dialogs/FilesystemOperationDialog.xaml.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Microsoft.Extensions.Logging; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/Dialogs/GitHubLoginDialog.xaml b/src/Files.App/Dialogs/GitHubLoginDialog.xaml index c92b49feef38..61f60fc96d58 100644 --- a/src/Files.App/Dialogs/GitHubLoginDialog.xaml +++ b/src/Files.App/Dialogs/GitHubLoginDialog.xaml @@ -3,7 +3,7 @@ x:Class="Files.App.Dialogs.GitHubLoginDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters" + xmlns:converters="using:CommunityToolkit.WinUI.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" diff --git a/src/Files.App/Dialogs/ReleaseNotesDialog.xaml b/src/Files.App/Dialogs/ReleaseNotesDialog.xaml index e99c1b03bdd4..26d57be3d181 100644 --- a/src/Files.App/Dialogs/ReleaseNotesDialog.xaml +++ b/src/Files.App/Dialogs/ReleaseNotesDialog.xaml @@ -3,7 +3,7 @@ x:Class="Files.App.Dialogs.ReleaseNotesDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" + xmlns:controls="using:CommunityToolkit.WinUI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" diff --git a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs index 94e0f616b1a4..e370600b1f9c 100644 --- a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs +++ b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Files.App.Data.Items; using Files.App.Extensions; using Files.App.ViewModels.Dialogs; diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index 510ccc14f8a5..868f7ab0a696 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -2,13 +2,13 @@ - net8.0-windows10.0.22621.0 + $(TargetFrameworkVersion)-windows$(TargetWindowsVersion) WinExe Files en-US Scale|DXFeatureLevel Language=en-US;af;ar;be-BY;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;lt-LT;lv-LV;ms-MY;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant - 10.0.19041.0 + $(MinimalWindowsVersion) False SHA256 False @@ -33,12 +33,8 @@ ..\Files.App (Package)\Assets\AppTiles\Dev\Logo.ico - - TRACE;DEBUG;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN - - - TRACE;RELEASE;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN - true + + $(DefineConstants);DISABLE_XAML_GENERATED_MAIN @@ -66,32 +62,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -121,19 +126,6 @@ - - - - - - - - - - - - - diff --git a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs index a4aa665d0680..227025f6f933 100644 --- a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs +++ b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; +using CommunityToolkit.WinUI; using Files.App.Helpers.Application; using Files.App.Services.SizeProvider; using Files.App.Utils.Logger; @@ -9,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.Win32; using Sentry; using Sentry.Protocol; using System.IO; @@ -26,6 +27,42 @@ namespace Files.App.Helpers /// public static class AppLifecycleHelper { + private readonly static string AppInformationKey = @$"Software\Files Community\{Package.Current.Id.Name}\v1\AppInformation"; + + /// + /// Gets the value that indicates whether the app is updated. + /// + public static bool IsAppUpdated { get; } + + /// + /// Gets the value that indicates whether the app is running for the first time. + /// + public static bool IsFirstRun { get; } + + /// + /// Gets the value that indicates the total launch count of the app. + /// + public static long TotalLaunchCount { get; } + + static AppLifecycleHelper() + { + using var infoKey = Registry.CurrentUser.CreateSubKey(AppInformationKey); + var version = infoKey.GetValue("LastLaunchVersion"); + var launchCount = infoKey.GetValue("TotalLaunchCount"); + if (version is null) + { + IsAppUpdated = true; + IsFirstRun = true; + } + else + { + IsAppUpdated = version.ToString() != Package.Current.Id.Version.ToString(); + } + TotalLaunchCount = launchCount is long l ? l + 1 : 1; + infoKey.SetValue("LastLaunchVersion", Package.Current.Id.Version.ToString()!); + infoKey.SetValue("TotalLaunchCount", TotalLaunchCount); + } + /// /// Gets the value that provides application environment or branch name. /// @@ -114,14 +151,11 @@ public static void ConfigureSentry() { options.Dsn = Constants.AutomatedWorkflowInjectionKeys.SentrySecret; options.AutoSessionTracking = true; - options.Release = $"{SystemInformation.Instance.ApplicationVersion.Major}.{SystemInformation.Instance.ApplicationVersion.Minor}.{SystemInformation.Instance.ApplicationVersion.Build}"; + var packageVersion = Package.Current.Id.Version; + options.Release = $"{packageVersion.Major}.{packageVersion.Minor}.{packageVersion.Build}"; options.TracesSampleRate = 0.80; options.ProfilesSampleRate = 0.40; options.Environment = AppEnvironment == AppEnvironment.StorePreview || AppEnvironment == AppEnvironment.SideloadPreview ? "preview" : "production"; - options.ExperimentalMetrics = new ExperimentalMetricsOptions - { - EnableCodeLocations = true - }; options.DisableWinUiUnhandledExceptionIntegration(); }); @@ -346,30 +380,6 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti Process.GetCurrentProcess().Kill(); } - /// - /// Checks if the taskbar is set to auto-hide. - /// - public static bool IsAutoHideTaskbarEnabled() - { - try - { - const string registryKey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3"; - const string valueName = "Settings"; - - using var key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(registryKey); - - var value = key?.GetValue(valueName) as byte[]; - - // The least significant bit of the 9th byte controls the auto-hide setting - return value != null && ((value[8] & 0x01) == 1); - } - catch (SecurityException) - { - // Handle edge case where OpenSubKey results in SecurityException - return false; - } - } - /// /// Updates the visibility of the system tray icon /// diff --git a/src/Files.App/Helpers/ColorHelpers.cs b/src/Files.App/Helpers/ColorHelpers.cs index 52f2074e9972..a4bd89df29c9 100644 --- a/src/Files.App/Helpers/ColorHelpers.cs +++ b/src/Files.App/Helpers/ColorHelpers.cs @@ -1,8 +1,6 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; -using System; using System.Globalization; using Windows.UI; @@ -79,26 +77,9 @@ public static string RandomColor() return color.ToHex(); } - private static string ToHex(this System.Drawing.Color color) + private static string ToHex(this Color color) { return $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}"; } - - public static Windows.UI.Color ToWindowsColor(this System.Drawing.Color color) - { - string hex = color.ToHex(); - return FromHex(hex); - } - - public static System.Drawing.Color FromWindowsColor(this Windows.UI.Color color) - { - string hex = color.ToHex(); - - return System.Drawing.Color.FromArgb( - Convert.ToByte(hex.Substring(1, 2), 16), - Convert.ToByte(hex.Substring(3, 2), 16), - Convert.ToByte(hex.Substring(5, 2), 16), - Convert.ToByte(hex.Substring(7, 2), 16)); - } } } diff --git a/src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs b/src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs index 64ec08398c69..d3e74adb7433 100644 --- a/src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs +++ b/src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs @@ -8,7 +8,7 @@ namespace Files.App.Helpers /// /// Represents manager for layout preferences settings. /// - public sealed class LayoutPreferencesManager : ObservableObject + public sealed partial class LayoutPreferencesManager : ObservableObject { // Dependency injections diff --git a/src/Files.App/Helpers/Navigation/NavigationInteractionTracker.cs b/src/Files.App/Helpers/Navigation/NavigationInteractionTracker.cs index b654c85fd805..a10a0c268041 100644 --- a/src/Files.App/Helpers/Navigation/NavigationInteractionTracker.cs +++ b/src/Files.App/Helpers/Navigation/NavigationInteractionTracker.cs @@ -12,7 +12,7 @@ namespace Files.App.Helpers { - internal sealed class NavigationInteractionTracker : IDisposable + internal sealed partial class NavigationInteractionTracker : IDisposable { public bool CanNavigateForward { @@ -175,7 +175,7 @@ public void Dispose() GC.SuppressFinalize(this); } - private sealed class InteractionTrackerOwner : IInteractionTrackerOwner + private sealed partial class InteractionTrackerOwner : IInteractionTrackerOwner { private NavigationInteractionTracker _parent; private bool _shouldBounceBack; diff --git a/src/Files.App/Helpers/ResourceHelpers.cs b/src/Files.App/Helpers/ResourceHelpers.cs index 5d32cbcba30e..545b5df082c2 100644 --- a/src/Files.App/Helpers/ResourceHelpers.cs +++ b/src/Files.App/Helpers/ResourceHelpers.cs @@ -7,7 +7,7 @@ namespace Files.App.Helpers { [MarkupExtensionReturnType(ReturnType = typeof(string))] - public sealed class ResourceString : MarkupExtension + public sealed partial class ResourceString : MarkupExtension { private static readonly ResourceLoader resourceLoader = new(); diff --git a/src/Files.App/Helpers/UI/AppSystemBackdrop.cs b/src/Files.App/Helpers/UI/AppSystemBackdrop.cs index 091cfc0da6ba..c86eeca474db 100644 --- a/src/Files.App/Helpers/UI/AppSystemBackdrop.cs +++ b/src/Files.App/Helpers/UI/AppSystemBackdrop.cs @@ -7,7 +7,7 @@ namespace Files.App.Helpers { - internal sealed class AppSystemBackdrop : SystemBackdrop + internal sealed partial class AppSystemBackdrop : SystemBackdrop { private bool isSecondaryWindow; private IUserSettingsService userSettingsService; diff --git a/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs b/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs index 63780469d6eb..01def1211618 100644 --- a/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs +++ b/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs @@ -26,19 +26,19 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS try { - service.SetAppThemeBackgroundColor(ColorHelper.ToColor(appThemeBackgroundColor).FromWindowsColor()); + service.SetAppThemeBackgroundColor(appThemeBackgroundColor.ToColor()); } catch { appearance.AppThemeBackgroundColor = "#00000000"; // reset to default - service.SetAppThemeBackgroundColor(ColorHelper.ToColor("#00000000").FromWindowsColor()); + service.SetAppThemeBackgroundColor("#00000000".ToColor()); } if (!string.IsNullOrWhiteSpace(appThemeAddressBarBackgroundColor)) { try { - service.SetAppThemeAddressBarBackgroundColor(ColorHelper.ToColor(appThemeAddressBarBackgroundColor).FromWindowsColor()); + service.SetAppThemeAddressBarBackgroundColor(appThemeAddressBarBackgroundColor.ToColor()); } catch { @@ -50,7 +50,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { try { - service.SetAppThemeToolbarBackgroundColor(ColorHelper.ToColor(appThemeToolbarBackgroundColor).FromWindowsColor()); + service.SetAppThemeToolbarBackgroundColor(appThemeToolbarBackgroundColor.ToColor()); } catch { @@ -62,7 +62,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { try { - service.SetAppThemeSidebarBackgroundColor(ColorHelper.ToColor(appThemeSidebarBackgroundColor).FromWindowsColor()); + service.SetAppThemeSidebarBackgroundColor(appThemeSidebarBackgroundColor.ToColor()); } catch { @@ -74,7 +74,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { try { - service.SetAppThemeFileAreaBackgroundColor(ColorHelper.ToColor(appThemeFileAreaBackgroundColor).FromWindowsColor()); + service.SetAppThemeFileAreaBackgroundColor(appThemeFileAreaBackgroundColor.ToColor()); } catch { @@ -86,7 +86,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { try { - service.SetAppThemeFileAreaSecondaryBackgroundColor(ColorHelper.ToColor(appThemeFileAreaSecondaryBackgroundColor).FromWindowsColor()); + service.SetAppThemeFileAreaSecondaryBackgroundColor(appThemeFileAreaSecondaryBackgroundColor.ToColor()); } catch { @@ -98,7 +98,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { try { - service.SetAppThemeInfoPaneBackgroundColor(ColorHelper.ToColor(appThemeInfoPaneBackgroundColor).FromWindowsColor()); + service.SetAppThemeInfoPaneBackgroundColor(appThemeInfoPaneBackgroundColor.ToColor()); } catch { diff --git a/src/Files.App/Helpers/WMI/ManagementEventWatcher.cs b/src/Files.App/Helpers/WMI/ManagementEventWatcher.cs index 9a938b3a8d19..6de09f630c47 100644 --- a/src/Files.App/Helpers/WMI/ManagementEventWatcher.cs +++ b/src/Files.App/Helpers/WMI/ManagementEventWatcher.cs @@ -17,7 +17,7 @@ namespace Files.App.Helpers /// Original Sourced from: https://codereview.stackexchange.com/questions/255055/trying-to-replace-managementeventwatcher-class-in-system-management-to-switch-to /// Adapted to newer versions of MMI /// - public class ManagementEventWatcher : IDisposable, IObserver + public partial class ManagementEventWatcher : IDisposable, IObserver { internal enum CimWatcherStatus { diff --git a/src/Files.App/Helpers/Win32/Win32Helper.Storage.cs b/src/Files.App/Helpers/Win32/Win32Helper.Storage.cs index 1ef9b30dcf41..8e2e3a5979ba 100644 --- a/src/Files.App/Helpers/Win32/Win32Helper.Storage.cs +++ b/src/Files.App/Helpers/Win32/Win32Helper.Storage.cs @@ -949,13 +949,11 @@ public static unsafe bool CanCompressContent(string path) var success = PInvoke.GetVolumeInformation( path, - null, - 0u, + [], null, null, &dwFileSystemFlags, - null, - 0u); + []); if (!success) return false; diff --git a/src/Files.App/Helpers/Xaml/SystemTypeToXaml.cs b/src/Files.App/Helpers/Xaml/SystemTypeToXaml.cs index eef21ae1a2c7..8ea8c858c5cb 100644 --- a/src/Files.App/Helpers/Xaml/SystemTypeToXaml.cs +++ b/src/Files.App/Helpers/Xaml/SystemTypeToXaml.cs @@ -5,7 +5,7 @@ namespace Files.App.Helpers { - public sealed class SystemTypeToXaml : MarkupExtension + public sealed partial class SystemTypeToXaml : MarkupExtension { #region Private Members diff --git a/src/Files.App/Services/App/AppResourcesService.cs b/src/Files.App/Services/App/AppResourcesService.cs index d6003aa0ffff..4718d8d8f0fd 100644 --- a/src/Files.App/Services/App/AppResourcesService.cs +++ b/src/Files.App/Services/App/AppResourcesService.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. using Microsoft.UI.Xaml; -using System.Drawing; +using Windows.UI; namespace Files.App.Services { @@ -14,46 +14,46 @@ public sealed class ResourcesService : IResourcesService /// public void SetAppThemeBackgroundColor(Color appThemeBackgroundColor) { - Application.Current.Resources["App.Theme.BackgroundBrush"] = appThemeBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.BackgroundBrush"] = appThemeBackgroundColor; } /// public void SetAppThemeAddressBarBackgroundColor(Color appThemeAddressBarBackgroundColor) { - Application.Current.Resources["App.Theme.AddressBar.BackgroundBrush"] = appThemeAddressBarBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.AddressBar.BackgroundBrush"] = appThemeAddressBarBackgroundColor; // Overrides the selected tab background to match the address bar - Application.Current.Resources["TabViewItemHeaderBackgroundSelected"] = appThemeAddressBarBackgroundColor.ToWindowsColor(); + Application.Current.Resources["TabViewItemHeaderBackgroundSelected"] = appThemeAddressBarBackgroundColor; } /// public void SetAppThemeToolbarBackgroundColor(Color appThemeToolbarBackgroundColor) { - Application.Current.Resources["App.Theme.Toolbar.BackgroundBrush"] = appThemeToolbarBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.Toolbar.BackgroundBrush"] = appThemeToolbarBackgroundColor; } /// public void SetAppThemeSidebarBackgroundColor(Color appThemeSidebarBackgroundColor) { - Application.Current.Resources["App.Theme.Sidebar.BackgroundBrush"] = appThemeSidebarBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.Sidebar.BackgroundBrush"] = appThemeSidebarBackgroundColor; } /// public void SetAppThemeFileAreaBackgroundColor(Color appThemeFileAreaBackgroundColor) { - Application.Current.Resources["App.Theme.FileArea.BackgroundBrush"] = appThemeFileAreaBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.FileArea.BackgroundBrush"] = appThemeFileAreaBackgroundColor; } /// public void SetAppThemeFileAreaSecondaryBackgroundColor(Color appThemeFileAreaSecondaryBackgroundColor) { - Application.Current.Resources["App.Theme.FileArea.SecondaryBackgroundBrush"] = appThemeFileAreaSecondaryBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.FileArea.SecondaryBackgroundBrush"] = appThemeFileAreaSecondaryBackgroundColor; } /// public void SetAppThemeInfoPaneBackgroundColor(Color appThemeInfoPaneBackgroundColor) { - Application.Current.Resources["App.Theme.InfoPane.BackgroundBrush"] = appThemeInfoPaneBackgroundColor.ToWindowsColor(); + Application.Current.Resources["App.Theme.InfoPane.BackgroundBrush"] = appThemeInfoPaneBackgroundColor; } /// diff --git a/src/Files.App/Services/App/AppUpdateNoneService.cs b/src/Files.App/Services/App/AppUpdateNoneService.cs index d3aa65a46a41..cc809b12f539 100644 --- a/src/Files.App/Services/App/AppUpdateNoneService.cs +++ b/src/Files.App/Services/App/AppUpdateNoneService.cs @@ -1,18 +1,14 @@ -using CommunityToolkit.WinUI.Helpers; -using System.Net.Http; +using System.Net.Http; namespace Files.App.Services { - internal sealed class DummyUpdateService : ObservableObject, IUpdateService + internal sealed partial class DummyUpdateService : ObservableObject, IUpdateService { public bool IsUpdateAvailable => false; public bool IsUpdating => false; - public bool IsAppUpdated - { - get => SystemInformation.Instance.IsAppUpdated; - } + public bool IsAppUpdated => AppLifecycleHelper.IsAppUpdated; private bool _areReleaseNotesAvailable = false; public bool AreReleaseNotesAvailable diff --git a/src/Files.App/Services/App/AppUpdateSideloadService.cs b/src/Files.App/Services/App/AppUpdateSideloadService.cs index 94795c30dde9..a4564f842b62 100644 --- a/src/Files.App/Services/App/AppUpdateSideloadService.cs +++ b/src/Files.App/Services/App/AppUpdateSideloadService.cs @@ -12,7 +12,7 @@ namespace Files.App.Services { - public sealed class SideloadUpdateService : ObservableObject, IUpdateService, IDisposable + public sealed partial class SideloadUpdateService : ObservableObject, IUpdateService, IDisposable { private const string SIDELOAD_STABLE = "https://cdn.files.community/files/stable/Files.Package.appinstaller"; private const string SIDELOAD_PREVIEW = "https://cdn.files.community/files/preview/Files.Package.appinstaller"; @@ -55,7 +55,7 @@ public bool IsUpdating public bool IsAppUpdated { - get => SystemInformation.Instance.IsAppUpdated; + get => AppLifecycleHelper.IsAppUpdated; } private bool _areReleaseNotesAvailable = false; diff --git a/src/Files.App/Services/App/AppUpdateStoreService.cs b/src/Files.App/Services/App/AppUpdateStoreService.cs index 4655bcdb4685..b14bbc12ef5a 100644 --- a/src/Files.App/Services/App/AppUpdateStoreService.cs +++ b/src/Files.App/Services/App/AppUpdateStoreService.cs @@ -13,7 +13,7 @@ namespace Files.App.Services { - internal sealed class StoreUpdateService : ObservableObject, IUpdateService + internal sealed partial class StoreUpdateService : ObservableObject, IUpdateService { private StoreContext? _storeContext; private List? _updatePackages; @@ -36,7 +36,7 @@ public bool IsUpdating public bool IsAppUpdated { - get => SystemInformation.Instance.IsAppUpdated; + get => AppLifecycleHelper.IsAppUpdated; } private bool _areReleaseNotesAvailable = false; diff --git a/src/Files.App/Services/PreviewPopupProviders/PreviewPopupService.cs b/src/Files.App/Services/PreviewPopupProviders/PreviewPopupService.cs index 07a87a91bd92..c6408ef4a842 100644 --- a/src/Files.App/Services/PreviewPopupProviders/PreviewPopupService.cs +++ b/src/Files.App/Services/PreviewPopupProviders/PreviewPopupService.cs @@ -6,7 +6,7 @@ namespace Files.App.Services.PreviewPopupProviders { /// - internal sealed class PreviewPopupService : ObservableObject, IPreviewPopupService + internal sealed partial class PreviewPopupService : ObservableObject, IPreviewPopupService { public async Task GetProviderAsync() { diff --git a/src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs b/src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs index fb659c775cee..c5a39d53355d 100644 --- a/src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs +++ b/src/Files.App/Services/PreviewPopupProviders/SeerProProvider.cs @@ -60,9 +60,9 @@ public async Task SwitchPreviewAsync(string path) await TogglePreviewPopupAsync(path); } - public async Task DetectAvailability() + public async unsafe Task DetectAvailability() { - var hWnd = PInvoke.FindWindow("SeerWindowClass", null).Value; + var hWnd = (nint)PInvoke.FindWindow("SeerWindowClass", null).Value; return hWnd != nint.Zero && hWnd.ToInt64() != -1; } diff --git a/src/Files.App/Services/Settings/ActionsSettingsService.cs b/src/Files.App/Services/Settings/ActionsSettingsService.cs index e63c7d8c4a71..77dcd90b6bb3 100644 --- a/src/Files.App/Services/Settings/ActionsSettingsService.cs +++ b/src/Files.App/Services/Settings/ActionsSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class ActionsSettingsService : BaseObservableJsonSettings, IActionsSettingsService + internal sealed partial class ActionsSettingsService : BaseObservableJsonSettings, IActionsSettingsService { /// public List? ActionsV2 diff --git a/src/Files.App/Services/Settings/AppSettingsService.cs b/src/Files.App/Services/Settings/AppSettingsService.cs index 5368d12d27fd..552620e2d0bc 100644 --- a/src/Files.App/Services/Settings/AppSettingsService.cs +++ b/src/Files.App/Services/Settings/AppSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class AppSettingsService : BaseObservableJsonSettings, IAppSettingsService + internal sealed partial class AppSettingsService : BaseObservableJsonSettings, IAppSettingsService { public AppSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/Settings/AppearanceSettingsService.cs b/src/Files.App/Services/Settings/AppearanceSettingsService.cs index bedde39ef74d..e2b16aad26c8 100644 --- a/src/Files.App/Services/Settings/AppearanceSettingsService.cs +++ b/src/Files.App/Services/Settings/AppearanceSettingsService.cs @@ -6,7 +6,7 @@ namespace Files.App.Services.Settings { - internal sealed class AppearanceSettingsService : BaseObservableJsonSettings, IAppearanceSettingsService + internal sealed partial class AppearanceSettingsService : BaseObservableJsonSettings, IAppearanceSettingsService { public AppearanceSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/Settings/ApplicationSettingsService.cs b/src/Files.App/Services/Settings/ApplicationSettingsService.cs index aeb39ee90f00..898bcce492f1 100644 --- a/src/Files.App/Services/Settings/ApplicationSettingsService.cs +++ b/src/Files.App/Services/Settings/ApplicationSettingsService.cs @@ -6,7 +6,7 @@ namespace Files.App.Services.Settings { - internal sealed class ApplicationSettingsService : BaseObservableJsonSettings, IApplicationSettingsService + internal sealed partial class ApplicationSettingsService : BaseObservableJsonSettings, IApplicationSettingsService { public bool ClickedToReviewApp { diff --git a/src/Files.App/Services/Settings/DevToolsSettingsService.cs b/src/Files.App/Services/Settings/DevToolsSettingsService.cs index 319f64b7dfa5..7d2fb980f29d 100644 --- a/src/Files.App/Services/Settings/DevToolsSettingsService.cs +++ b/src/Files.App/Services/Settings/DevToolsSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class DevToolsSettingsService : BaseObservableJsonSettings, IDevToolsSettingsService + internal sealed partial class DevToolsSettingsService : BaseObservableJsonSettings, IDevToolsSettingsService { public DevToolsSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/Settings/FileTagsSettingsService.cs b/src/Files.App/Services/Settings/FileTagsSettingsService.cs index a6f913d1f916..4a3e36b55c52 100644 --- a/src/Files.App/Services/Settings/FileTagsSettingsService.cs +++ b/src/Files.App/Services/Settings/FileTagsSettingsService.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging; using System.IO; using Windows.Storage; +using CommunityToolkit.WinUI.Helpers; namespace Files.App.Services.Settings { diff --git a/src/Files.App/Services/Settings/FoldersSettingsService.cs b/src/Files.App/Services/Settings/FoldersSettingsService.cs index 4ce7bd62413d..6742d9007b9c 100644 --- a/src/Files.App/Services/Settings/FoldersSettingsService.cs +++ b/src/Files.App/Services/Settings/FoldersSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class FoldersSettingsService : BaseObservableJsonSettings, IFoldersSettingsService + internal sealed partial class FoldersSettingsService : BaseObservableJsonSettings, IFoldersSettingsService { public FoldersSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/Settings/GeneralSettingsService.cs b/src/Files.App/Services/Settings/GeneralSettingsService.cs index 73506896cb6f..3d784aa0676e 100644 --- a/src/Files.App/Services/Settings/GeneralSettingsService.cs +++ b/src/Files.App/Services/Settings/GeneralSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class GeneralSettingsService : BaseObservableJsonSettings, IGeneralSettingsService + internal sealed partial class GeneralSettingsService : BaseObservableJsonSettings, IGeneralSettingsService { public GeneralSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/Settings/InfoPaneSettingsService.cs b/src/Files.App/Services/Settings/InfoPaneSettingsService.cs index 5af6f3b14185..bc24ec70df10 100644 --- a/src/Files.App/Services/Settings/InfoPaneSettingsService.cs +++ b/src/Files.App/Services/Settings/InfoPaneSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class InfoPaneSettingsService : BaseObservableJsonSettings, IInfoPaneSettingsService + internal sealed partial class InfoPaneSettingsService : BaseObservableJsonSettings, IInfoPaneSettingsService { public bool IsInfoPaneEnabled { diff --git a/src/Files.App/Services/Settings/LayoutSettingsService.cs b/src/Files.App/Services/Settings/LayoutSettingsService.cs index fb637fe98cf7..802bd1638023 100644 --- a/src/Files.App/Services/Settings/LayoutSettingsService.cs +++ b/src/Files.App/Services/Settings/LayoutSettingsService.cs @@ -3,7 +3,7 @@ namespace Files.App.Services.Settings { - internal sealed class LayoutSettingsService : BaseObservableJsonSettings, ILayoutSettingsService + internal sealed partial class LayoutSettingsService : BaseObservableJsonSettings, ILayoutSettingsService { public LayoutSettingsService(ISettingsSharingContext settingsSharingContext) { diff --git a/src/Files.App/Services/SizeProvider/CachedSizeProvider.cs b/src/Files.App/Services/SizeProvider/CachedSizeProvider.cs index 412735f2422c..b55c3287a50f 100644 --- a/src/Files.App/Services/SizeProvider/CachedSizeProvider.cs +++ b/src/Files.App/Services/SizeProvider/CachedSizeProvider.cs @@ -11,7 +11,7 @@ namespace Files.App.Services.SizeProvider { - public sealed class CachedSizeProvider : ISizeProvider + public sealed partial class CachedSizeProvider : ISizeProvider { private readonly ConcurrentDictionary sizes = new(); diff --git a/src/Files.App/Services/SizeProvider/DrivesSizeProvider.cs b/src/Files.App/Services/SizeProvider/DrivesSizeProvider.cs index a58345d32d54..5026e5c45a20 100644 --- a/src/Files.App/Services/SizeProvider/DrivesSizeProvider.cs +++ b/src/Files.App/Services/SizeProvider/DrivesSizeProvider.cs @@ -10,7 +10,7 @@ namespace Files.App.Services.SizeProvider { - public sealed class DrivesSizeProvider : ISizeProvider + public sealed partial class DrivesSizeProvider : ISizeProvider { private readonly ConcurrentDictionary providers = new(); diff --git a/src/Files.App/Services/SizeProvider/NoSizeProvider.cs b/src/Files.App/Services/SizeProvider/NoSizeProvider.cs index 35bfc52b3704..d8d51e3dca32 100644 --- a/src/Files.App/Services/SizeProvider/NoSizeProvider.cs +++ b/src/Files.App/Services/SizeProvider/NoSizeProvider.cs @@ -7,7 +7,7 @@ namespace Files.App.Services.SizeProvider { - public sealed class NoSizeProvider : ISizeProvider + public sealed partial class NoSizeProvider : ISizeProvider { public event EventHandler? SizeChanged; diff --git a/src/Files.App/Services/SizeProvider/UserSizeProvider.cs b/src/Files.App/Services/SizeProvider/UserSizeProvider.cs index 033f8e2a183f..a86413955440 100644 --- a/src/Files.App/Services/SizeProvider/UserSizeProvider.cs +++ b/src/Files.App/Services/SizeProvider/UserSizeProvider.cs @@ -5,7 +5,7 @@ namespace Files.App.Services { - public sealed class UserSizeProvider : ISizeProvider + public sealed partial class UserSizeProvider : ISizeProvider { private readonly IFoldersSettingsService folderPreferences = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Services/Storage/StorageNetworkService.cs b/src/Files.App/Services/Storage/StorageNetworkService.cs index 737694c66bb7..a3b000af1e2d 100644 --- a/src/Files.App/Services/Storage/StorageNetworkService.cs +++ b/src/Files.App/Services/Storage/StorageNetworkService.cs @@ -12,7 +12,7 @@ namespace Files.App.Services { - public sealed class NetworkService : ObservableObject, INetworkService + public sealed partial class NetworkService : ObservableObject, INetworkService { private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Styles/DefaultGridSplitterStyle.xaml b/src/Files.App/Styles/DefaultGridSplitterStyle.xaml index 4a68b43d3524..2ecb6e64c0c9 100644 --- a/src/Files.App/Styles/DefaultGridSplitterStyle.xaml +++ b/src/Files.App/Styles/DefaultGridSplitterStyle.xaml @@ -2,7 +2,7 @@ + xmlns:controls="using:Files.App.Controls"> - + - + - - + + diff --git a/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs b/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs index c856d2fcf6cf..932d3734fc3e 100644 --- a/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs +++ b/src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs @@ -6,7 +6,7 @@ namespace Files.App.Utils.Cloud { - public sealed class CloudDriveSyncStatusUI : ObservableObject + public sealed partial class CloudDriveSyncStatusUI : ObservableObject { public string Glyph { get; } diff --git a/src/Files.App/Utils/CommandLine/ParsedCommands.cs b/src/Files.App/Utils/CommandLine/ParsedCommands.cs index add188367fcb..a8f51c588a02 100644 --- a/src/Files.App/Utils/CommandLine/ParsedCommands.cs +++ b/src/Files.App/Utils/CommandLine/ParsedCommands.cs @@ -6,7 +6,7 @@ namespace Files.App.Utils.CommandLine /// /// Represents a collection of parsed command. /// - public sealed class ParsedCommands : List + public sealed partial class ParsedCommands : List { } } diff --git a/src/Files.App/Utils/Global/QuickAccessManager.cs b/src/Files.App/Utils/Global/QuickAccessManager.cs index ed1b53a680b8..eb4471ec2a09 100644 --- a/src/Files.App/Utils/Global/QuickAccessManager.cs +++ b/src/Files.App/Utils/Global/QuickAccessManager.cs @@ -43,7 +43,7 @@ public async Task InitializeAsync() { PinnedItemsModified += Model.LoadAsync; - if (!Model.PinnedFolders.Contains(Constants.UserEnvironmentPaths.RecycleBinPath) && SystemInformation.Instance.IsFirstRun) + if (!Model.PinnedFolders.Contains(Constants.UserEnvironmentPaths.RecycleBinPath) && AppLifecycleHelper.IsFirstRun) await QuickAccessService.PinToSidebarAsync(Constants.UserEnvironmentPaths.RecycleBinPath); await Model.LoadAsync(); diff --git a/src/Files.App/Utils/Library/LibraryManager.cs b/src/Files.App/Utils/Library/LibraryManager.cs index 88572c87236a..09b6dfcbda49 100644 --- a/src/Files.App/Utils/Library/LibraryManager.cs +++ b/src/Files.App/Utils/Library/LibraryManager.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Library { - public sealed class LibraryManager : IDisposable + public sealed partial class LibraryManager : IDisposable { public EventHandler? DataChanged; diff --git a/src/Files.App/Utils/Logger/SentryLoggerProvider.cs b/src/Files.App/Utils/Logger/SentryLoggerProvider.cs index 7efd64359181..08f42213fb17 100644 --- a/src/Files.App/Utils/Logger/SentryLoggerProvider.cs +++ b/src/Files.App/Utils/Logger/SentryLoggerProvider.cs @@ -5,7 +5,7 @@ namespace Files.App.Utils.Logger { - public sealed class SentryLoggerProvider : ILoggerProvider + public sealed partial class SentryLoggerProvider : ILoggerProvider { public ILogger CreateLogger(string categoryName) { diff --git a/src/Files.App/Utils/Shell/ContextMenu.cs b/src/Files.App/Utils/Shell/ContextMenu.cs index 62cda0eb4e93..7fb485c7e9d8 100644 --- a/src/Files.App/Utils/Shell/ContextMenu.cs +++ b/src/Files.App/Utils/Shell/ContextMenu.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Shell /// /// Provides a helper for Win32 context menu. /// - public class ContextMenu : Win32ContextMenu, IDisposable + public partial class ContextMenu : Win32ContextMenu, IDisposable { private Shell32.IContextMenu _cMenu; diff --git a/src/Files.App/Utils/Shell/ContextMenuItem.cs b/src/Files.App/Utils/Shell/ContextMenuItem.cs index 1773577241d5..28878c5091e1 100644 --- a/src/Files.App/Utils/Shell/ContextMenuItem.cs +++ b/src/Files.App/Utils/Shell/ContextMenuItem.cs @@ -6,7 +6,7 @@ namespace Files.App.Utils.Shell /// /// Represents an item for Win32 context menu. /// - public class ContextMenuItem : Win32ContextMenuItem, IDisposable + public partial class ContextMenuItem : Win32ContextMenuItem, IDisposable { public void Dispose() { diff --git a/src/Files.App/Utils/Shell/PreviewHandler.cs b/src/Files.App/Utils/Shell/PreviewHandler.cs index e6b2a5fbf142..f5962454afe2 100644 --- a/src/Files.App/Utils/Shell/PreviewHandler.cs +++ b/src/Files.App/Utils/Shell/PreviewHandler.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; using Vanara.PInvoke; using Windows.UI; @@ -10,8 +8,22 @@ namespace Files.App.Utils.Shell /// /// Credits: https://github.com/GeeLaw/PreviewHost/ /// - public sealed class PreviewHandler : IDisposable + public sealed partial class PreviewHandler : IDisposable { + const int S_OK = 0; + const int S_FALSE = 1; + const int E_FAIL = unchecked((int)0x80004005); + const int E_SERVER_EXEC_FAILURE = unchecked((int)0x80080005); + + [StructLayout(LayoutKind.Sequential)] + public struct RECT(int left, int top, int right, int bottom) + { + public int Left = left; + public int Top = top; + public int Right = right; + public int Bottom = bottom; + } + #region IPreviewHandlerFrame support [StructLayout(LayoutKind.Sequential)] @@ -21,16 +33,17 @@ public struct PreviewHandlerFrameInfo public uint AcceleratorEntryCount; } - [ComImport, Guid("fec87aaf-35f9-447a-adb7-20234491401a"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IPreviewHandlerFrame + [GeneratedComInterface, Guid("fec87aaf-35f9-447a-adb7-20234491401a"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public partial interface IPreviewHandlerFrame { [PreserveSig] - HRESULT GetWindowContext(out PreviewHandlerFrameInfo pinfo); + int GetWindowContext(out PreviewHandlerFrameInfo pinfo); [PreserveSig] - HRESULT TranslateAccelerator(ref MSG pmsg); + int TranslateAccelerator(nint pmsg); } - public sealed class PreviewHandlerFrame : IPreviewHandlerFrame, IDisposable + [GeneratedComClass] + public sealed partial class PreviewHandlerFrame : IPreviewHandlerFrame, IDisposable { bool disposed; nint hwnd; @@ -47,20 +60,20 @@ public void Dispose() disposed = true; } - public HRESULT GetWindowContext(out PreviewHandlerFrameInfo pinfo) + public int GetWindowContext(out PreviewHandlerFrameInfo pinfo) { pinfo.AcceleratorTableHandle = IntPtr.Zero; pinfo.AcceleratorEntryCount = 0; if (disposed) - return HRESULT.E_FAIL; - return HRESULT.S_OK; + return E_FAIL; + return S_OK; } - public HRESULT TranslateAccelerator(ref MSG pmsg) + public int TranslateAccelerator(nint pmsg) { if (disposed) - return HRESULT.E_FAIL; - return HRESULT.S_FALSE; + return E_FAIL; + return S_FALSE; } } @@ -68,33 +81,33 @@ public HRESULT TranslateAccelerator(ref MSG pmsg) #region IPreviewHandler major interfaces - [ComImport, Guid("8895b1c6-b41f-4c1c-a562-0d564250836f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IPreviewHandler + [GeneratedComInterface, Guid("8895b1c6-b41f-4c1c-a562-0d564250836f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IPreviewHandler { [PreserveSig] - HRESULT SetWindow(IntPtr hwnd, ref RECT prc); + int SetWindow(nint hwnd, in RECT prc); [PreserveSig] - HRESULT SetRect(ref RECT prc); + int SetRect(in RECT prc); [PreserveSig] - HRESULT DoPreview(); + int DoPreview(); [PreserveSig] - HRESULT Unload(); + int Unload(); [PreserveSig] - HRESULT SetFocus(); + int SetFocus(); [PreserveSig] - HRESULT QueryFocus(out IntPtr phwnd); + int QueryFocus(out nint phwnd); // TranslateAccelerator is not used here. } - [ComImport, Guid("196bf9a5-b346-4ef0-aa1e-5dcdb76768b1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IPreviewHandlerVisuals + [GeneratedComInterface, Guid("196bf9a5-b346-4ef0-aa1e-5dcdb76768b1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IPreviewHandlerVisuals { [PreserveSig] - HRESULT SetBackgroundColor(uint color); + int SetBackgroundColor(uint color); [PreserveSig] - HRESULT SetFont(ref LOGFONT plf); + int SetFont(nint plf); [PreserveSig] - HRESULT SetTextColor(uint color); + int SetTextColor(uint color); } static uint ColorRefFromColor(Color color) @@ -102,11 +115,11 @@ static uint ColorRefFromColor(Color color) return (((uint)color.B) << 16) | (((uint)color.G) << 8) | ((uint)color.R); } - [ComImport, Guid("fc4801a3-2ba9-11cf-a229-00aa003d7352"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IObjectWithSite + [GeneratedComInterface, Guid("fc4801a3-2ba9-11cf-a229-00aa003d7352"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IObjectWithSite { [PreserveSig] - HRESULT SetSite([In, MarshalAs(UnmanagedType.IUnknown)] object pUnkSite); + int SetSite(nint pUnkSite); // GetSite is not used. } @@ -115,11 +128,11 @@ interface IObjectWithSite bool disposed; bool init; bool shown; - PreviewHandlerFrame comSite; + PreviewHandlerFrame? comSite; nint hwnd; - IPreviewHandler previewHandler; - IPreviewHandlerVisuals visuals; - IntPtr pPreviewHandler; + IPreviewHandler? previewHandler; + IPreviewHandlerVisuals? visuals; + readonly ComWrappers comWrappers = new StrategyBasedComWrappers(); public PreviewHandler(Guid clsid, nint frame) { @@ -135,12 +148,7 @@ public PreviewHandler(Guid clsid, nint frame) } catch { - if (previewHandler != null) - Marshal.ReleaseComObject(previewHandler); previewHandler = null; - if (pPreviewHandler != IntPtr.Zero) - Marshal.Release(pPreviewHandler); - pPreviewHandler = IntPtr.Zero; comSite.Dispose(); comSite = null; throw; @@ -160,66 +168,80 @@ void SetupHandler(Guid clsid) // If we use Activator.CreateInstance(Type.GetTypeFromCLSID(...)), // CLR will allow in-process server, which defeats isolation and // creates strange bugs. - Windows.Win32.Foundation.HRESULT hr2 = Win32PInvoke.CoCreateInstance(ref clsid, IntPtr.Zero, Win32PInvoke.ClassContext.LocalServer, ref iid, out pph); - HRESULT hr = new(hr2.Value); + int hr = Win32PInvoke.CoCreateInstance(ref clsid, IntPtr.Zero, Win32PInvoke.ClassContext.LocalServer, ref iid, out pph); // See https://blogs.msdn.microsoft.com/adioltean/2005/06/24/when-cocreateinstance-returns-0x80080005-co_e_server_exec_failure/ // CO_E_SERVER_EXEC_FAILURE also tends to happen when debugging in Visual Studio. // Moreover, to create the instance in a server at low integrity level, we need // to use another thread with low mandatory label. We keep it simple by creating // a same-integrity object. - //if (hr == HRESULT.CO_E_SERVER_EXEC_FAILURE) - // hr = CoCreateInstance(ref clsid, IntPtr.Zero, ClassContext.LocalServer, ref iid, out pph); - if ((int)hr < 0) - throw new COMException(cannotCreate, (int)hr); - pPreviewHandler = pph; - var previewHandlerObject = Marshal.GetUniqueObjectForIUnknown(pph); + if (hr == E_SERVER_EXEC_FAILURE) + hr = Win32PInvoke.CoCreateInstance(ref clsid, IntPtr.Zero, Win32PInvoke.ClassContext.LocalServer, ref iid, out pph); + if (hr < 0) + throw new COMException(cannotCreate, hr); + var previewHandlerObject = comWrappers.GetOrCreateObjectForComInstance(pph, CreateObjectFlags.UniqueInstance); previewHandler = previewHandlerObject as IPreviewHandler; + if (previewHandler == null) { - Marshal.ReleaseComObject(previewHandlerObject); throw new COMException(cannotCreate); } var objectWithSite = previewHandlerObject as IObjectWithSite; if (objectWithSite == null) throw new COMException(cannotCast); - hr = objectWithSite.SetSite(comSite); - if ((int)hr < 0) - throw new COMException(cannotSetSite, (int)hr); + hr = objectWithSite.SetSite(comWrappers.GetOrCreateComInterfaceForObject(comSite, CreateComInterfaceFlags.None)); + if (hr < 0) + throw new COMException(cannotSetSite, hr); visuals = previewHandlerObject as IPreviewHandlerVisuals; } #region Initialization interfaces + [GeneratedComInterface, Guid("0000000c-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public partial interface IStream + { + // ISequentialStream portion + void Read([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] byte[] pv, int cb, nint pcbRead); + void Write([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, nint pcbWritten); - [ComImport, Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IInitializeWithStream + // IStream portion + void Seek(long dlibMove, int dwOrigin, nint plibNewPosition); + void SetSize(long libNewSize); + void CopyTo(IStream pstm, long cb, nint pcbRead, nint pcbWritten); + void Commit(int grfCommitFlags); + void Revert(); + void LockRegion(long libOffset, long cb, int dwLockType); + void UnlockRegion(long libOffset, long cb, int dwLockType); + } + + [GeneratedComInterface, Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IInitializeWithStream { [PreserveSig] - HRESULT Initialize(IStream psi, STGM grfMode); + int Initialize(IStream psi, STGM grfMode); } - [ComImport, Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IInitializeWithStreamNative + [GeneratedComInterface, Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IInitializeWithStreamNative { [PreserveSig] - HRESULT Initialize(IntPtr psi, STGM grfMode); + int Initialize(IntPtr psi, STGM grfMode); } static readonly Guid IInitializeWithStreamIid = Guid.ParseExact("b824b49d-22ac-4161-ac8a-9916e8fa3f7f", "d"); - [ComImport, Guid("b7d14566-0509-4cce-a71f-0a554233bd9b"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IInitializeWithFile + [GeneratedComInterface, Guid("b7d14566-0509-4cce-a71f-0a554233bd9b"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IInitializeWithFile { [PreserveSig] - HRESULT Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszFilePath, STGM grfMode); + int Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszFilePath, STGM grfMode); } static readonly Guid IInitializeWithFileIid = Guid.ParseExact("b7d14566-0509-4cce-a71f-0a554233bd9b", "d"); - [ComImport, Guid("7f73be3f-fb79-493c-a6c7-7ee14e245841"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IInitializeWithItem + [GeneratedComInterface, Guid("7f73be3f-fb79-493c-a6c7-7ee14e245841"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal partial interface IInitializeWithItem { [PreserveSig] - HRESULT Initialize(IntPtr psi, STGM grfMode); + int Initialize(IntPtr psi, STGM grfMode); } static readonly Guid IInitializeWithItemIid = Guid.ParseExact("7f73be3f-fb79-493c-a6c7-7ee14e245841", "d"); @@ -244,8 +266,8 @@ public bool InitWithStream(IStream stream, STGM mode) var hr = iws.Initialize(stream, mode); if (hr == HRESULT.E_NOTIMPL) return false; - if ((int)hr < 0) - throw new COMException("IInitializeWithStream.Initialize failed.", (int)hr); + if (hr < 0) + throw new COMException("IInitializeWithStream.Initialize failed.", hr); init = true; return true; } @@ -270,8 +292,8 @@ public bool InitWithStream(IntPtr pStream, STGM mode) var hr = iws.Initialize(pStream, mode); if (hr == HRESULT.E_NOTIMPL) return false; - if ((int)hr < 0) - throw new COMException("IInitializeWithStream.Initialize failed.", (int)hr); + if (hr < 0) + throw new COMException("IInitializeWithStream.Initialize failed.", hr); init = true; return true; } @@ -296,8 +318,8 @@ public bool InitWithItem(IntPtr psi, STGM mode) var hr = iwi.Initialize(psi, mode); if (hr == HRESULT.E_NOTIMPL) return false; - if ((int)hr < 0) - throw new COMException("IInitializeWithItem.Initialize failed.", (int)hr); + if (hr < 0) + throw new COMException("IInitializeWithItem.Initialize failed.", hr); init = true; return true; } @@ -322,8 +344,8 @@ public bool InitWithFile(string path, STGM mode) var hr = iwf.Initialize(path, mode); if (hr == HRESULT.E_NOTIMPL) return false; - if ((int)hr < 0) - throw new COMException("IInitializeWithFile.Initialize failed.", (int)hr); + if (hr < 0) + throw new COMException("IInitializeWithFile.Initialize failed.", hr); init = true; return true; } @@ -402,7 +424,7 @@ public bool ResetWindow() if (!init) return false; var hr = previewHandler.SetWindow(hwnd, new()); - return (int)hr >= 0; + return hr >= 0; } /// @@ -415,7 +437,7 @@ public bool ResetBounds(RECT previewerBounds) if (!init) return false; var hr = previewHandler.SetRect(previewerBounds); - return (int)hr >= 0; + return hr >= 0; } /// @@ -426,7 +448,7 @@ public bool ResetBounds(RECT previewerBounds) public bool SetBackground(Color color) { var hr = visuals?.SetBackgroundColor(ColorRefFromColor(color)); - return hr.HasValue && (int)hr.Value >= 0; + return hr.HasValue && hr.Value >= 0; } /// @@ -437,7 +459,7 @@ public bool SetBackground(Color color) public bool SetForeground(Color color) { var hr = visuals?.SetTextColor(ColorRefFromColor(color)); - return hr.HasValue && (int)hr.Value >= 0; + return hr.HasValue && hr.Value >= 0; } /// @@ -445,10 +467,10 @@ public bool SetForeground(Color color) /// /// The LogFontW reference. /// Whether the call succeeds. - public bool SetFont(ref LOGFONT font) + public bool SetFont(nint font) { - var hr = visuals?.SetFont(ref font); - return hr.HasValue && (int)hr.Value >= 0; + var hr = visuals?.SetFont(font); + return hr.HasValue && hr.Value >= 0; } /// @@ -462,7 +484,7 @@ public void DoPreview() return; EnsureNotShown(); ResetWindow(); - previewHandler.DoPreview(); + previewHandler?.DoPreview(); shown = true; } @@ -476,35 +498,27 @@ public void Focus() if (!init) return; EnsureShown(); - previewHandler.SetFocus(); + previewHandler?.SetFocus(); } /// /// Tells the preview handler to query focus. /// /// The focused window. - public IntPtr QueryFocus() + public nint QueryFocus() { EnsureNotDisposed(); //EnsureInitialized(); if (!init) return IntPtr.Zero; EnsureShown(); - IntPtr result; + nint result; var hr = previewHandler.QueryFocus(out result); - if ((int)hr < 0) + if (hr < 0) return IntPtr.Zero; return result; } - /// - /// Unloads the preview and disposes the object. This method is idempotent. - /// - public void UnloadPreview() - { - Dispose(true); - } - void EnsureNotDisposed() { if (disposed) @@ -537,44 +551,25 @@ void EnsureNotShown() #region IDisposable pattern - void Dispose(bool disposing) + ~PreviewHandler() + { + Dispose(); + } + + public void Dispose() { if (disposed) return; disposed = true; init = false; - if (disposing) - { - previewHandler.Unload(); - comSite.Dispose(); - Marshal.ReleaseComObject(previewHandler); - } - else - { - // We're in the finalizer. - // Field previewHandler might have been finalized at this point. - // Get a new RCW. - var phObject = Marshal.GetUniqueObjectForIUnknown(pPreviewHandler); - var ph = phObject as IPreviewHandler; - if (ph != null) - ph.Unload(); - Marshal.ReleaseComObject(phObject); - } - Marshal.Release(pPreviewHandler); - } - ~PreviewHandler() - { - Dispose(false); - } + previewHandler?.Unload(); + comSite?.Dispose(); - void IDisposable.Dispose() - { - Dispose(true); GC.SuppressFinalize(this); } #endregion } -} +} \ No newline at end of file diff --git a/src/Files.App/Utils/Shell/ShellFileOperations2.cs b/src/Files.App/Utils/Shell/ShellFileOperations2.cs index ab1f4c7c0498..daf610d95fc9 100644 --- a/src/Files.App/Utils/Shell/ShellFileOperations2.cs +++ b/src/Files.App/Utils/Shell/ShellFileOperations2.cs @@ -8,7 +8,7 @@ namespace Vanara.Windows.Shell; /// Queued and static file operations using the Shell. /// /// https://github.com/dahall/Vanara/blob/master/Windows.Shell.Common/ShellFileOperations/ShellFileOperations.cs -public class ShellFileOperations2 : IDisposable +public partial class ShellFileOperations2 : IDisposable { private const OperationFlags defaultOptions = OperationFlags.AllowUndo | OperationFlags.NoConfirmMkDir; private int disposedValue = 0; diff --git a/src/Files.App/Utils/Shell/ShellLibraryEx.cs b/src/Files.App/Utils/Shell/ShellLibraryEx.cs index 1f780425d358..0ef9ed8872f3 100644 --- a/src/Files.App/Utils/Shell/ShellLibraryEx.cs +++ b/src/Files.App/Utils/Shell/ShellLibraryEx.cs @@ -11,7 +11,7 @@ namespace Files.App.Utils.Shell /// /// Represents an encapsulated item for shell library. /// - public sealed class ShellLibraryEx : ShellFolder + public sealed partial class ShellLibraryEx : ShellFolder { //private const string ext = ".library-ms"; diff --git a/src/Files.App/Utils/Shell/ShellLibraryFolders.cs b/src/Files.App/Utils/Shell/ShellLibraryFolders.cs index 9465bf35c2ed..a4499c245c98 100644 --- a/src/Files.App/Utils/Shell/ShellLibraryFolders.cs +++ b/src/Files.App/Utils/Shell/ShellLibraryFolders.cs @@ -11,7 +11,7 @@ namespace Files.App.Utils.Shell /// /// /// - public sealed class ShellLibraryFolders : ShellItemArray, ICollection + public sealed partial class ShellLibraryFolders : ShellItemArray, ICollection { private Shell32.IShellLibrary _lib; diff --git a/src/Files.App/Utils/Shell/ThreadWithMessageQueue.cs b/src/Files.App/Utils/Shell/ThreadWithMessageQueue.cs index a62961f8a15d..755fb4c3229d 100644 --- a/src/Files.App/Utils/Shell/ThreadWithMessageQueue.cs +++ b/src/Files.App/Utils/Shell/ThreadWithMessageQueue.cs @@ -5,7 +5,7 @@ namespace Files.App.Utils.Shell { - public sealed class ThreadWithMessageQueue : Disposable + public sealed partial class ThreadWithMessageQueue : Disposable { private readonly BlockingCollection messageQueue; diff --git a/src/Files.App/Utils/StatusCenter/StatusCenterItem.cs b/src/Files.App/Utils/StatusCenter/StatusCenterItem.cs index e477cfaa52de..ac11edf8e8eb 100644 --- a/src/Files.App/Utils/StatusCenter/StatusCenterItem.cs +++ b/src/Files.App/Utils/StatusCenter/StatusCenterItem.cs @@ -12,7 +12,7 @@ namespace Files.App.Utils.StatusCenter ///
/// Handles all operation's functionality and UI. ///
- public sealed class StatusCenterItem : ObservableObject + public sealed partial class StatusCenterItem : ObservableObject { private readonly StatusCenterViewModel _viewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Utils/StatusCenter/StatusCenterItemProgressModel.cs b/src/Files.App/Utils/StatusCenter/StatusCenterItemProgressModel.cs index 92243f9210d1..e4ced2c56529 100644 --- a/src/Files.App/Utils/StatusCenter/StatusCenterItemProgressModel.cs +++ b/src/Files.App/Utils/StatusCenter/StatusCenterItemProgressModel.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.StatusCenter ///
/// Therefore, the storage operation classes can portably instance this class and update progress from everywhere with the same instance. /// - public sealed class StatusCenterItemProgressModel : INotifyPropertyChanged + public sealed partial class StatusCenterItemProgressModel : INotifyPropertyChanged { private readonly IProgress? _progress; diff --git a/src/Files.App/Utils/Storage/Collection/GroupedHeaderViewModel.cs b/src/Files.App/Utils/Storage/Collection/GroupedHeaderViewModel.cs index 302577b310d3..dff592522bef 100644 --- a/src/Files.App/Utils/Storage/Collection/GroupedHeaderViewModel.cs +++ b/src/Files.App/Utils/Storage/Collection/GroupedHeaderViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.Utils.Storage { - public sealed class GroupedHeaderViewModel : ObservableObject + public sealed partial class GroupedHeaderViewModel : ObservableObject { public string Key { get; set; } public bool Initialized { get; set; } diff --git a/src/Files.App/Utils/Storage/History/StorageHistoryHelpers.cs b/src/Files.App/Utils/Storage/History/StorageHistoryHelpers.cs index a06ffd648a81..c798d35af4bc 100644 --- a/src/Files.App/Utils/Storage/History/StorageHistoryHelpers.cs +++ b/src/Files.App/Utils/Storage/History/StorageHistoryHelpers.cs @@ -3,7 +3,7 @@ namespace Files.App.Utils.Storage { - public sealed class StorageHistoryHelpers : IDisposable + public sealed partial class StorageHistoryHelpers : IDisposable { private IStorageHistoryOperations operations; diff --git a/src/Files.App/Utils/Storage/History/StorageHistoryOperations.cs b/src/Files.App/Utils/Storage/History/StorageHistoryOperations.cs index e1ea23849b19..76a07c913a95 100644 --- a/src/Files.App/Utils/Storage/History/StorageHistoryOperations.cs +++ b/src/Files.App/Utils/Storage/History/StorageHistoryOperations.cs @@ -6,7 +6,7 @@ namespace Files.App.Utils.Storage { - public sealed class StorageHistoryOperations : IStorageHistoryOperations + public sealed partial class StorageHistoryOperations : IStorageHistoryOperations { private IFilesystemHelpers helpers; private ShellFilesystemOperations operations; diff --git a/src/Files.App/Utils/Storage/History/StorageHistoryWrapper.cs b/src/Files.App/Utils/Storage/History/StorageHistoryWrapper.cs index c5d6c07104d1..d9d8839aa5a6 100644 --- a/src/Files.App/Utils/Storage/History/StorageHistoryWrapper.cs +++ b/src/Files.App/Utils/Storage/History/StorageHistoryWrapper.cs @@ -3,7 +3,7 @@ namespace Files.App.Utils.Storage { - public sealed class StorageHistoryWrapper : IDisposable + public sealed partial class StorageHistoryWrapper : IDisposable { private int index = -1; diff --git a/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs b/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs index 1e1fcbb9535e..c037dbe2ae8c 100644 --- a/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs +++ b/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs @@ -16,7 +16,7 @@ namespace Files.App.Utils.Storage { - public sealed class FileOperationsHelpers + public sealed partial class FileOperationsHelpers { private static readonly Ole32.PROPERTYKEY PKEY_FilePlaceholderStatus = new Ole32.PROPERTYKEY(new Guid("B2F9B9D6-FEC4-4DD5-94D7-8957488C807B"), 2); private const uint PS_CLOUDFILE_PLACEHOLDER = 8; @@ -128,7 +128,7 @@ public static Task SetClipboard(string[] filesToCopy, DataPackageOperation opera { using var shi = new ShellItem(fileToDeletePath[i]); using var file = SafetyExtensions.IgnoreExceptions(() => GetFirstFile(shi)) ?? shi; - if ((uint?)file.Properties.GetValueOrDefault(PKEY_FilePlaceholderStatus) == PS_CLOUDFILE_PLACEHOLDER) + if (file.Properties.TryGetValue(PKEY_FilePlaceholderStatus, out var value) && value == PS_CLOUDFILE_PLACEHOLDER) { // Online only files cannot be tried for deletion, so they are treated as to be permanently deleted. shellOperationResult.Items.Add(new ShellOperationItemResult() @@ -962,7 +962,7 @@ private static void UpdateFileTagsDb(ShellFileOperations2.ShellFileOpEventArgs e public static void WaitForCompletion() => progressHandler?.WaitForCompletion(); - private sealed class ProgressHandler : Disposable + private sealed partial class ProgressHandler : Disposable { private readonly ManualResetEvent operationsCompletedEvent; diff --git a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs index 099d3c95faf5..92a801223e79 100644 --- a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs +++ b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs @@ -8,6 +8,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; +using Vanara.Extensions; using Vanara.PInvoke; using Vanara.Windows.Shell; using Windows.ApplicationModel.DataTransfer; @@ -18,7 +19,7 @@ namespace Files.App.Utils.Storage { - public sealed class FilesystemHelpers : IFilesystemHelpers + public sealed partial class FilesystemHelpers : IFilesystemHelpers { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); private readonly static StatusCenterViewModel _statusCenterViewModel = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Utils/Storage/Operations/FilesystemOperations.cs b/src/Files.App/Utils/Storage/Operations/FilesystemOperations.cs index 96e52ef0604e..a1774b3a8689 100644 --- a/src/Files.App/Utils/Storage/Operations/FilesystemOperations.cs +++ b/src/Files.App/Utils/Storage/Operations/FilesystemOperations.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Storage /// /// Provides group of file system operation for given page instance. /// - public sealed class FilesystemOperations : IFilesystemOperations + public sealed partial class FilesystemOperations : IFilesystemOperations { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Utils/Storage/Operations/ShellFilesystemOperations.cs b/src/Files.App/Utils/Storage/Operations/ShellFilesystemOperations.cs index 64932532c298..17980a4723f1 100644 --- a/src/Files.App/Utils/Storage/Operations/ShellFilesystemOperations.cs +++ b/src/Files.App/Utils/Storage/Operations/ShellFilesystemOperations.cs @@ -9,7 +9,7 @@ namespace Files.App.Utils.Storage /// /// Provides group of shell file system operation for given page instance. /// - public sealed class ShellFilesystemOperations : IFilesystemOperations + public sealed partial class ShellFilesystemOperations : IFilesystemOperations { private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicProperties.cs b/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicProperties.cs index 137629345967..8efb09a5441b 100644 --- a/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicProperties.cs +++ b/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicProperties.cs @@ -3,7 +3,7 @@ namespace Files.App.Utils.Storage { - public class BaseBasicProperties : BaseStorageItemExtraProperties + public partial class BaseBasicProperties : BaseStorageItemExtraProperties { public virtual ulong Size => 0; diff --git a/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicStorageItemExtraProperties.cs b/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicStorageItemExtraProperties.cs index 049908ac1085..03134b3f8125 100644 --- a/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicStorageItemExtraProperties.cs +++ b/src/Files.App/Utils/Storage/StorageBaseItems/BaseBasicStorageItemExtraProperties.cs @@ -7,7 +7,7 @@ namespace Files.App.Utils.Storage { - public sealed class BaseBasicStorageItemExtraProperties : BaseStorageItemExtraProperties + public sealed partial class BaseBasicStorageItemExtraProperties : BaseStorageItemExtraProperties { private readonly IStorageItem _item; diff --git a/src/Files.App/Utils/Storage/StorageBaseItems/BaseStorageItemExtraProperties.cs b/src/Files.App/Utils/Storage/StorageBaseItems/BaseStorageItemExtraProperties.cs index c307f4f2dde9..1c2f532e3498 100644 --- a/src/Files.App/Utils/Storage/StorageBaseItems/BaseStorageItemExtraProperties.cs +++ b/src/Files.App/Utils/Storage/StorageBaseItems/BaseStorageItemExtraProperties.cs @@ -8,7 +8,7 @@ namespace Files.App.Utils.Storage { - public class BaseStorageItemExtraProperties : IStorageItemExtraProperties + public partial class BaseStorageItemExtraProperties : IStorageItemExtraProperties { public virtual IAsyncOperation> RetrievePropertiesAsync(IEnumerable propertiesToRetrieve) { diff --git a/src/Files.App/Utils/Storage/StorageBaseItems/IPasswordProtectedItem.cs b/src/Files.App/Utils/Storage/StorageBaseItems/IPasswordProtectedItem.cs index 2d333e1b0389..318c41787a16 100644 --- a/src/Files.App/Utils/Storage/StorageBaseItems/IPasswordProtectedItem.cs +++ b/src/Files.App/Utils/Storage/StorageBaseItems/IPasswordProtectedItem.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using FluentFTP; +using FluentFTP.Exceptions; using SevenZip; using System; using Windows.Storage; diff --git a/src/Files.App/Utils/Storage/StorageItems/FtpStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/FtpStorageFile.cs index 878d0279520f..e0654cecdef6 100644 --- a/src/Files.App/Utils/Storage/StorageItems/FtpStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/FtpStorageFile.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Storage { - public sealed class FtpStorageFile : BaseStorageFile, IPasswordProtectedItem + public sealed partial class FtpStorageFile : BaseStorageFile, IPasswordProtectedItem { public override string Path { get; } public override string Name { get; } @@ -292,7 +292,7 @@ private async void FtpDataStreamingHandlerAsync(StreamedFileDataRequest request) } } - private sealed class FtpFileBasicProperties : BaseBasicProperties + private sealed partial class FtpFileBasicProperties : BaseBasicProperties { public override ulong Size { get; } diff --git a/src/Files.App/Utils/Storage/StorageItems/FtpStorageFolder.cs b/src/Files.App/Utils/Storage/StorageItems/FtpStorageFolder.cs index cc669111f6db..a9b0ee4a60b7 100644 --- a/src/Files.App/Utils/Storage/StorageItems/FtpStorageFolder.cs +++ b/src/Files.App/Utils/Storage/StorageItems/FtpStorageFolder.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Storage { - public sealed class FtpStorageFolder : BaseStorageFolder, IPasswordProtectedItem + public sealed partial class FtpStorageFolder : BaseStorageFolder, IPasswordProtectedItem { public override string Path { get; } public override string Name { get; } @@ -362,7 +362,7 @@ private AsyncFtpClient GetFtpClient() return new(host, credentials, port); } - private sealed class FtpFolderBasicProperties : BaseBasicProperties + private sealed partial class FtpFolderBasicProperties : BaseBasicProperties { public override ulong Size { get; } diff --git a/src/Files.App/Utils/Storage/StorageItems/NativeStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/NativeStorageFile.cs index 60d9c4838455..a6b51aba9a8c 100644 --- a/src/Files.App/Utils/Storage/StorageItems/NativeStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/NativeStorageFile.cs @@ -18,7 +18,7 @@ namespace Files.App.Utils.Storage /// Shortcuts and alternate data stream. /// Uses *FromApp methods for file operations ///
- public sealed class NativeStorageFile : BaseStorageFile + public sealed partial class NativeStorageFile : BaseStorageFile { public override string Path { get; } public override string Name { get; } diff --git a/src/Files.App/Utils/Storage/StorageItems/ShellStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/ShellStorageFile.cs index d4021188a9d3..395f8ab72b36 100644 --- a/src/Files.App/Utils/Storage/StorageItems/ShellStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/ShellStorageFile.cs @@ -12,7 +12,7 @@ namespace Files.App.Utils.Storage { - public sealed class ShortcutStorageFile : ShellStorageFile, IShortcutStorageItem + public sealed partial class ShortcutStorageFile : ShellStorageFile, IShortcutStorageItem { public string TargetPath { get; } public string Arguments { get; } @@ -30,7 +30,7 @@ public ShortcutStorageFile(ShellLinkItem item) : base(item) } } - public sealed class BinStorageFile : ShellStorageFile, IBinStorageItem + public sealed partial class BinStorageFile : ShellStorageFile, IBinStorageItem { public string OriginalPath { get; } public DateTimeOffset DateDeleted { get; } @@ -42,7 +42,7 @@ public BinStorageFile(ShellFileItem item) : base(item) } } - public class ShellStorageFile : BaseStorageFile + public partial class ShellStorageFile : BaseStorageFile { public override string Path { get; } public override string Name { get; } @@ -178,7 +178,7 @@ private Task GetBasicProperties() return Task.FromResult(new BaseBasicProperties()); } - private sealed class ShellFileBasicProperties : BaseBasicProperties + private sealed partial class ShellFileBasicProperties : BaseBasicProperties { private readonly ShellFileItem file; diff --git a/src/Files.App/Utils/Storage/StorageItems/ShellStorageFolder.cs b/src/Files.App/Utils/Storage/StorageItems/ShellStorageFolder.cs index 5186088bc616..4189cdac8474 100644 --- a/src/Files.App/Utils/Storage/StorageItems/ShellStorageFolder.cs +++ b/src/Files.App/Utils/Storage/StorageItems/ShellStorageFolder.cs @@ -10,7 +10,7 @@ namespace Files.App.Utils.Storage { - public sealed class ShortcutStorageFolder : ShellStorageFolder, IShortcutStorageItem + public sealed partial class ShortcutStorageFolder : ShellStorageFolder, IShortcutStorageItem { public string TargetPath { get; } public string Arguments { get; } @@ -36,7 +36,7 @@ public interface IShortcutStorageItem : IStorageItem bool RunAsAdmin { get; } } - public sealed class BinStorageFolder : ShellStorageFolder, IBinStorageItem + public sealed partial class BinStorageFolder : ShellStorageFolder, IBinStorageItem { public string OriginalPath { get; } public DateTimeOffset DateDeleted { get; } @@ -54,7 +54,7 @@ public interface IBinStorageItem : IStorageItem DateTimeOffset DateDeleted { get; } } - public class ShellStorageFolder : BaseStorageFolder + public partial class ShellStorageFolder : BaseStorageFolder { public override string Path { get; } public override string Name { get; } @@ -295,7 +295,7 @@ public override IAsyncOperation GetThumbnailAsync(Thumbnai }); } - private sealed class ShellFolderBasicProperties : BaseBasicProperties + private sealed partial class ShellFolderBasicProperties : BaseBasicProperties { private readonly ShellFileItem folder; diff --git a/src/Files.App/Utils/Storage/StorageItems/StreamWithContentType.cs b/src/Files.App/Utils/Storage/StorageItems/StreamWithContentType.cs index e5f8546a5f9f..65a412840e63 100644 --- a/src/Files.App/Utils/Storage/StorageItems/StreamWithContentType.cs +++ b/src/Files.App/Utils/Storage/StorageItems/StreamWithContentType.cs @@ -10,7 +10,7 @@ namespace Files.App.Utils.Storage { - public sealed class InputStreamWithDisposeCallback : IInputStream + public sealed partial class InputStreamWithDisposeCallback : IInputStream { private Stream stream; private IInputStream iStream; @@ -35,7 +35,7 @@ public void Dispose() } } - public sealed class NonSeekableRandomAccessStreamForWrite : IRandomAccessStream + public sealed partial class NonSeekableRandomAccessStreamForWrite : IRandomAccessStream { private Stream stream; private IOutputStream oStream; @@ -131,7 +131,7 @@ public void Dispose() } } - public sealed class NonSeekableRandomAccessStreamForRead : IRandomAccessStream + public sealed partial class NonSeekableRandomAccessStreamForRead : IRandomAccessStream { private Stream stream; private IRandomAccessStream imrac; @@ -227,7 +227,7 @@ public void Dispose() } } - public sealed class StreamWithContentType : IRandomAccessStreamWithContentType + public sealed partial class StreamWithContentType : IRandomAccessStreamWithContentType { private IRandomAccessStream baseStream; @@ -269,7 +269,7 @@ public void Dispose() public string ContentType { get; set; } = "application/octet-stream"; } - public sealed class ComStreamWrapper : Stream + public sealed partial class ComStreamWrapper : Stream { private IStream iStream; private STATSTG iStreamStat; diff --git a/src/Files.App/Utils/Storage/StorageItems/SystemStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/SystemStorageFile.cs index 999b511f661f..744e055f34cd 100644 --- a/src/Files.App/Utils/Storage/StorageItems/SystemStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/SystemStorageFile.cs @@ -12,7 +12,7 @@ namespace Files.App.Utils.Storage { - public sealed class SystemStorageFile : BaseStorageFile + public sealed partial class SystemStorageFile : BaseStorageFile { public StorageFile File { get; } @@ -173,7 +173,7 @@ public override IAsyncOperation GetThumbnailAsync(Thumbnai public override IAsyncOperation GetThumbnailAsync(ThumbnailMode mode, uint requestedSize, ThumbnailOptions options) => File.GetThumbnailAsync(mode, requestedSize, options); - private sealed class SystemFileBasicProperties : BaseBasicProperties + private sealed partial class SystemFileBasicProperties : BaseBasicProperties { private readonly IStorageItemExtraProperties basicProps; private readonly DateTimeOffset? dateCreated; diff --git a/src/Files.App/Utils/Storage/StorageItems/SystemStorageFolder.cs b/src/Files.App/Utils/Storage/StorageItems/SystemStorageFolder.cs index 07289ffab3f8..9d7e6f2fa194 100644 --- a/src/Files.App/Utils/Storage/StorageItems/SystemStorageFolder.cs +++ b/src/Files.App/Utils/Storage/StorageItems/SystemStorageFolder.cs @@ -12,7 +12,7 @@ namespace Files.App.Utils.Storage { - public sealed class SystemStorageFolder : BaseStorageFolder + public sealed partial class SystemStorageFolder : BaseStorageFolder { public StorageFolder Folder { get; } @@ -151,7 +151,7 @@ public override IAsyncOperation GetThumbnailAsync(Thumbnai public override IAsyncOperation GetThumbnailAsync(ThumbnailMode mode, uint requestedSize, ThumbnailOptions options) => Folder.GetThumbnailAsync(mode, requestedSize, options); - private sealed class SystemFolderBasicProperties : BaseBasicProperties + private sealed partial class SystemFolderBasicProperties : BaseBasicProperties { private readonly IStorageItemExtraProperties basicProps; private readonly DateTimeOffset? dateCreated; diff --git a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFile.cs index 7e07d833d286..4e6c4c12caa9 100644 --- a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFile.cs @@ -11,7 +11,7 @@ namespace Files.App.Utils.Storage { - public sealed class VirtualStorageFile : BaseStorageFile + public sealed partial class VirtualStorageFile : BaseStorageFile { public override string Path { get; } public override string Name { get; } diff --git a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFolder.cs b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFolder.cs index 08905cf9489e..db7e48ab7971 100644 --- a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFolder.cs +++ b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageFolder.cs @@ -9,7 +9,7 @@ namespace Files.App.Utils.Storage { - public sealed class VirtualStorageFolder : BaseStorageFolder + public sealed partial class VirtualStorageFolder : BaseStorageFolder { public override string Path { get; } public override string Name { get; } diff --git a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageItem.cs b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageItem.cs index bf6bc13687c0..3f0aee8f4fee 100644 --- a/src/Files.App/Utils/Storage/StorageItems/VirtualStorageItem.cs +++ b/src/Files.App/Utils/Storage/StorageItems/VirtualStorageItem.cs @@ -15,7 +15,7 @@ namespace Files.App.Utils.Storage /// representing a standard filesystem item. As such, VirtualStorageItem does not support hidden, /// shortcut, or link items. ///
- public sealed class VirtualStorageItem : IStorageItem + public sealed partial class VirtualStorageItem : IStorageItem { private static BasicProperties props; diff --git a/src/Files.App/Utils/Storage/StorageItems/ZipStorageFile.cs b/src/Files.App/Utils/Storage/StorageItems/ZipStorageFile.cs index 9287a224541f..5081a45cb421 100644 --- a/src/Files.App/Utils/Storage/StorageItems/ZipStorageFile.cs +++ b/src/Files.App/Utils/Storage/StorageItems/ZipStorageFile.cs @@ -14,7 +14,7 @@ namespace Files.App.Utils.Storage { - public sealed class ZipStorageFile : BaseStorageFile, IPasswordProtectedItem + public sealed partial class ZipStorageFile : BaseStorageFile, IPasswordProtectedItem { private readonly string containerPath; private readonly BaseStorageFile backingFile; @@ -520,7 +520,7 @@ private StreamedFileDataRequestedHandler ZipDataStreamingHandler(string name) }; } - private sealed class ZipFileBasicProperties : BaseBasicProperties + private sealed partial class ZipFileBasicProperties : BaseBasicProperties { private ArchiveFileInfo entry; diff --git a/src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs b/src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs index abf3e2714c73..7d9e6cd156ac 100644 --- a/src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs +++ b/src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs @@ -16,7 +16,7 @@ namespace Files.App.Utils.Storage { - public sealed class ZipStorageFolder : BaseStorageFolder, ICreateFileWithStream, IPasswordProtectedItem + public sealed partial class ZipStorageFolder : BaseStorageFolder, ICreateFileWithStream, IPasswordProtectedItem { private readonly string containerPath; private BaseStorageFile backingFile; @@ -646,7 +646,7 @@ public IAsyncOperation CreateFileAsync(Stream contents, string }, ((IPasswordProtectedItem)this).RetryWithCredentialsAsync)); } - private sealed class ZipFolderBasicProperties : BaseBasicProperties + private sealed partial class ZipFolderBasicProperties : BaseBasicProperties { private ArchiveFileInfo entry; diff --git a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs index 0fabb7d6c80d..3604a7d43000 100644 --- a/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs +++ b/src/Files.App/Utils/Taskbar/SystemTrayIcon.cs @@ -16,7 +16,7 @@ namespace Files.App.Utils.Taskbar /// /// Represents a tray icon of Notification Area so-called System Tray. /// - public sealed class SystemTrayIcon : IDisposable + public sealed partial class SystemTrayIcon : IDisposable { // Constants diff --git a/src/Files.App/Utils/Taskbar/SystemTrayIconWindow.cs b/src/Files.App/Utils/Taskbar/SystemTrayIconWindow.cs index 4f754dec84f1..532ed33baf5f 100644 --- a/src/Files.App/Utils/Taskbar/SystemTrayIconWindow.cs +++ b/src/Files.App/Utils/Taskbar/SystemTrayIconWindow.cs @@ -13,7 +13,7 @@ namespace Files.App.Utils.Taskbar ///
/// This is provided to handle context menu and retrieve mouse events, not a regular window class. ///
- public sealed class SystemTrayIconWindow : IDisposable + public sealed partial class SystemTrayIconWindow : IDisposable { private SystemTrayIcon _trayIcon; diff --git a/src/Files.App/ViewModels/Dialogs/AddBranchDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/AddBranchDialogViewModel.cs index 722a931b6a5c..d869959bf843 100644 --- a/src/Files.App/ViewModels/Dialogs/AddBranchDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/AddBranchDialogViewModel.cs @@ -1,6 +1,6 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class AddBranchDialogViewModel : ObservableObject + public sealed partial class AddBranchDialogViewModel : ObservableObject { private readonly string _repositoryPath; diff --git a/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogListItemViewModel.cs b/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogListItemViewModel.cs index c743d25ea300..53c047dd518c 100644 --- a/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogListItemViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogListItemViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Dialogs.AddItemDialog { - public sealed class AddItemDialogListItemViewModel : ObservableObject + public sealed partial class AddItemDialogListItemViewModel : ObservableObject { public string? Header { get; set; } diff --git a/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogViewModel.cs index cf28b1cde340..f30b2ab05a84 100644 --- a/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/AddItemDialog/AddItemDialogViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.ViewModels.Dialogs.AddItemDialog { - public sealed class AddItemDialogViewModel : ObservableObject + public sealed partial class AddItemDialogViewModel : ObservableObject { private readonly IImageService _imagingService; diff --git a/src/Files.App/ViewModels/Dialogs/BulkRenameDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/BulkRenameDialogViewModel.cs index 5e90d3a9f9b8..ca72363a51fb 100644 --- a/src/Files.App/ViewModels/Dialogs/BulkRenameDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/BulkRenameDialogViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class BulkRenameDialogViewModel : ObservableObject + public sealed partial class BulkRenameDialogViewModel : ObservableObject { private IContentPageContext context { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Dialogs/CreateItemDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/CreateItemDialogViewModel.cs index 7b77502ef305..329a7b3037ed 100644 --- a/src/Files.App/ViewModels/Dialogs/CreateItemDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/CreateItemDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - class CreateItemDialogViewModel : ObservableObject + partial class CreateItemDialogViewModel : ObservableObject { private bool isNameInvalid; public bool IsNameInvalid diff --git a/src/Files.App/ViewModels/Dialogs/CreateShortcutDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/CreateShortcutDialogViewModel.cs index a29a54f122fe..0bec2b9be957 100644 --- a/src/Files.App/ViewModels/Dialogs/CreateShortcutDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/CreateShortcutDialogViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class CreateShortcutDialogViewModel : ObservableObject + public sealed partial class CreateShortcutDialogViewModel : ObservableObject { // User's working directory public readonly string WorkingDirectory; diff --git a/src/Files.App/ViewModels/Dialogs/CredentialDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/CredentialDialogViewModel.cs index 18de0d4d506a..4613bcd1d746 100644 --- a/src/Files.App/ViewModels/Dialogs/CredentialDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/CredentialDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class CredentialDialogViewModel : ObservableObject + public sealed partial class CredentialDialogViewModel : ObservableObject { private string? _UserName; public string? UserName diff --git a/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs index 2ac1e5ed7582..6f3151f323de 100644 --- a/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class DecompressArchiveDialogViewModel : ObservableObject + public sealed partial class DecompressArchiveDialogViewModel : ObservableObject { private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Dialogs/DynamicDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/DynamicDialogViewModel.cs index 447966c94f84..be18888b0f82 100644 --- a/src/Files.App/ViewModels/Dialogs/DynamicDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/DynamicDialogViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class DynamicDialogViewModel : ObservableObject, IDisposable + public sealed partial class DynamicDialogViewModel : ObservableObject, IDisposable { #region Public Properties diff --git a/src/Files.App/ViewModels/Dialogs/ElevateConfirmDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/ElevateConfirmDialogViewModel.cs index 0f2d3f126d6a..17813724a57c 100644 --- a/src/Files.App/ViewModels/Dialogs/ElevateConfirmDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/ElevateConfirmDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class ElevateConfirmDialogViewModel : ObservableObject + public sealed partial class ElevateConfirmDialogViewModel : ObservableObject { } } diff --git a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs index b56396ff7a3d..64fc9e6ba313 100644 --- a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogConflictItemViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.ViewModels.Dialogs.FileSystemDialog { - public sealed class FileSystemDialogConflictItemViewModel : BaseFileSystemDialogItemViewModel, IFileSystemDialogConflictItemViewModel + public sealed partial class FileSystemDialogConflictItemViewModel : BaseFileSystemDialogItemViewModel, IFileSystemDialogConflictItemViewModel { private string? _DestinationDisplayName; public string? DestinationDisplayName diff --git a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogDefaultItemViewModel.cs b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogDefaultItemViewModel.cs index ddf95c8a1423..1efe03ae0318 100644 --- a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogDefaultItemViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogDefaultItemViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs.FileSystemDialog { - public sealed class FileSystemDialogDefaultItemViewModel : BaseFileSystemDialogItemViewModel + public sealed partial class FileSystemDialogDefaultItemViewModel : BaseFileSystemDialogItemViewModel { } } diff --git a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs index 5aec92296c38..2ea9bf4f20d9 100644 --- a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Dialogs.FileSystemDialog { - public sealed class FileSystemDialogViewModel : BaseDialogViewModel, IRecipient + public sealed partial class FileSystemDialogViewModel : BaseDialogViewModel, IRecipient { private readonly IUserSettingsService _userSettingsService; diff --git a/src/Files.App/ViewModels/Dialogs/FileTooLargeDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/FileTooLargeDialogViewModel.cs index 41bcd6b54d03..a0ff9419bb9f 100644 --- a/src/Files.App/ViewModels/Dialogs/FileTooLargeDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/FileTooLargeDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class FileTooLargeDialogViewModel: ObservableObject + public sealed partial class FileTooLargeDialogViewModel: ObservableObject { public IEnumerable Paths { get; private set; } diff --git a/src/Files.App/ViewModels/Dialogs/GitHubLoginDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/GitHubLoginDialogViewModel.cs index 83d5ceae80c5..ecf7619296e2 100644 --- a/src/Files.App/ViewModels/Dialogs/GitHubLoginDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/GitHubLoginDialogViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class GitHubLoginDialogViewModel : ObservableObject + public sealed partial class GitHubLoginDialogViewModel : ObservableObject { private const string URL = "https://github.com/login/device"; diff --git a/src/Files.App/ViewModels/Dialogs/ReleaseNotesDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/ReleaseNotesDialogViewModel.cs index 558565dbfef2..645968eeedfb 100644 --- a/src/Files.App/ViewModels/Dialogs/ReleaseNotesDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/ReleaseNotesDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class ReleaseNotesDialogViewModel : ObservableObject + public sealed partial class ReleaseNotesDialogViewModel : ObservableObject { private string _BlogPostUrl = string.Empty; public string BlogPostUrl diff --git a/src/Files.App/ViewModels/Dialogs/ReorderSidebarItemsDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/ReorderSidebarItemsDialogViewModel.cs index 5c453952def9..1c9de997c62e 100644 --- a/src/Files.App/ViewModels/Dialogs/ReorderSidebarItemsDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/ReorderSidebarItemsDialogViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class ReorderSidebarItemsDialogViewModel : ObservableObject + public sealed partial class ReorderSidebarItemsDialogViewModel : ObservableObject { private readonly IQuickAccessService quickAccessService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Dialogs/SettingsDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/SettingsDialogViewModel.cs index 7b19a74ce856..ac9dc60a3b0c 100644 --- a/src/Files.App/ViewModels/Dialogs/SettingsDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/SettingsDialogViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Dialogs { - public sealed class SettingsDialogViewModel : ObservableObject + public sealed partial class SettingsDialogViewModel : ObservableObject { } } diff --git a/src/Files.App/ViewModels/HomeViewModel.cs b/src/Files.App/ViewModels/HomeViewModel.cs index fb56b6804fd5..ec470726798a 100644 --- a/src/Files.App/ViewModels/HomeViewModel.cs +++ b/src/Files.App/ViewModels/HomeViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.ViewModels { - public sealed class HomeViewModel : ObservableObject, IDisposable + public sealed partial class HomeViewModel : ObservableObject, IDisposable { // Dependency injections diff --git a/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs b/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs index 9e8c4e2472d2..b427cef768a1 100644 --- a/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs +++ b/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs @@ -17,7 +17,7 @@ namespace Files.App.ViewModels.Layouts /// /// Represents ViewModel for . /// - public sealed class BaseLayoutViewModel : IDisposable + public sealed partial class BaseLayoutViewModel : IDisposable { protected ICommandManager Commands { get; } = Ioc.Default.GetRequiredService(); private ILogger? Logger { get; } = Ioc.Default.GetRequiredService>(); diff --git a/src/Files.App/ViewModels/MainPageViewModel.cs b/src/Files.App/ViewModels/MainPageViewModel.cs index 90839027107d..64b51d54f6a7 100644 --- a/src/Files.App/ViewModels/MainPageViewModel.cs +++ b/src/Files.App/ViewModels/MainPageViewModel.cs @@ -15,7 +15,7 @@ namespace Files.App.ViewModels /// /// Represents ViewModel of . /// - public sealed class MainPageViewModel : ObservableObject + public sealed partial class MainPageViewModel : ObservableObject { // Dependency injections diff --git a/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs index bb23f0c67ced..a08ba34fee83 100644 --- a/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs +++ b/src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.ViewModels.Properties /// /// Represents view model of . /// - public sealed class CompatibilityViewModel : ObservableObject + public sealed partial class CompatibilityViewModel : ObservableObject { // Dependency injections diff --git a/src/Files.App/ViewModels/Properties/CustomizationViewModel.cs b/src/Files.App/ViewModels/Properties/CustomizationViewModel.cs index 303fa025a00b..55d926c25698 100644 --- a/src/Files.App/ViewModels/Properties/CustomizationViewModel.cs +++ b/src/Files.App/ViewModels/Properties/CustomizationViewModel.cs @@ -4,7 +4,7 @@ namespace Files.App.ViewModels.Properties { - public sealed class CustomizationViewModel : ObservableObject + public sealed partial class CustomizationViewModel : ObservableObject { private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Properties/HashesViewModel.cs b/src/Files.App/ViewModels/Properties/HashesViewModel.cs index 9763f381d8f2..7bd2df6c4303 100644 --- a/src/Files.App/ViewModels/Properties/HashesViewModel.cs +++ b/src/Files.App/ViewModels/Properties/HashesViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Properties { - public sealed class HashesViewModel : ObservableObject, IDisposable + public sealed partial class HashesViewModel : ObservableObject, IDisposable { private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetService()!; diff --git a/src/Files.App/ViewModels/Properties/Items/FileProperty.cs b/src/Files.App/ViewModels/Properties/Items/FileProperty.cs index f86cf24530ae..196fd06e3738 100644 --- a/src/Files.App/ViewModels/Properties/Items/FileProperty.cs +++ b/src/Files.App/ViewModels/Properties/Items/FileProperty.cs @@ -12,7 +12,7 @@ namespace Files.App.ViewModels.Properties /// /// This class is represents a system file property from the Windows.Storage API /// - public sealed class FileProperty : ObservableObject + public sealed partial class FileProperty : ObservableObject { /// /// The name to display diff --git a/src/Files.App/ViewModels/Properties/Items/FilePropertySection.cs b/src/Files.App/ViewModels/Properties/Items/FilePropertySection.cs index eee8bb2d1d62..a8333dc130cb 100644 --- a/src/Files.App/ViewModels/Properties/Items/FilePropertySection.cs +++ b/src/Files.App/ViewModels/Properties/Items/FilePropertySection.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Properties /// /// This class is used for grouping file properties into sections so that it can be used as a grouped ListView data source /// - public sealed class FilePropertySection : List + public sealed partial class FilePropertySection : List { public FilePropertySection(IEnumerable items) : base(items) diff --git a/src/Files.App/ViewModels/Properties/MainPropertiesViewModel.cs b/src/Files.App/ViewModels/Properties/MainPropertiesViewModel.cs index 78acfa741da5..14a7922e0115 100644 --- a/src/Files.App/ViewModels/Properties/MainPropertiesViewModel.cs +++ b/src/Files.App/ViewModels/Properties/MainPropertiesViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.ViewModels.Properties { - public sealed class MainPropertiesViewModel : ObservableObject + public sealed partial class MainPropertiesViewModel : ObservableObject { public CancellationTokenSource ChangedPropertiesCancellationTokenSource { get; } diff --git a/src/Files.App/ViewModels/Properties/SecurityAdvancedViewModel.cs b/src/Files.App/ViewModels/Properties/SecurityAdvancedViewModel.cs index ead8f1b2cf98..c3562be015a2 100644 --- a/src/Files.App/ViewModels/Properties/SecurityAdvancedViewModel.cs +++ b/src/Files.App/ViewModels/Properties/SecurityAdvancedViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Properties { - public sealed class SecurityAdvancedViewModel : ObservableObject + public sealed partial class SecurityAdvancedViewModel : ObservableObject { private readonly IStorageSecurityService StorageSecurityService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Properties/SecurityViewModel.cs b/src/Files.App/ViewModels/Properties/SecurityViewModel.cs index de2cd1b9a076..a49a56135300 100644 --- a/src/Files.App/ViewModels/Properties/SecurityViewModel.cs +++ b/src/Files.App/ViewModels/Properties/SecurityViewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.ViewModels.Properties { - public sealed class SecurityViewModel : ObservableObject + public sealed partial class SecurityViewModel : ObservableObject { private readonly IStorageSecurityService StorageSecurityService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/AboutViewModel.cs b/src/Files.App/ViewModels/Settings/AboutViewModel.cs index 2677285f8352..3a43e2c43e97 100644 --- a/src/Files.App/ViewModels/Settings/AboutViewModel.cs +++ b/src/Files.App/ViewModels/Settings/AboutViewModel.cs @@ -1,8 +1,8 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.Helpers; using Microsoft.Win32; +using System.Runtime.InteropServices; using System.Windows.Input; using Windows.ApplicationModel; using Windows.ApplicationModel.DataTransfer; @@ -14,7 +14,7 @@ namespace Files.App.ViewModels.Settings /// /// Represents view model of . /// - public sealed class AboutViewModel : ObservableObject + public sealed partial class AboutViewModel : ObservableObject { // Dependency injections @@ -192,7 +192,7 @@ public string GetAppVersion() public string GetWindowsVersion() { - return SystemInformation.Instance.OperatingSystemVersion.ToString(); + return Environment.OSVersion.Version.ToString(); } public string GetUserID() diff --git a/src/Files.App/ViewModels/Settings/ActionsViewModel.cs b/src/Files.App/ViewModels/Settings/ActionsViewModel.cs index 9162f3a0d308..79ea48f92883 100644 --- a/src/Files.App/ViewModels/Settings/ActionsViewModel.cs +++ b/src/Files.App/ViewModels/Settings/ActionsViewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.ViewModels.Settings /// /// Represents view model of . /// - public sealed class ActionsViewModel : ObservableObject + public sealed partial class ActionsViewModel : ObservableObject { // Dependency injections diff --git a/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs b/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs index 759d5325578b..17cd5b02e1e2 100644 --- a/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs +++ b/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs @@ -15,7 +15,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class AdvancedViewModel : ObservableObject + public sealed partial class AdvancedViewModel : ObservableObject { private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/AppearanceViewModel.cs b/src/Files.App/ViewModels/Settings/AppearanceViewModel.cs index 27e893b58af5..f98d72b2ced3 100644 --- a/src/Files.App/ViewModels/Settings/AppearanceViewModel.cs +++ b/src/Files.App/ViewModels/Settings/AppearanceViewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class AppearanceViewModel : ObservableObject + public sealed partial class AppearanceViewModel : ObservableObject { private IAppThemeModeService AppThemeModeService { get; } = Ioc.Default.GetRequiredService(); private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); @@ -181,11 +181,11 @@ public string AppThemeBackgroundColor // Apply the updated background resource try { - ResourcesService.SetAppThemeBackgroundColor(ColorHelper.ToColor(value).FromWindowsColor()); + ResourcesService.SetAppThemeBackgroundColor(value.ToColor()); } catch { - ResourcesService.SetAppThemeBackgroundColor(ColorHelper.ToColor("#00000000").FromWindowsColor()); + ResourcesService.SetAppThemeBackgroundColor("#00000000".ToColor()); } ResourcesService.ApplyResources(); diff --git a/src/Files.App/ViewModels/Settings/DevToolsViewModel.cs b/src/Files.App/ViewModels/Settings/DevToolsViewModel.cs index 6c09566ddae6..cc80c13b490d 100644 --- a/src/Files.App/ViewModels/Settings/DevToolsViewModel.cs +++ b/src/Files.App/ViewModels/Settings/DevToolsViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class DevToolsViewModel : ObservableObject + public sealed partial class DevToolsViewModel : ObservableObject { protected readonly IFileTagsSettingsService FileTagsSettingsService = Ioc.Default.GetRequiredService(); protected readonly IDevToolsSettingsService DevToolsSettingsService = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/FoldersViewModel.cs b/src/Files.App/ViewModels/Settings/FoldersViewModel.cs index 7f80228aff36..10a11f87e3a2 100644 --- a/src/Files.App/ViewModels/Settings/FoldersViewModel.cs +++ b/src/Files.App/ViewModels/Settings/FoldersViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class FoldersViewModel : ObservableObject + public sealed partial class FoldersViewModel : ObservableObject { private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs index 51c9157a4f20..a5b6a4621f48 100644 --- a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs +++ b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class GeneralViewModel : ObservableObject, IDisposable + public sealed partial class GeneralViewModel : ObservableObject, IDisposable { private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/LayoutViewModel.cs b/src/Files.App/ViewModels/Settings/LayoutViewModel.cs index b64910c51afb..f6f16bf0665c 100644 --- a/src/Files.App/ViewModels/Settings/LayoutViewModel.cs +++ b/src/Files.App/ViewModels/Settings/LayoutViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class LayoutViewModel : ObservableObject + public sealed partial class LayoutViewModel : ObservableObject { private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/Settings/TagsViewModel.cs b/src/Files.App/ViewModels/Settings/TagsViewModel.cs index b64ca69a6464..d650e9b6aef0 100644 --- a/src/Files.App/ViewModels/Settings/TagsViewModel.cs +++ b/src/Files.App/ViewModels/Settings/TagsViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Settings { - public sealed class TagsViewModel : ObservableObject + public sealed partial class TagsViewModel : ObservableObject { private readonly IFileTagsSettingsService fileTagsSettingsService = Ioc.Default.GetRequiredService(); @@ -102,7 +102,7 @@ public void DeleteExistingTag(ListedTagViewModel item) } } - public sealed class NewTagViewModel : ObservableObject + public sealed partial class NewTagViewModel : ObservableObject { private string name = string.Empty; public string Name diff --git a/src/Files.App/ViewModels/ShellViewModel.cs b/src/Files.App/ViewModels/ShellViewModel.cs index 3538ce53f269..a4d1565c34ac 100644 --- a/src/Files.App/ViewModels/ShellViewModel.cs +++ b/src/Files.App/ViewModels/ShellViewModel.cs @@ -29,7 +29,7 @@ namespace Files.App.ViewModels /// /// Represents view model of . /// - public sealed class ShellViewModel : ObservableObject, IDisposable + public sealed partial class ShellViewModel : ObservableObject, IDisposable { private readonly SemaphoreSlim enumFolderSemaphore; private readonly SemaphoreSlim getFileOrFolderSemaphore; @@ -1886,7 +1886,7 @@ await Task.Run(async () => private void CheckForSolutionFile() { SolutionFilePath = filesAndFolders.ToList().AsParallel() - .Where(item => FileExtensionHelpers.HasExtension(item.FileExtension, ".sln")) + .Where(item => FileExtensionHelpers.HasExtension(item.FileExtension, ".sln", ".slnx")) .FirstOrDefault()?.ItemPath; } diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index 74b1dcaea5ef..8fe3d5607d5d 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Files.Shared.Helpers; using Microsoft.UI.Dispatching; using Microsoft.UI.Xaml; @@ -16,7 +16,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class AddressToolbarViewModel : ObservableObject, IAddressToolbarViewModel, IDisposable + public sealed partial class AddressToolbarViewModel : ObservableObject, IAddressToolbarViewModel, IDisposable { private const int MAX_SUGGESTIONS = 10; diff --git a/src/Files.App/ViewModels/UserControls/InfoPaneViewModel.cs b/src/Files.App/ViewModels/UserControls/InfoPaneViewModel.cs index 8fe487d9f59c..77db75ff14fe 100644 --- a/src/Files.App/ViewModels/UserControls/InfoPaneViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/InfoPaneViewModel.cs @@ -11,7 +11,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class InfoPaneViewModel : ObservableObject, IDisposable + public sealed partial class InfoPaneViewModel : ObservableObject, IDisposable { private IInfoPaneSettingsService infoPaneSettingsService { get; } = Ioc.Default.GetRequiredService(); private IContentPageContext contentPageContext { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/UserControls/Previews/ArchivePreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/ArchivePreviewViewModel.cs index a998a75fe440..11973a69e260 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/ArchivePreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/ArchivePreviewViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class ArchivePreviewViewModel : BasePreviewModel + public sealed partial class ArchivePreviewViewModel : BasePreviewModel { public ArchivePreviewViewModel(ListedItem item) : base(item) diff --git a/src/Files.App/ViewModels/UserControls/Previews/BasePreviewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/BasePreviewModel.cs index 28f3a26cefd6..e8be3e2b0905 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/BasePreviewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/BasePreviewModel.cs @@ -8,7 +8,7 @@ namespace Files.App.ViewModels.Previews { - public abstract class BasePreviewModel : ObservableObject + public abstract partial class BasePreviewModel : ObservableObject { private readonly IUserSettingsService userSettingsService = Ioc.Default.GetRequiredService(); @@ -129,7 +129,7 @@ private async Task> GetSystemFilePropertiesAsync() return list.Where(i => i.ValueText is not null).ToList(); } - private sealed class DetailsOnlyPreviewModel : BasePreviewModel + private sealed partial class DetailsOnlyPreviewModel : BasePreviewModel { public DetailsOnlyPreviewModel(ListedItem item) : base(item) { } diff --git a/src/Files.App/ViewModels/UserControls/Previews/BasicPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/BasicPreviewViewModel.cs index 59797c79e78b..b7dcfb12f854 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/BasicPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/BasicPreviewViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class BasicPreviewViewModel : BasePreviewModel + public sealed partial class BasicPreviewViewModel : BasePreviewModel { public BasicPreviewViewModel(ListedItem item) : base(item) { } } diff --git a/src/Files.App/ViewModels/UserControls/Previews/CodePreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/CodePreviewViewModel.cs index 2b99534bfe34..0f59e3fa07ac 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/CodePreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/CodePreviewViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class CodePreviewViewModel : BasePreviewModel + public sealed partial class CodePreviewViewModel : BasePreviewModel { private static readonly FrozenDictionary extensions = GetDictionary(); diff --git a/src/Files.App/ViewModels/UserControls/Previews/HtmlPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/HtmlPreviewViewModel.cs index 80e5b0f31712..934e4789785b 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/HtmlPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/HtmlPreviewViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class HtmlPreviewViewModel : BasePreviewModel + public sealed partial class HtmlPreviewViewModel : BasePreviewModel { public HtmlPreviewViewModel(ListedItem item) : base(item) diff --git a/src/Files.App/ViewModels/UserControls/Previews/ImagePreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/ImagePreviewViewModel.cs index 596f7f30244a..582cdb372726 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/ImagePreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/ImagePreviewViewModel.cs @@ -10,7 +10,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class ImagePreviewViewModel : BasePreviewModel + public sealed partial class ImagePreviewViewModel : BasePreviewModel { private ImageSource imageSource; public ImageSource ImageSource diff --git a/src/Files.App/ViewModels/UserControls/Previews/MarkdownPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/MarkdownPreviewViewModel.cs index b0c1bd01a9b7..313b2648204f 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/MarkdownPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/MarkdownPreviewViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class MarkdownPreviewViewModel : BasePreviewModel + public sealed partial class MarkdownPreviewViewModel : BasePreviewModel { private string textValue; public string TextValue diff --git a/src/Files.App/ViewModels/UserControls/Previews/MediaPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/MediaPreviewViewModel.cs index c99e70b2f104..7221dbc7d5a6 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/MediaPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/MediaPreviewViewModel.cs @@ -7,7 +7,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class MediaPreviewViewModel : BasePreviewModel + public sealed partial class MediaPreviewViewModel : BasePreviewModel { public event EventHandler TogglePlaybackRequested; diff --git a/src/Files.App/ViewModels/UserControls/Previews/PDFPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/PDFPreviewViewModel.cs index 2d8c1a9784e7..d386744a3891 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/PDFPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/PDFPreviewViewModel.cs @@ -11,7 +11,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class PDFPreviewViewModel : BasePreviewModel + public sealed partial class PDFPreviewViewModel : BasePreviewModel { private Visibility loadingBarVisibility; public Visibility LoadingBarVisibility diff --git a/src/Files.App/ViewModels/UserControls/Previews/RichTextPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/RichTextPreviewViewModel.cs index 5ead981fc315..da16faf85385 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/RichTextPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/RichTextPreviewViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class RichTextPreviewViewModel : BasePreviewModel + public sealed partial class RichTextPreviewViewModel : BasePreviewModel { public IRandomAccessStream Stream { get; set; } diff --git a/src/Files.App/ViewModels/UserControls/Previews/ShellPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/ShellPreviewViewModel.cs index c001531701fa..d164d6729c82 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/ShellPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/ShellPreviewViewModel.cs @@ -19,12 +19,14 @@ using WinRT; using static Vanara.PInvoke.ShlwApi; using static Vanara.PInvoke.User32; +using System.Runtime.InteropServices.Marshalling; + #pragma warning disable CS8305 // Type is for evaluation purposes only and is subject to change or removal in future updates. namespace Files.App.ViewModels.Previews { - public sealed class ShellPreviewViewModel : BasePreviewModel + public sealed partial class ShellPreviewViewModel : BasePreviewModel { private const string IPreviewHandlerIid = "{8895b1c6-b41f-4c1c-a562-0d564250836f}"; private static readonly Guid QueryAssociationsClsid = new Guid(0xa07034fd, 0x6caa, 0x4954, 0xac, 0x3f, 0x97, 0xa2, 0x72, 0x16, 0xf9, 0x8a); @@ -36,6 +38,13 @@ public sealed class ShellPreviewViewModel : BasePreviewModel HWND hwnd = HWND.NULL; bool isOfficePreview = false; + [GeneratedComInterface, Guid("EACDD04C-117E-4E17-88F4-D1B12B0E3D89"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public partial interface IDCompositionTarget + { + [PreserveSig] + int SetRoot(nint visual); + } + public ShellPreviewViewModel(ListedItem item) : base(item) { } @@ -77,18 +86,15 @@ public async override Task> LoadPreviewAndDetailsAsync() } } - public void SizeChanged(Windows.Foundation.Rect size) + public void SizeChanged(RECT size) { - var width = (int)size.Width; - var height = (int)size.Height; - if (hwnd != HWND.NULL) - SetWindowPos(hwnd, HWND.HWND_TOP, (int)size.Left, (int)size.Top, width, height, SetWindowPosFlags.SWP_NOACTIVATE); + SetWindowPos(hwnd, HWND.HWND_TOP, size.Left, size.Top, size.Width, size.Height, SetWindowPosFlags.SWP_NOACTIVATE); - currentHandler?.ResetBounds(new(0, 0, width, height)); + currentHandler?.ResetBounds(new(0, 0, size.Width, size.Height)); if (outputLink is not null) - outputLink.PlacementVisual.Size = new(width, height); + outputLink.PlacementVisual.Size = new(size.Width, size.Height); } private nint WndProc(HWND hwnd, uint msg, nint wParam, nint lParam) @@ -119,7 +125,7 @@ private nint WndProc(HWND hwnd, uint msg, nint wParam, nint lParam) { if (currentHandler is not null) { - currentHandler.UnloadPreview(); + currentHandler.Dispose(); currentHandler = null; } } @@ -196,17 +202,15 @@ private unsafe bool ChildWindowToXaml(nint parent, UIElement presenter) var compositor = ElementCompositionPreview.GetElementVisual(presenter).Compositor; outputLink = ContentExternalOutputLink.Create(compositor); - var target = outputLink.As(); - target.SetRoot(pChildVisual); + var target = outputLink.As(); + target.SetRoot((nint)pChildVisual); outputLink.PlacementVisual.Size = new(0, 0); - outputLink.PlacementVisual.Scale = new(1/(float)presenter.XamlRoot.RasterizationScale); + outputLink.PlacementVisual.Scale = new(1 / (float)presenter.XamlRoot.RasterizationScale); ElementCompositionPreview.SetElementChildVisual(presenter, outputLink.PlacementVisual); pDCompositionDevice->Commit(); - Marshal.ReleaseComObject(target); - pChildVisual->Release(); pControlSurface->Release(); pDCompositionDevice->Release(); pDXGIDevice->Release(); @@ -229,7 +233,7 @@ public void UnloadPreview() if (hwnd != HWND.NULL) DestroyWindow(hwnd); - //outputLink?.Dispose(); + outputLink?.Dispose(); outputLink = null; if (wCls is not null) @@ -253,7 +257,10 @@ public unsafe void PointerEntered(bool onPreview) } else { - PInvoke.SetWindowLongPtr(new((nint)hwnd), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (nint)(WINDOW_EX_STYLE.WS_EX_LAYERED | WINDOW_EX_STYLE.WS_EX_COMPOSITED)); + PInvoke.SetWindowLongPtr( + new((nint)hwnd), + WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, + (nint)(WINDOW_EX_STYLE.WS_EX_LAYERED | WINDOW_EX_STYLE.WS_EX_COMPOSITED)); var dwAttrib = Convert.ToUInt32(true); @@ -267,4 +274,4 @@ public unsafe void PointerEntered(bool onPreview) } } -#pragma warning restore CS8305 // Type is for evaluation purposes only and is subject to change or removal in future updates. +#pragma warning restore CS8305 // Type is for evaluation purposes only and is subject to change or removal in future updates. \ No newline at end of file diff --git a/src/Files.App/ViewModels/UserControls/Previews/ShortcutPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/ShortcutPreviewViewModel.cs index 59ba3f98b825..c87812232483 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/ShortcutPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/ShortcutPreviewViewModel.cs @@ -5,7 +5,7 @@ namespace Files.App.ViewModels.Previews { - internal sealed class ShortcutPreviewViewModel : BasePreviewModel + internal sealed partial class ShortcutPreviewViewModel : BasePreviewModel { public ShortcutPreviewViewModel(ListedItem item) : base(item) { } diff --git a/src/Files.App/ViewModels/UserControls/Previews/TextPreviewViewModel.cs b/src/Files.App/ViewModels/UserControls/Previews/TextPreviewViewModel.cs index 41d1959664e5..b5fc658ba793 100644 --- a/src/Files.App/ViewModels/UserControls/Previews/TextPreviewViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Previews/TextPreviewViewModel.cs @@ -6,7 +6,7 @@ namespace Files.App.ViewModels.Previews { - public sealed class TextPreviewViewModel : BasePreviewModel + public sealed partial class TextPreviewViewModel : BasePreviewModel { private string textValue; public string TextValue diff --git a/src/Files.App/ViewModels/UserControls/SearchBoxViewModel.cs b/src/Files.App/ViewModels/UserControls/SearchBoxViewModel.cs index fb8d088a353c..a2cadcb3dd72 100644 --- a/src/Files.App/ViewModels/UserControls/SearchBoxViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SearchBoxViewModel.cs @@ -9,7 +9,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class SearchBoxViewModel : ObservableObject, ISearchBoxViewModel + public sealed partial class SearchBoxViewModel : ObservableObject, ISearchBoxViewModel { private string query; public string Query diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index 83dbe60f553b..16004ae974d7 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -19,7 +19,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class SidebarViewModel : ObservableObject, IDisposable, ISidebarViewModel + public sealed partial class SidebarViewModel : ObservableObject, IDisposable, ISidebarViewModel { private INetworkService NetworkService { get; } = Ioc.Default.GetRequiredService(); private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/ViewModels/UserControls/StatusCenterViewModel.cs b/src/Files.App/ViewModels/UserControls/StatusCenterViewModel.cs index 002259251c86..1ff2f6c93d53 100644 --- a/src/Files.App/ViewModels/UserControls/StatusCenterViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/StatusCenterViewModel.cs @@ -3,7 +3,7 @@ namespace Files.App.ViewModels.UserControls { - public sealed class StatusCenterViewModel : ObservableObject + public sealed partial class StatusCenterViewModel : ObservableObject { public ObservableCollection StatusCenterItems { get; } = []; diff --git a/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs index a1f33a11c8ce..d6590477f799 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs @@ -13,7 +13,7 @@ namespace Files.App.ViewModels.UserControls.Widgets /// /// Represents view model of . /// - public sealed class DrivesWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel + public sealed partial class DrivesWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel { // Properties diff --git a/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs index 16a10194ccd2..17fecdd081dc 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs @@ -13,7 +13,7 @@ namespace Files.App.ViewModels.UserControls.Widgets /// /// Represents view model of . /// - public sealed class NetworkLocationsWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel + public sealed partial class NetworkLocationsWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel { // Properties diff --git a/src/Files.App/ViewModels/UserControls/Widgets/QuickAccessWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/QuickAccessWidgetViewModel.cs index befaf26331a4..557743712287 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/QuickAccessWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/QuickAccessWidgetViewModel.cs @@ -15,7 +15,7 @@ namespace Files.App.ViewModels.UserControls.Widgets /// /// Represents view model of . /// - public sealed class QuickAccessWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel + public sealed partial class QuickAccessWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel { // Properties diff --git a/src/Files.App/ViewModels/UserControls/Widgets/RecentFilesWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/RecentFilesWidgetViewModel.cs index fb0a22f0f095..8a8a398c9ca1 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/RecentFilesWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/RecentFilesWidgetViewModel.cs @@ -13,7 +13,7 @@ namespace Files.App.ViewModels.UserControls.Widgets /// /// Represents view model of . /// - public sealed class RecentFilesWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel + public sealed partial class RecentFilesWidgetViewModel : BaseWidgetViewModel, IWidgetViewModel { // Fields diff --git a/src/Files.App/Views/HomePage.xaml b/src/Files.App/Views/HomePage.xaml index 11e3b0b470bf..bbdf97096faa 100644 --- a/src/Files.App/Views/HomePage.xaml +++ b/src/Files.App/Views/HomePage.xaml @@ -8,15 +8,14 @@ xmlns:dataitems="using:Files.App.Data.Items" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" DataContext="{x:Bind ViewModel, Mode=OneWay}" mc:Ignorable="d"> - - - + + + diff --git a/src/Files.App/Views/Layouts/BaseGroupableLayoutPage.cs b/src/Files.App/Views/Layouts/BaseGroupableLayoutPage.cs index 59076467357f..1ba13fb01592 100644 --- a/src/Files.App/Views/Layouts/BaseGroupableLayoutPage.cs +++ b/src/Files.App/Views/Layouts/BaseGroupableLayoutPage.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Files.App.ViewModels.Layouts; using Microsoft.UI.Input; using Microsoft.UI.Xaml; diff --git a/src/Files.App/Views/Layouts/BaseLayoutPage.cs b/src/Files.App/Views/Layouts/BaseLayoutPage.cs index 447b06d13131..54fbf663e76c 100644 --- a/src/Files.App/Views/Layouts/BaseLayoutPage.cs +++ b/src/Files.App/Views/Layouts/BaseLayoutPage.cs @@ -1,7 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; +using CommunityToolkit.WinUI; using Files.App.Controls; using Files.App.Helpers.ContextFlyouts; using Files.App.UserControls.Menus; @@ -15,6 +15,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.ComTypes; +using Vanara.Extensions; using Vanara.PInvoke; using Windows.ApplicationModel.DataTransfer; using Windows.ApplicationModel.DataTransfer.DragDrop; diff --git a/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml b/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml index c5546994cac9..d729b2c88817 100644 --- a/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml +++ b/src/Files.App/Views/Layouts/ColumnLayoutPage.xaml @@ -13,8 +13,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:storage="using:Files.App.Utils.Storage" xmlns:uc="using:Files.App.UserControls" - xmlns:wct="using:CommunityToolkit.WinUI.UI" - xmlns:wctconverters="using:CommunityToolkit.WinUI.UI.Converters" + xmlns:wct="using:CommunityToolkit.WinUI" + xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" x:Name="PageRoot" HighContrastAdjustment="None" mc:Ignorable="d"> @@ -177,7 +177,6 @@ - - - + + + diff --git a/src/Files.App/Views/Layouts/ColumnsLayoutPage.xaml.cs b/src/Files.App/Views/Layouts/ColumnsLayoutPage.xaml.cs index f40191578bca..a5fe0b31466b 100644 --- a/src/Files.App/Views/Layouts/ColumnsLayoutPage.xaml.cs +++ b/src/Files.App/Views/Layouts/ColumnsLayoutPage.xaml.cs @@ -1,8 +1,9 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using CommunityToolkit.WinUI.UI; -using CommunityToolkit.WinUI.UI.Controls; +using CommunityToolkit.WinUI; +using CommunityToolkit.WinUI.Controls; +using Files.App.Controls; using Files.App.ViewModels.Layouts; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; diff --git a/src/Files.App/Views/Layouts/DetailsLayoutPage.xaml b/src/Files.App/Views/Layouts/DetailsLayoutPage.xaml index 74174bcaee2b..c5c95f60c74c 100644 --- a/src/Files.App/Views/Layouts/DetailsLayoutPage.xaml +++ b/src/Files.App/Views/Layouts/DetailsLayoutPage.xaml @@ -11,25 +11,24 @@ xmlns:filesystem="using:Files.App.Utils" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:local="using:Files.App.Views.Layouts" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:storage="using:Files.App.Utils.Storage" - xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls" + xmlns:toolkit="using:CommunityToolkit.WinUI.Controls" xmlns:uc="using:Files.App.UserControls" - xmlns:wct="using:CommunityToolkit.WinUI.UI" - xmlns:wctconverters="using:CommunityToolkit.WinUI.UI.Converters" + xmlns:wct="using:CommunityToolkit.WinUI" + xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" x:Name="PageRoot" NavigationCacheMode="Enabled" mc:Ignorable="d"> - - - - - - + + + + + + @@ -54,7 +53,7 @@