diff --git a/.editorconfig b/.editorconfig index 48dbbbd3..f997c808 100644 --- a/.editorconfig +++ b/.editorconfig @@ -560,6 +560,9 @@ dotnet_diagnostic.S6602.severity = none # "Find" method should be use dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All" dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any" dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. +dotnet_diagnostic.S8969.severity = none # Remove this null-forgiving operator; the compiler already knows this expression is not null here +dotnet_diagnostic.S8970.severity = none # Remove this null-forgiving operator; nullable warnings are disabled here + ########################################## # Custom - File Extension Settings diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..983bd090 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: "Build and test" + +on: + push: + branches: + - main + tags-ignore: + - '**' + pull_request: + branches: + - main + +jobs: + dotnet-build: + runs-on: windows-latest + steps: + - name: ๐Ÿ›’ Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + + - name: โš™๏ธ Setup .NET + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 + with: + dotnet-version: '10.0.x' + + - name: ๐Ÿ” Restore packages + run: dotnet restore Atc.Wpf.slnx + + - name: ๐Ÿ› ๏ธ Build solution + run: dotnet build Atc.Wpf.slnx -c Release --no-restore + + dotnet-test: + runs-on: windows-latest + needs: dotnet-build + steps: + - name: ๐Ÿ›’ Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + + - name: โš™๏ธ Setup .NET + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 + with: + dotnet-version: '10.0.x' + + - name: ๐Ÿ” Restore packages + run: dotnet restore Atc.Wpf.slnx + + - name: ๐Ÿ› ๏ธ Build solution + run: dotnet build Atc.Wpf.slnx -c Release --no-restore /p:UseSourceLink=true + + - name: ๐Ÿงช Run unit tests with code coverage + run: dotnet test --solution Atc.Wpf.slnx -c Release --no-build --coverage --coverage-output-format cobertura + + - name: ๐Ÿ“ค Upload coverage reports as workflow artifacts + if: ${{ !cancelled() }} + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: coverage-cobertura + path: '**/TestResults/**/*.cobertura.xml' + if-no-files-found: warn + retention-days: 14 diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml deleted file mode 100644 index 98f47540..00000000 --- a/.github/workflows/post-integration.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: "Post-Integration" - -on: - push: - branches: - - main - - "!stable" - - "!release" - -env: - ATC_EMAIL: "atcnet.org@gmail.com" - ATC_NAME: "Atc-Net" - NUGET_REPO_URL: "https://nuget.pkg.github.com/atc-net/index.json" - -jobs: - merge-to-stable: - runs-on: windows-latest - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_WORKFLOWS }} - - - name: โš›๏ธ Sets environment variables - branch-name - run: echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV - - - name: โš›๏ธ Sets environment variables - Nerdbank.GitVersioning - uses: dotnet/nbgv@master - with: - setAllVars: true - - - name: โš™๏ธ Setup dotnet 10.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "10.0.x" - - - name: ๐Ÿ“ Ensure nuget.org added as package source on Windows - run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config - continue-on-error: true - - - name: ๐Ÿ” Restore packages - run: dotnet restore - - - name: ๐Ÿ› ๏ธ Build - run: dotnet build -c Release --no-restore /p:UseSourceLink=true - - - name: ๐Ÿงช Run unit tests with code coverage - run: dotnet test -c Release --no-build -- --coverage --coverage-output-format cobertura - - - name: ๐Ÿ“ค Upload coverage reports as workflow artifacts - if: ${{ !cancelled() }} - uses: actions/upload-artifact@v4 - with: - name: coverage-cobertura - path: '**/TestResults/**/*.cobertura.xml' - if-no-files-found: warn - retention-days: 30 - - - name: โฉ Merge to stable-branch - run: | - git config --local user.email ${{ env.ATC_EMAIL }} - git config --local user.name ${{ env.ATC_NAME }} - git checkout stable - git merge --ff-only main - git push origin stable - - - name: ๐Ÿ—ณ๏ธ Creating library package for pre-release - run: dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME - - - name: ๐Ÿ“ฆ Push packages to GitHub Package Registry - run: | - cd ${GITHUB_WORKSPACE}/packages - dotnet nuget push Atc.Wpf.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Components.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Controls.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Controls.Sample.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.FontIcons.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Forms.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Hardware.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Network.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.Theming.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate - dotnet nuget push Atc.Wpf.UndoRedo.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate \ No newline at end of file diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml deleted file mode 100644 index 3925e099..00000000 --- a/.github/workflows/pre-integration.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: "Pre-Integration" - -on: - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - dotnet-build: - runs-on: windows-latest - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: โš™๏ธ Setup dotnet 10.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "10.0.x" - - - name: ๐Ÿ“ Ensure nuget.org added as package source on Windows - run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config - continue-on-error: true - - - name: ๐Ÿ” Restore packages - run: dotnet restore - - - name: ๐Ÿ› ๏ธ Building library in release mode - run: dotnet build -c Release --no-restore - - dotnet-test: - runs-on: windows-latest - needs: - - dotnet-build - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: โš™๏ธ Setup dotnet 10.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "10.0.x" - - - name: ๐Ÿ“ Ensure nuget.org added as package source on Windows - run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config - continue-on-error: true - - - name: ๐Ÿ” Restore packages - run: dotnet restore - - - name: ๐Ÿ› ๏ธ Build - run: dotnet build -c Release --no-restore /p:UseSourceLink=true - - - name: ๐Ÿงช Run unit tests with code coverage - run: dotnet test -c Release --no-build -- --coverage --coverage-output-format cobertura - - - name: ๐Ÿ“ค Upload coverage reports as workflow artifacts - if: ${{ !cancelled() }} - uses: actions/upload-artifact@v4 - with: - name: coverage-cobertura - path: '**/TestResults/**/*.cobertura.xml' - if-no-files-found: warn - retention-days: 14 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..2bd8b510 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,65 @@ +name: release-please + +on: + push: + branches: + - main + +jobs: + release-please: + # WPF targets Windows, so the packages must be built on a Windows runner. + runs-on: windows-latest + permissions: + contents: read + id-token: write # required for NuGet Trusted Publishing (OIDC) + + steps: + - name: release-please + id: release + uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + with: + token: ${{ secrets.RELEASE_PLEASE_PAT }} + + - name: ๐Ÿ›’ Checkout repository + if: ${{ steps.release.outputs.release_created }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + ref: ${{ steps.release.outputs.tag_name }} + + - name: โš™๏ธ Setup .NET + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 + with: + dotnet-version: '10.0.x' + + - name: ๐Ÿงน Clean + if: ${{ steps.release.outputs.release_created }} + run: dotnet clean Atc.Wpf.slnx -c Release && dotnet nuget locals all --clear + + - name: ๐Ÿ” Restore packages + if: ${{ steps.release.outputs.release_created }} + run: dotnet restore Atc.Wpf.slnx + + - name: ๐Ÿ› ๏ธ Build solution + if: ${{ steps.release.outputs.release_created }} + run: dotnet build Atc.Wpf.slnx -c Release --no-restore /p:UseSourceLink=true + + # All packages share a single in Directory.Build.props, so they are + # always packed and published together from one release-please tag. + # Only projects with IsPackable=true (the ten src libraries) produce a package. + # On Windows, dotnet nuget push only expands the wildcard in a path that uses backslashes. + - name: ๐Ÿ—ณ๏ธ Creating library packages for release + if: ${{ steps.release.outputs.release_created }} + run: dotnet pack Atc.Wpf.slnx -c Release --no-restore -o "${{ github.workspace }}\packages" + + - name: ๐Ÿ”‘ NuGet login (OIDC โ†’ short-lived API key) + if: ${{ steps.release.outputs.release_created }} + id: nuget-login + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + with: + user: ${{ secrets.NUGET_USER }} + + - name: ๐Ÿ“ฆ Push packages to NuGet + if: ${{ steps.release.outputs.release_created }} + run: dotnet nuget push "${{ github.workspace }}\packages\*.nupkg" -k "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4322abbb..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: "Release" - -on: - workflow_dispatch: - -env: - ATC_EMAIL: "atcnet.org@gmail.com" - ATC_NAME: "Atc-Net" - NUGET_REPO_URL: "https://api.nuget.org/v3/index.json" - -jobs: - release: - if: github.ref == 'refs/heads/stable' - runs-on: windows-latest - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_WORKFLOWS }} - - - name: โš›๏ธ Sets environment variables - branch-name - run: echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV - - - name: โš›๏ธ Sets environment variables - Nerdbank.GitVersioning - uses: dotnet/nbgv@master - with: - setAllVars: true - - - name: โš™๏ธ Setup dotnet 10.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "10.0.x" - - - name: ๐Ÿ“ Ensure nuget.org added as package source on Windows - run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config - continue-on-error: true - - - name: ๐Ÿ” Restore packages - run: dotnet restore - - - name: ๐Ÿ› ๏ธ Building library in release mode - run: dotnet build -c Release --no-restore /p:UseSourceLink=true - - - name: โฉ Merge to release-branch - run: | - git config --local user.email ${{ env.ATC_EMAIL }} - git config --local user.name ${{ env.ATC_NAME }} - git checkout release - git merge --ff-only stable - git push origin release - - - name: ๐Ÿ—ณ๏ธ Creating library package for release - run: dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME /p:PublicRelease=true - - - name: ๐Ÿ“ฆ Push packages to NuGet - run: | - cd ${GITHUB_WORKSPACE}/packages - dotnet nuget push Atc.Wpf.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Components.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Controls.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Controls.Sample.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.FontIcons.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Forms.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Hardware.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Network.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.Theming.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols - dotnet nuget push Atc.Wpf.UndoRedo.${{ env.NBGV_NuGetPackageVersion }}.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..29518012 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "4.0.215" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index e3990c46..46a0a20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,9 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +From 4.0.216 onwards this file is maintained by [release-please](https://github.com/googleapis/release-please) from [Conventional Commits](https://www.conventionalcommits.org/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## 4.0.215 (2026-05-12) ### Added @@ -560,5 +559,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `StepperStepChangedEventArgsTests`, `StepperStepChangingEventArgsTests` (`Cancel` defaults to false + setter), `SegmentedSelectionChangedEventArgsTests` (null items allowed + index pair). - -[Unreleased]: https://github.com/atc-net/atc-wpf/compare/HEAD diff --git a/Directory.Build.props b/Directory.Build.props index 2c528777..d41a84e4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,6 +14,13 @@ en-US + + + + 4.0.215 + + + true @@ -56,9 +63,9 @@ - + - + \ No newline at end of file diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..9e0277e1 --- /dev/null +++ b/nuget.config @@ -0,0 +1,12 @@ +๏ปฟ + + + + + + + + + + + \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..4aca6a30 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "bootstrap-sha": "042b9c926619ffc0bad4363b4b55a45e7187860c", + "pull-request-title-pattern": "chore: release version ${version}", + "pull-request-header": ":robot: Preparing to release next version", + "pull-request-footer": "This pull request was generated by release-please.", + "packages": { + ".": { + "extra-files": [ + "Directory.Build.props" + ] + } + }, + "changelog-sections": [ + { + "type": "feat", + "section": "New features" + }, + { + "type": "fix", + "scope": "deps", + "section": "Upgrades" + }, + { + "type": "fix", + "section": "Bug fixes" + }, + { + "type": "perf", + "section": "Performance improvements" + }, + { + "type": "revert", + "section": "Reverts" + } + ] +} diff --git a/sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj b/sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj index 12757fe5..08677fad 100644 --- a/sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj +++ b/sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj @@ -51,14 +51,14 @@ - - - + + + - - - - + + + + diff --git a/sample/Atc.Wpf.Sample/SamplesWpfNetwork/Scanner/NetworkScannerSampleViewModel.cs b/sample/Atc.Wpf.Sample/SamplesWpfNetwork/Scanner/NetworkScannerSampleViewModel.cs index 31e143ac..c3b6798c 100644 --- a/sample/Atc.Wpf.Sample/SamplesWpfNetwork/Scanner/NetworkScannerSampleViewModel.cs +++ b/sample/Atc.Wpf.Sample/SamplesWpfNetwork/Scanner/NetworkScannerSampleViewModel.cs @@ -1,5 +1,6 @@ namespace Atc.Wpf.Sample.SamplesWpfNetwork.Scanner; +[SuppressMessage("Security", "S1313:Do not hardcode IP addresses", Justification = "OK - Sample data only.")] public class NetworkScannerSampleViewModel : ViewModelBase { public NetworkScannerViewModel NetworkScanner { get; } = new() diff --git a/sample/Atc.Wpf.Sample/SamplesWpfSourceGenerators/AttachedPropertyView.xaml.cs b/sample/Atc.Wpf.Sample/SamplesWpfSourceGenerators/AttachedPropertyView.xaml.cs index 1a87c6c1..d559503e 100644 --- a/sample/Atc.Wpf.Sample/SamplesWpfSourceGenerators/AttachedPropertyView.xaml.cs +++ b/sample/Atc.Wpf.Sample/SamplesWpfSourceGenerators/AttachedPropertyView.xaml.cs @@ -19,6 +19,7 @@ private void OnToggleDraggingClick( !isCurrentlyDraggable); } + [SuppressMessage("Design", "MA0051:Method is too long", Justification = "OK - sample source code as a raw string literal.")] public string CSharpCodeForDragBehavior => """ // diff --git a/sample/Directory.Build.props b/sample/Directory.Build.props index 02ae31a5..01a941b2 100644 --- a/sample/Directory.Build.props +++ b/sample/Directory.Build.props @@ -8,4 +8,8 @@ + + false + + \ No newline at end of file diff --git a/src/Atc.Wpf.Components/Atc.Wpf.Components.csproj b/src/Atc.Wpf.Components/Atc.Wpf.Components.csproj index 77313904..f8b134d4 100644 --- a/src/Atc.Wpf.Components/Atc.Wpf.Components.csproj +++ b/src/Atc.Wpf.Components/Atc.Wpf.Components.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Components + true Atc.Wpf.Components wpf;components;dialogs;viewers;settings;notifications WPF composite component library providing dialogs, viewers, settings panels, and notifications. @@ -44,9 +45,9 @@ - - - + + + diff --git a/src/Atc.Wpf.Components/Viewers/TerminalViewer.xaml.cs b/src/Atc.Wpf.Components/Viewers/TerminalViewer.xaml.cs index f06ffc89..3063e8a7 100644 --- a/src/Atc.Wpf.Components/Viewers/TerminalViewer.xaml.cs +++ b/src/Atc.Wpf.Components/Viewers/TerminalViewer.xaml.cs @@ -652,7 +652,8 @@ private void TerminalClearEventArgsHandle(TerminalClearEventArgs obj) ListViewTerminal.Items.Clear(); ResetTailState(); }, - DispatcherPriority.Render); + DispatcherPriority.Render, + CancellationToken.None); } } diff --git a/src/Atc.Wpf.Controls.Sample/.editorconfig b/src/Atc.Wpf.Controls.Sample/.editorconfig index 93ca8326..4e7e24ae 100644 --- a/src/Atc.Wpf.Controls.Sample/.editorconfig +++ b/src/Atc.Wpf.Controls.Sample/.editorconfig @@ -9,11 +9,11 @@ ########################################## [*.{cs}] +dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 + dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. -dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 - ########################################## # Custom - Code Analyzers Rules diff --git a/src/Atc.Wpf.Controls.Sample/Atc.Wpf.Controls.Sample.csproj b/src/Atc.Wpf.Controls.Sample/Atc.Wpf.Controls.Sample.csproj index abd5c7c4..385ebccd 100644 --- a/src/Atc.Wpf.Controls.Sample/Atc.Wpf.Controls.Sample.csproj +++ b/src/Atc.Wpf.Controls.Sample/Atc.Wpf.Controls.Sample.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Controls.Sample + true Atc.Wpf.Controls.Sample wpf;sample;sample-controls;demo Reusable WPF controls for building sample and demonstration applications. @@ -16,9 +17,9 @@ - - - + + + diff --git a/src/Atc.Wpf.Controls/.editorconfig b/src/Atc.Wpf.Controls/.editorconfig index 93ca8326..4e7e24ae 100644 --- a/src/Atc.Wpf.Controls/.editorconfig +++ b/src/Atc.Wpf.Controls/.editorconfig @@ -9,11 +9,11 @@ ########################################## [*.{cs}] +dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 + dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. -dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 - ########################################## # Custom - Code Analyzers Rules diff --git a/src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj b/src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj index 6411e228..270632b9 100644 --- a/src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj +++ b/src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Controls + true Atc.Wpf.Controls wpf;controls;input;picker;layout;progress WPF control library providing atomic UI controls including input controls, pickers, layouts, and progress indicators. @@ -40,10 +41,10 @@ - + - - + + diff --git a/src/Atc.Wpf.Controls/Zoom/ZoomBox.cs b/src/Atc.Wpf.Controls/Zoom/ZoomBox.cs index ff84b0ad..9f93d247 100644 --- a/src/Atc.Wpf.Controls/Zoom/ZoomBox.cs +++ b/src/Atc.Wpf.Controls/Zoom/ZoomBox.cs @@ -677,7 +677,7 @@ private static void OnViewportZoomChanged( Messenger.Default.Send(new ZoomInformationMessage(newZoom * 100)); - if (c.InternalViewportZoom.Equals(newZoom)) + if (c.InternalViewportZoom.IsEqual(newZoom)) { return; } diff --git a/src/Atc.Wpf.FontIcons/.editorconfig b/src/Atc.Wpf.FontIcons/.editorconfig index 93ca8326..4e7e24ae 100644 --- a/src/Atc.Wpf.FontIcons/.editorconfig +++ b/src/Atc.Wpf.FontIcons/.editorconfig @@ -9,11 +9,11 @@ ########################################## [*.{cs}] +dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 + dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. -dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 - ########################################## # Custom - Code Analyzers Rules diff --git a/src/Atc.Wpf.FontIcons/Atc.Wpf.FontIcons.csproj b/src/Atc.Wpf.FontIcons/Atc.Wpf.FontIcons.csproj index 18668fd0..ee71f953 100644 --- a/src/Atc.Wpf.FontIcons/Atc.Wpf.FontIcons.csproj +++ b/src/Atc.Wpf.FontIcons/Atc.Wpf.FontIcons.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.FontIcons + true Atc.Wpf.FontIcons wpf;fonticons;fontawesome;materialdesign;icons WPF font icon library providing Font Awesome, Material Design, and other icon fonts. diff --git a/src/Atc.Wpf.Forms/Atc.Wpf.Forms.csproj b/src/Atc.Wpf.Forms/Atc.Wpf.Forms.csproj index 3c889627..fa08fb5c 100644 --- a/src/Atc.Wpf.Forms/Atc.Wpf.Forms.csproj +++ b/src/Atc.Wpf.Forms/Atc.Wpf.Forms.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Forms + true Atc.Wpf.Forms wpf;forms;label-controls;validation;data-entry WPF form library providing labeled form field controls with built-in validation for data entry. @@ -28,9 +29,9 @@ - - - + + + diff --git a/src/Atc.Wpf.Forms/BaseControls/Internal/ColorPickerAutomationPeer.cs b/src/Atc.Wpf.Forms/BaseControls/Internal/ColorPickerAutomationPeer.cs index b1e93353..15968398 100644 --- a/src/Atc.Wpf.Forms/BaseControls/Internal/ColorPickerAutomationPeer.cs +++ b/src/Atc.Wpf.Forms/BaseControls/Internal/ColorPickerAutomationPeer.cs @@ -44,9 +44,9 @@ public void SetValue(string value) var color = (Color)ColorConverter.ConvertFromString(value); ColorPicker.SetCurrentValue(ColorPicker.ColorValueProperty, color); } - catch (FormatException) + catch (FormatException ex) { - throw new ArgumentException($"Invalid color value: {value}", nameof(value)); + throw new ArgumentException($"Invalid color value: {value}", nameof(value), ex); } } } \ No newline at end of file diff --git a/src/Atc.Wpf.Forms/ColorEditing/AdvancedColorPicker.xaml.cs b/src/Atc.Wpf.Forms/ColorEditing/AdvancedColorPicker.xaml.cs index d7441178..de4bd145 100644 --- a/src/Atc.Wpf.Forms/ColorEditing/AdvancedColorPicker.xaml.cs +++ b/src/Atc.Wpf.Forms/ColorEditing/AdvancedColorPicker.xaml.cs @@ -71,7 +71,7 @@ public double Hue get => hue; set { - if (value.Equals(hue)) + if (value.IsEqual(hue)) { return; } @@ -92,7 +92,7 @@ public double Saturation get => saturation; set { - if (value.Equals(saturation)) + if (value.IsEqual(saturation)) { return; } @@ -113,7 +113,7 @@ public double Brightness get => brightness; set { - if (value.Equals(brightness)) + if (value.IsEqual(brightness)) { return; } diff --git a/src/Atc.Wpf.Forms/FontEditing/FontDescription.cs b/src/Atc.Wpf.Forms/FontEditing/FontDescription.cs index df30d6fd..4032ca56 100644 --- a/src/Atc.Wpf.Forms/FontEditing/FontDescription.cs +++ b/src/Atc.Wpf.Forms/FontEditing/FontDescription.cs @@ -156,7 +156,7 @@ public bool Equals(FontDescription? other) } return string.Equals(Family.Source, other.Family.Source, StringComparison.Ordinal) && - Size.Equals(other.Size) && + Size.IsEqual(other.Size) && Weight.Equals(other.Weight) && Style.Equals(other.Style) && Stretch.Equals(other.Stretch) && diff --git a/src/Atc.Wpf.Hardware/Atc.Wpf.Hardware.csproj b/src/Atc.Wpf.Hardware/Atc.Wpf.Hardware.csproj index b6b81611..79dfddb6 100644 --- a/src/Atc.Wpf.Hardware/Atc.Wpf.Hardware.csproj +++ b/src/Atc.Wpf.Hardware/Atc.Wpf.Hardware.csproj @@ -4,6 +4,7 @@ net10.0-windows10.0.19041.0 true Atc.Wpf.Hardware + true Atc.Wpf.Hardware wpf;hardware;serialport;usb;camera;picker;device WPF hardware controls library providing pickers for serial ports, USB devices and USB cameras with live device-state detection. @@ -19,9 +20,9 @@ - - - + + + diff --git a/src/Atc.Wpf.Hardware/Pickers/Internal/AudioBufferAccess.cs b/src/Atc.Wpf.Hardware/Pickers/Internal/AudioBufferAccess.cs index d3f6e5d3..2627b221 100644 --- a/src/Atc.Wpf.Hardware/Pickers/Internal/AudioBufferAccess.cs +++ b/src/Atc.Wpf.Hardware/Pickers/Internal/AudioBufferAccess.cs @@ -9,6 +9,7 @@ namespace Atc.Wpf.Hardware.Pickers.Internal; /// Marshal.GetIUnknownForObject cannot reach the underlying ABI object on /// read-side frames. /// +[SuppressMessage("Security", "S6640:Make sure that using \"unsafe\" is safe here", Justification = "OK - By design, required for WinRT buffer interop.")] internal static class AudioBufferAccess { /// diff --git a/src/Atc.Wpf.Hardware/Pickers/Internal/IMemoryBufferByteAccess.cs b/src/Atc.Wpf.Hardware/Pickers/Internal/IMemoryBufferByteAccess.cs index d250d2e6..8c8c6ef2 100644 --- a/src/Atc.Wpf.Hardware/Pickers/Internal/IMemoryBufferByteAccess.cs +++ b/src/Atc.Wpf.Hardware/Pickers/Internal/IMemoryBufferByteAccess.cs @@ -16,6 +16,7 @@ namespace Atc.Wpf.Hardware.Pickers.Internal; [ComImport] [Guid("5B0D3235-4DBA-4D44-865E-8F1D0E4FD04D")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] +[SuppressMessage("Security", "S6640:Make sure that using \"unsafe\" is safe here", Justification = "OK - By design, required for WinRT buffer interop.")] internal unsafe interface IMemoryBufferByteAccess { void GetBuffer( diff --git a/src/Atc.Wpf.Network/Atc.Wpf.Network.csproj b/src/Atc.Wpf.Network/Atc.Wpf.Network.csproj index 9b490720..d626c16e 100644 --- a/src/Atc.Wpf.Network/Atc.Wpf.Network.csproj +++ b/src/Atc.Wpf.Network/Atc.Wpf.Network.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Network + true Atc.Wpf.Network wpf;network;scanner;ip-scanner WPF network controls library providing network scanning and discovery components. @@ -16,10 +17,10 @@ - + - - + + diff --git a/src/Atc.Wpf.Network/Scanner/DesignModeHelper.cs b/src/Atc.Wpf.Network/Scanner/DesignModeHelper.cs index 4e4b9b20..652d5544 100644 --- a/src/Atc.Wpf.Network/Scanner/DesignModeHelper.cs +++ b/src/Atc.Wpf.Network/Scanner/DesignModeHelper.cs @@ -3,6 +3,7 @@ namespace Atc.Wpf.Network.Scanner; /// /// Provides design-time sample data for the network scanner controls. /// +[SuppressMessage("Security", "S1313:Do not hardcode IP addresses", Justification = "OK - Design-time sample data only.")] public static class DesignModeHelper { /// diff --git a/src/Atc.Wpf.Theming/.editorconfig b/src/Atc.Wpf.Theming/.editorconfig index 93ca8326..4e7e24ae 100644 --- a/src/Atc.Wpf.Theming/.editorconfig +++ b/src/Atc.Wpf.Theming/.editorconfig @@ -9,11 +9,11 @@ ########################################## [*.{cs}] +dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 + dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. -dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 - ########################################## # Custom - Code Analyzers Rules diff --git a/src/Atc.Wpf.Theming/Atc.Wpf.Theming.csproj b/src/Atc.Wpf.Theming/Atc.Wpf.Theming.csproj index 8060532d..b56036f1 100644 --- a/src/Atc.Wpf.Theming/Atc.Wpf.Theming.csproj +++ b/src/Atc.Wpf.Theming/Atc.Wpf.Theming.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.Theming + true Atc.Wpf.Theming wpf;theming;styles;light-theme;dark-theme WPF theming library providing light and dark themes with customizable styles for WPF applications. @@ -30,15 +31,15 @@ - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Atc.Wpf.Theming/Behaviors/WindowsSettingBehavior.cs b/src/Atc.Wpf.Theming/Behaviors/WindowsSettingBehavior.cs index c1706d31..9431fefa 100644 --- a/src/Atc.Wpf.Theming/Behaviors/WindowsSettingBehavior.cs +++ b/src/Atc.Wpf.Theming/Behaviors/WindowsSettingBehavior.cs @@ -3,6 +3,7 @@ namespace Atc.Wpf.Theming.Behaviors; [SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "OK.")] [SuppressMessage("Design", "MA0150:Do not call the default object.ToString explicitly", Justification = "OK.")] +[SuppressMessage("Security", "S6640:Make sure that using \"unsafe\" is safe here", Justification = "OK - By design.")] public sealed class WindowsSettingBehavior : Behavior { /// diff --git a/src/Atc.Wpf.UndoRedo/Atc.Wpf.UndoRedo.csproj b/src/Atc.Wpf.UndoRedo/Atc.Wpf.UndoRedo.csproj index 501c26ab..fe97b442 100644 --- a/src/Atc.Wpf.UndoRedo/Atc.Wpf.UndoRedo.csproj +++ b/src/Atc.Wpf.UndoRedo/Atc.Wpf.UndoRedo.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf.UndoRedo + true Atc.Wpf.UndoRedo wpf;undo;redo;history;mvvm WPF undo/redo UI components (history view, keyboard behavior) on top of the Atc.UndoRedo service. @@ -16,10 +17,10 @@ - + - - + + diff --git a/src/Atc.Wpf/.editorconfig b/src/Atc.Wpf/.editorconfig index 93ca8326..4e7e24ae 100644 --- a/src/Atc.Wpf/.editorconfig +++ b/src/Atc.Wpf/.editorconfig @@ -9,11 +9,11 @@ ########################################## [*.{cs}] +dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 + dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. -dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227 - ########################################## # Custom - Code Analyzers Rules diff --git a/src/Atc.Wpf/Atc.Wpf.csproj b/src/Atc.Wpf/Atc.Wpf.csproj index cb6c8a42..d382b0c5 100644 --- a/src/Atc.Wpf/Atc.Wpf.csproj +++ b/src/Atc.Wpf/Atc.Wpf.csproj @@ -4,6 +4,7 @@ net10.0-windows true Atc.Wpf + true Atc.Wpf wpf;mvvm;relaycommand;value-converters;extensions;helpers Base WPF framework library providing MVVM infrastructure, value converters, extensions, and helpers. @@ -29,8 +30,8 @@ - - + + diff --git a/src/Atc.Wpf/Controls/Media/W3cSvg/PaintServers/GradientColorPaintServer.cs b/src/Atc.Wpf/Controls/Media/W3cSvg/PaintServers/GradientColorPaintServer.cs index 0158f178..80c9a679 100644 --- a/src/Atc.Wpf/Controls/Media/W3cSvg/PaintServers/GradientColorPaintServer.cs +++ b/src/Atc.Wpf/Controls/Media/W3cSvg/PaintServers/GradientColorPaintServer.cs @@ -105,7 +105,7 @@ protected GradientColorPaintServer( continue; } - if (!stopOpacity.Equals(1)) + if (!stopOpacity.IsEqual(1)) { color = Color.FromArgb( (byte)(stopOpacity * 255), diff --git a/src/Atc.Wpf/Documents/TextFormatters/RtfFormatter.cs b/src/Atc.Wpf/Documents/TextFormatters/RtfFormatter.cs index 64552ac0..2824b008 100644 --- a/src/Atc.Wpf/Documents/TextFormatters/RtfFormatter.cs +++ b/src/Atc.Wpf/Documents/TextFormatters/RtfFormatter.cs @@ -49,9 +49,9 @@ public void SetText( tr.Load(memoryStream, DataFormats.Rtf); } } - catch + catch (Exception ex) { - throw new InvalidDataException("Data provided is not in the correct RTF format."); + throw new InvalidDataException("Data provided is not in the correct RTF format.", ex); } } } \ No newline at end of file diff --git a/src/Atc.Wpf/Structs/PanelUvSize.cs b/src/Atc.Wpf/Structs/PanelUvSize.cs index fa7713e3..62c6701b 100644 --- a/src/Atc.Wpf/Structs/PanelUvSize.cs +++ b/src/Atc.Wpf/Structs/PanelUvSize.cs @@ -79,8 +79,8 @@ private set => !(left == right); public readonly bool Equals(PanelUvSize other) - => U.Equals(other.U) && - V.Equals(other.V); + => U.IsEqual(other.U) && + V.IsEqual(other.V); public override readonly bool Equals(object? obj) => obj is PanelUvSize x && Equals(x); diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c29e7f62..fe5cf6a2 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -35,8 +35,6 @@ embedded false - - true