6 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 72ad7d9e36 chore(release): 2.0.2 (#29)
- Version 2.0.2; CHANGELOG [2.0.2] - 2026-10-26 (also the release and in-app update notes):
  the .NET 10.0.14 security update as the minimum runtime, Microsoft.Extensions 10.0.14.
- Lock files refreshed for the project versions.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:29:38 +00:00
poli0981andClaude Opus 5.5 ec4046c385 chore(deps): require .NET 10.0.14, update Microsoft.Extensions, CsWin32 and CI actions (#28)
.NET 10.0.14 (October 25, 2026) is an out-of-band security release
(CVE-2026-111497 Brotli decoder, re-issued CVE-2026-70197 and
CVE-2026-102870).

- Velopack framework dependency net10-x64-desktop -> net10.0.14-x64-desktop:
  Setup and the in-app updater install the latest .NET 10 Desktop Runtime
  when only an older patch is present (the updater asks first, silent: false).
- Microsoft.Extensions.* 10.0.13 -> 10.0.14, SDK 10.0.401 -> 10.0.403.
- Microsoft.Windows.CsWin32 0.3.363 -> 0.3.367 (build-time only).
- markdownlint-cli2-action v25.0.0, codeql-action/upload-sarif v4.39.1,
  zizmor-action v0.8.0.
- DependencyManifestTests: THIRD_PARTY_NOTICES.md must list exactly the
  app's locked packages at their locked versions, and vpk must match the
  Velopack library.
- README, RELEASING, PRIVACY, notices and release body mention the minimum
  runtime patch.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:15:29 +00:00
poli0981andClaude Opus 5.5 f345769e75 refactor: follow the analyzer suggestions SonarQube Cloud reports (#27)
The first CI-based analysis of main imported 104 info-level Roslyn
suggestions as issues (Sonar's own rules found nothing). Applied the fixes
the IDE offers, one diagnostic at a time:

- IDE0290: primary constructors (28 types). Fields stay readonly and are
  initialized from the parameters; <param> docs moved to the type.
- MVVMTK0042: [ObservableProperty] on public partial properties instead of
  fields (70 properties); initializers still set the backing field silently.
  UpdateViewModel's constructor now sets Status through the property, before
  anything subscribes.
- SYSLIB1054: CreateDirect3D11DeviceFromDXGIDevice uses [LibraryImport].
- IDE0007 / IDE0028: var, collection expression.
- Tests: index the monitor list directly (CA1826); seal
  ResxLocalizationServiceTests like the other disposable test classes (CA1816).
- Long primary-constructor parameter lists are wrapped one per line.
- CLAUDE.md: note that SonarQube Cloud reports these suggestions.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 06:38:16 +07:00
poli0981andClaude Opus 5.5 d14d64241e ci: SonarQube Cloud CI-based analysis with coverage; audit .NET tools (#26)
* ci: run SonarQube Cloud analysis in CI with coverage

- New `sonarcloud` job: SonarScanner for .NET 12.0.0 (local tool) begin, build,
  tests with Cobertura coverage and TRX results, end, which waits for the
  quality gate. It passes without analysing when SONAR_TOKEN is not available
  (fork and Dependabot pull requests).
- Coverage leaves out CaptureImage.UI and CaptureImage.App, which ui-tests and
  publish-smoke exercise out of process.
- audit: check the .NET tools in .config/dotnet-tools.json against nuget.org's
  vulnerability data (tool-audit.ps1); neither NuGet's audit nor the dependency
  graph covers them.
- Dependabot: update dotnet-sonarscanner with the dev-tools group.
- Tests: await the async File APIs inside async tests (Sonar S6966).
- Docs: CLAUDE.md, CONTRIBUTING, ARCHITECTURE, SECURITY, README badges, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(sonarcloud): leave CI scripts out of coverage, skip non-main branch runs

- PR 26's gate failed only on coverage: SonarQube Cloud counts PowerShell as
  coverable code, so the 60 lines of tool-audit.ps1 were new, uncovered code.
  `.github/**` joins the coverage exclusions.
- The free plan analyses main and pull requests only; a workflow_dispatch run
  on another branch uploaded its report and then failed with "Organization is
  not allowed to access data from non main branches". Such runs now pass
  without analysing, like runs without SONAR_TOKEN.
- Icons and PNGs are project items the scanner read as UTF-8 text; exclude
  them from the analysis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 06:19:41 +07:00
poli0981andClaude Opus 5.5 926dfd2d72 fix: 2.0.1 — clipboard-only errors, HDR infinity pixels, Steam scan retry, readable About page (#25)
* fix: clipboard-only errors, non-finite HDR pixels, Steam scan retry, readable pages

- Clipboard-only captures that could not be copied were reported as successful although
  nothing was saved or copied; they now fail with the new CaptureError.ClipboardFailure and
  its message in all 11 languages.
- The HDR tone mapper turned +infinity into black (inf / inf = NaN) and let a NaN channel
  skip the highlight roll-off. Channels are now read as 0 for NaN/negative values and capped
  at the largest half value, so infinite highlights become white.
- SteamLibraryScanner cached a failed scan in its Lazy<T> and rethrew it on every lookup.
  An unreadable library is now skipped, and a failed scan is retried a minute later.
- Pages set the theme's text colour as their Foreground: a Page in a Frame does not inherit
  it, so unstyled text (About's component names and disclaimer headings) was drawn dim grey.
- The library grid lays thumbnails out from the left edge (SpacingMode None) instead of
  spreading the leftover width around them.
- About: the capture notice no longer mentions the GDI PrintWindow fallback removed in 2.0.0,
  and the translation notice points to src/CaptureImage.ViewModels/Resources/Strings/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): 2.0.1

- Version 2.0.1; CHANGELOG [2.0.1] - 2026-10-19 (also the release and in-app update notes).
- Lock files refreshed for the project versions.
- README screenshots re-rendered with 2.0.1 (demo data, hidden desktop): readable About text and
  the left-aligned library grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:58:46 +07:00
poli0981andClaude Opus 5.5 999694c4b8 ci(release): write SHA256SUMS without hashing the file being written (#24)
Out-File creates SHA256SUMS.txt when the pipeline starts, so Get-ChildItem listed
the open file and Get-FileHash failed on it, which stopped the v2.0.0 release after
packing. Hash the assets first, then write the file, and leave the sums file out of
its own list.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:48:18 +07:00
102 changed files with 1135 additions and 713 deletions

No files matched your search

+7
View File
@@ -36,6 +36,13 @@
"dotnet-CycloneDX"
],
"rollForward": false
},
"dotnet-sonarscanner": {
"version": "12.0.0",
"commands": [
"dotnet-sonarscanner"
],
"rollForward": false
}
}
}
+4
View File
@@ -8,6 +8,9 @@ version: 2
# Desktop packages differently: if a PR fails `restore --locked-mode`, run
# `dotnet restore CaptureImage.sln --force-evaluate` on Windows and push the
# lock files.
#
# Dependabot pull requests get no repository secrets, so the `sonarcloud` check
# passes without analysing them; main is analysed after the merge.
updates:
- package-ecosystem: nuget
@@ -64,6 +67,7 @@ updates:
- "nuget-license"
- "dotnet-reportgenerator-globaltool"
- "cyclonedx"
- "dotnet-sonarscanner"
- package-ecosystem: github-actions
directory: "/"
+106
View File
@@ -0,0 +1,106 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) CaptureImage Contributors
#
# NuGet's audit only checks package references, and GitHub's dependency graph doesn't read
# .config/dotnet-tools.json, so nothing else watches the local tools (vpk, the Sonar scanner, ...).
# The CI `audit` job runs this script: it looks up every tool version in nuget.org's
# vulnerability data (the data NuGetAudit uses), fails on any finding (any severity) and lists
# them in the job summary.
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string] $Manifest,
[string] $ServiceIndex = 'https://api.nuget.org/v3/index.json'
)
$ErrorActionPreference = 'Stop'
# A NuGet version: up to four numbers, an optional pre-release label; build metadata is ignored.
function Split-NuGetVersion([string] $Version) {
$release, $label = ($Version.Trim() -split '\+', 2)[0] -split '-', 2
$parts = [long[]]($release -split '\.')
$numbers = [long[]]::new(4)
[Array]::Copy($parts, $numbers, $parts.Count)
[pscustomobject]@{ Numbers = $numbers; Label = $label }
}
# -1, 0 or 1. A release sorts after its pre-releases; labels compare part by part (SemVer 2.0).
function Compare-NuGetVersion([string] $Left, [string] $Right) {
$a = Split-NuGetVersion $Left
$b = Split-NuGetVersion $Right
for ($i = 0; $i -lt 4; $i++) {
if ($a.Numbers[$i] -ne $b.Numbers[$i]) { return [Math]::Sign($a.Numbers[$i] - $b.Numbers[$i]) }
}
if ($a.Label -eq $b.Label) { return 0 }
if (-not $a.Label) { return 1 }
if (-not $b.Label) { return -1 }
$x = $a.Label -split '\.'
$y = $b.Label -split '\.'
for ($i = 0; $i -lt [Math]::Min($x.Count, $y.Count); $i++) {
$xIsNumber = $x[$i] -match '^\d+$'
$yIsNumber = $y[$i] -match '^\d+$'
$order = if ($xIsNumber -and $yIsNumber) { ([long]$x[$i]).CompareTo([long]$y[$i]) }
elseif ($xIsNumber) { -1 }
elseif ($yIsNumber) { 1 }
else { [string]::Compare($x[$i], $y[$i], [StringComparison]::OrdinalIgnoreCase) }
if ($order -ne 0) { return [Math]::Sign($order) }
}
return [Math]::Sign($x.Count - $y.Count)
}
# NuGet range notation: "1.0" (minimum, inclusive), "[1.0]" (exact), "[1.0, 2.0)", "(, 2.0]", ...
function Test-VersionInRange([string] $Version, [string] $Range) {
$Range = $Range.Trim()
if ($Range -notmatch '^[\[(]') { return (Compare-NuGetVersion $Version $Range) -ge 0 }
$inner = $Range.Substring(1, $Range.Length - 2)
if ($inner -notmatch ',') { return (Compare-NuGetVersion $Version $inner) -eq 0 }
$min, $max = $inner -split ',', 2 | ForEach-Object { $_.Trim() }
if ($min) {
$order = Compare-NuGetVersion $Version $min
if ($order -lt 0 -or ($order -eq 0 -and $Range[0] -eq '(')) { return $false }
}
if ($max) {
$order = Compare-NuGetVersion $Version $max
if ($order -gt 0 -or ($order -eq 0 -and $Range[-1] -eq ')')) { return $false }
}
return $true
}
$tools = @((Get-Content -Raw -LiteralPath $Manifest | ConvertFrom-Json).tools.PSObject.Properties)
$resource = (Invoke-RestMethod -Uri $ServiceIndex).resources |
Where-Object { $_.'@type' -like 'VulnerabilityInfo/*' } | Select-Object -First 1
if (-not $resource) { throw "$ServiceIndex has no VulnerabilityInfo resource." }
$severities = 'Low', 'Moderate', 'High', 'Critical'
$rows = @()
# The data comes in pages (a base file plus updates), each keyed by lower-case package id.
# Invoke-RestMethod returns a JSON array as one object; `foreach` enumerates it.
$pages = Invoke-RestMethod -Uri $resource.'@id'
foreach ($page in $pages) {
$advisories = Invoke-RestMethod -Uri $page.'@id'
foreach ($tool in $tools) {
foreach ($advisory in @($advisories.($tool.Name.ToLowerInvariant()))) {
if (-not $advisory -or -not (Test-VersionInRange $tool.Value.version $advisory.versions)) { continue }
$rows += [pscustomobject]@{
Tool = $tool.Name
Version = $tool.Value.version
Severity = $severities[[int]$advisory.severity]
Advisory = $advisory.url
}
}
}
}
$rows = @($rows | Sort-Object Tool, Version, Advisory -Unique)
$summary = @('## Tool vulnerability audit', '', "Tools checked: **$($tools.Count)**, vulnerable: **$($rows.Count)**", '')
if ($rows.Count -gt 0) {
$summary += '| Tool | Version | Severity | Advisory |', '|---|---|---|---|'
foreach ($r in $rows) {
$summary += "| $($r.Tool) | $($r.Version) | $($r.Severity) | $($r.Advisory) |"
Write-Output "::error title=Vulnerable tool::$($r.Tool) $($r.Version) ($($r.Severity)) $($r.Advisory)"
}
}
if ($env:GITHUB_STEP_SUMMARY) { $summary | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
else { $summary | Write-Output }
if ($rows.Count -gt 0) { exit 1 }
+110
View File
@@ -77,6 +77,110 @@ jobs:
coverage-report/**
retention-days: 14
# SonarQube Cloud, CI-based analysis (automatic analysis is off in the project settings).
# Its own build: `begin` turns TreatWarningsAsErrors off, which `build` must keep. The job
# fails when the quality gate fails. Runs that can't be analysed pass without analysing:
# fork and Dependabot pull requests get no SONAR_TOKEN (main is analysed after the merge),
# and the free plan analyses only main and pull requests, not other branches.
sonarcloud:
name: sonarcloud
runs-on: windows-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Analyse this run?
id: sonar
shell: pwsh
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
run: |
$skip = ''
if ([string]::IsNullOrEmpty($env:SONAR_TOKEN)) { $skip = 'no SONAR_TOKEN (fork or Dependabot pull request)' }
elseif ($env:EVENT_NAME -ne 'pull_request' -and $env:REF -ne 'refs/heads/main') { $skip = "only main and pull requests are analysed, not $env:REF" }
"analyse=$(([string]::IsNullOrEmpty($skip)).ToString().ToLowerInvariant())" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
if ($skip) { "::notice title=sonarcloud::Analysis skipped: $skip." }
- name: Checkout
if: steps.sonar.outputs.analyse == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # full history: new code is found with git blame
persist-credentials: false
- name: Setup .NET
if: steps.sonar.outputs.analyse == 'true'
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
global-json-file: global.json
cache: true
cache-dependency-path: "**/packages.lock.json"
# The scanner downloads its engine, a JRE and the analyzers from SonarQube Cloud.
- name: Cache SonarQube Cloud downloads
if: steps.sonar.outputs.analyse == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.sonar/cache
key: sonar-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }}
restore-keys: sonar-${{ runner.os }}-
- name: Restore (locked)
if: steps.sonar.outputs.analyse == 'true'
run: dotnet restore CaptureImage.sln --locked-mode
- name: Restore tools
if: steps.sonar.outputs.analyse == 'true'
run: dotnet tool restore
- name: Project version
id: version
if: steps.sonar.outputs.analyse == 'true'
shell: pwsh
run: |
[xml]$props = Get-Content Directory.Build.props
$version = @($props.Project.PropertyGroup | ForEach-Object { $_.Version } | Where-Object { $_ })[0]
if (-not $version) { throw 'Directory.Build.props has no <Version>.' }
"version=$version" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
# The project version marks where new code starts (new code = since the previous version).
# Not counted for coverage: CaptureImage.UI (the WPF shell) and CaptureImage.App (the host),
# which the FlaUI tests and the published-app smoke test exercise out of process, and the
# CI scripts under .github. Icons and images are project items but not text.
- name: SonarScanner begin
if: steps.sonar.outputs.analyse == 'true'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: >
dotnet sonarscanner begin /k:poli0981_captureimg /o:poli0981 "/v:$env:VERSION"
"/d:sonar.token=$env:SONAR_TOKEN"
"/d:sonar.cs.cobertura.reportsPaths=TestResults/*.cobertura.xml"
"/d:sonar.cs.vstest.reportsPaths=TestResults/*.trx"
"/d:sonar.coverage.exclusions=src/CaptureImage.UI/**,src/CaptureImage.App/**,.github/**"
"/d:sonar.exclusions=**/*.ico,**/*.png"
/d:sonar.qualitygate.wait=true
- name: Build
if: steps.sonar.outputs.analyse == 'true'
run: dotnet build CaptureImage.sln -c Release --no-restore --no-incremental --disable-build-servers
- name: Test with coverage
if: steps.sonar.outputs.analyse == 'true'
run: >
dotnet test --solution CaptureImage.sln -c Release --no-build
--results-directory TestResults
--coverage --coverage-output-format cobertura
--report-xunit-trx
- name: SonarScanner end (waits for the quality gate)
if: steps.sonar.outputs.analyse == 'true'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end "/d:sonar.token=$env:SONAR_TOKEN"
format:
name: format
runs-on: windows-latest
@@ -184,6 +288,12 @@ jobs:
dotnet list CaptureImage.sln package --vulnerable --include-transitive --format json --output-version 1 > vulnerable.json
./.github/scripts/vulnerability-gate.ps1 -Report vulnerable.json
# The local tools (vpk, the Sonar scanner, …) are neither package references nor in the
# dependency graph, so neither NuGet's audit nor Dependabot alerts cover them.
- name: Vulnerable tools (.config/dotnet-tools.json)
shell: pwsh
run: ./.github/scripts/tool-audit.ps1 -Manifest .config/dotnet-tools.json
- name: Deprecated / outdated packages (report only)
if: always()
shell: pwsh
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
persist-credentials: false
- name: markdownlint
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
uses: DavidAnson/markdownlint-cli2-action@696eb3f2509270d7b882d2aa68347bc676e7af34 # v25.0.0
with:
globs: |
**/*.md
+11 -6
View File
@@ -43,8 +43,10 @@ env:
PACK_TITLE: CaptureImage
MAIN_EXE: CaptureImage.App.exe
CHANNEL: win
# Installed by Setup / the updater when missing (the app is framework-dependent).
RUNTIME: net10-x64-desktop
# The app is framework-dependent: Setup and the updater install the latest .NET 10 Desktop
# Runtime when none is installed or only one older than this patch. Raise it with .NET
# security releases (10.0.14: October 25, 2026 out-of-band update).
RUNTIME: net10.0.14-x64-desktop
jobs:
build:
@@ -163,9 +165,12 @@ jobs:
--filename "CaptureImage-$env:VERSION-sbom.cdx.json" --output-format Json `
--set-name CaptureImage --set-version $env:VERSION --exclude-test-projects
Push-Location dist
Get-ChildItem -File | Sort-Object Name | ForEach-Object {
# Hash first, then write: Out-File creates SHA256SUMS.txt as soon as the pipeline
# starts, so it would otherwise list (and fail to read) its own output file.
$sums = Get-ChildItem -File | Where-Object Name -ne 'SHA256SUMS.txt' | Sort-Object Name | ForEach-Object {
"$((Get-FileHash $_.Name -Algorithm SHA256).Hash.ToLowerInvariant()) $($_.Name)"
} | Out-File SHA256SUMS.txt -Encoding utf8
}
$sums | Out-File SHA256SUMS.txt -Encoding utf8
Get-Content SHA256SUMS.txt
Pop-Location
@@ -179,8 +184,8 @@ jobs:
"## CaptureImage v$env:VERSION", '',
(Get-Content release-notes.md -Raw), '',
'### Downloads',
'- **`CaptureImage-win-Setup.exe`** — installer (per-user). Windows 11 22H2 or later; installs the .NET 10 Desktop Runtime if it is missing.',
'- **`CaptureImage-win-Portable.zip`** — extract-and-run build without installer (needs the [.NET 10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/10.0)).',
'- **`CaptureImage-win-Setup.exe`** — installer (per-user). Windows 11 22H2 or later; installs the .NET 10 Desktop Runtime (10.0.14 or later) if it is missing or older.',
'- **`CaptureImage-win-Portable.zip`** — extract-and-run build without installer (needs the [.NET 10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/10.0) 10.0.14 or later).',
'- **`*-full.nupkg`**, **`releases.win.json`** — update feed used by the in-app updater.',
'- **`SHA256SUMS.txt`**, **`*-sbom.cdx.json`** — checksums and CycloneDX SBOM.', '',
'### Verify the download',
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
publish_results: true
- name: Upload to code scanning
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: scorecard.sarif
category: scorecard
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
./actionlint -color
- name: zizmor
uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
with:
version: "1.31.1"
advanced-security: false
+3
View File
@@ -50,6 +50,9 @@ _Pvt_Extensions/
packages/
!packages/build/
# SonarScanner for .NET working folder
.sonarqube/
# Test results / coverage / build logs
TestResults/
coverage*.xml
+44
View File
@@ -7,6 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.0.2] - 2026-10-26
### Security
- CaptureImage now needs the .NET 10 Desktop Runtime **10.0.14 or later**, the .NET security update
of October 25, 2026. Setup and the in-app updater install it when your PC has an older one, so
this update may first ask to install it (Windows asks for administrator approval). With the
portable zip, install it yourself from <https://dotnet.microsoft.com/download/dotnet/10.0>.
- The Microsoft.Extensions libraries that ship with the app are updated to 10.0.14 from the same
security update.
### Project
- SonarQube Cloud analyses every pull request and `main` in CI (SonarScanner for .NET 12) instead
of automatic analysis, with test coverage and test results imported; its quality gate is a
required check.
- The dependency audit also checks the .NET tools used to build and release the app.
- Code follows the analyzer suggestions SonarQube Cloud reports: primary constructors, view-model
state as partial properties, source-generated P/Invoke.
- Builds use the .NET 10.0.403 SDK and CsWin32 0.3.367; the markdownlint, CodeQL SARIF upload and
zizmor actions are updated.
- A test keeps the third-party notices in step with the packages the app ships, and the `vpk`
release tool in step with the Velopack library.
## [2.0.1] - 2026-10-19
### Fixed
- With **Clipboard mode: copy only**, a capture that couldn't be copied (for example while another
app was holding the clipboard) was reported as a success although nothing was saved or copied.
It now shows an error.
- On HDR displays, pixels a game reported as infinitely bright came out black instead of white, and
an invalid colour value stopped the highlights next to it from rolling off smoothly.
- A Steam library folder that couldn't be read (for example on a disconnected drive) broke Steam
detection for every window until the app was restarted. That library is now skipped, and a failed
scan is tried again a minute later.
- Text without a style of its own — such as the component names and the disclaimer headings on the
About page — was drawn in a dim grey instead of the theme's text colour, which was hard to read in
the dark theme.
- The capture library lays its thumbnails out from the left edge instead of spreading wide gaps
around them.
- About: the capture notice no longer mentions the GDI fallback that 2.0.0 removed, and the
translation notice points to the folder where the language files now live.
## [2.0.0] - 2026-10-19
CaptureImage 2.0 is a rewrite of the app around the same idea: arm the hotkeys, press one in
+25 -11
View File
@@ -18,7 +18,7 @@ dotnet test --solution CaptureImage.sln -c Release --no-build # Microsoft.Test
dotnet run --project src/CaptureImage.App -c Release -- --data-dir .\.devdata --instance-id dev
```
- SDK pinned in `global.json` (10.0.401, `latestFeature`). Tests are xunit.v3 on
- SDK pinned in `global.json` (10.0.403, `latestFeature`). Tests are xunit.v3 on
Microsoft.Testing.Platform: use `--report-xunit-trx` and
`--coverage --coverage-output-format cobertura` (there is no `--logger trx`).
- **Never run a dev build against real user data.** Always pass `--data-dir <temp>` and
@@ -29,7 +29,7 @@ dotnet run --project src/CaptureImage.App -c Release -- --data-dir .\.devdata --
- UI tests (`tests/CaptureImage.App.UiTests`, FlaUI) move the mouse and type; they skip unless
`CAPTUREIMAGE_UI_TESTS=1`. Don't run them on the maintainer's desktop.
- Local tools (`dotnet tool restore`): `vpk`, `jb` (InspectCode), `nuget-license`,
`reportgenerator`, `dotnet-CycloneDX`.
`reportgenerator`, `dotnet-CycloneDX`, `dotnet-sonarscanner` (CI only; needs `SONAR_TOKEN`).
## Layout and layering rules
@@ -60,7 +60,13 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
`dotnet format style --diagnostics IDE0073 IDE0161 IDE0065 IDE0005`. A plain `dotnet format`
deletes XAML event handlers.
- Pass `CancellationToken`s through (SonarCloud S8949); tests use
`TestContext.Current.CancellationToken` (xUnit1051).
`TestContext.Current.CancellationToken` (xUnit1051), and async tests await the async `File`
APIs (S6966).
- SonarQube Cloud imports the build's info-level analyzer suggestions as issues, so follow them:
primary constructors that keep `readonly` fields (IDE0290), `var` (IDE0007),
`[ObservableProperty]` on `public partial` properties rather than fields (MVVMTK0042),
`[LibraryImport]` rather than `[DllImport]` (SYSLIB1054). Fixers for one diagnostic at a time are
safe: `dotnet format style|analyzers --diagnostics <ID> --severity info`.
## Pitfalls already hit
@@ -80,15 +86,22 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
- `main` is protected by a ruleset: PR required, signed commits, linear history, squash merge only
(PR title = commit subject, Conventional Commits), branch up to date, no bypass. Release tags `v*`
can't be moved or deleted.
- Required checks: `build`, `format`, `deadcode` (InspectCode, file-local rules), `audit`,
`license` (shipped dependencies vs `.github/license/allowed-licenses.json`), `publish-smoke`
(publish + `--smoke-test` + page screenshots artifact), `pr-title`, `dependency-review`,
`workflow-lint` (actionlint + zizmor), `docs` (markdownlint + offline lychee), `ui-tests` (FlaUI
against the built app), plus CodeQL via the code-scanning rule.
- Required checks: `build`, `format`, `deadcode` (InspectCode, file-local rules), `audit`
(NuGet packages + the local tools in `.config/dotnet-tools.json`), `license` (shipped
dependencies vs `.github/license/allowed-licenses.json`), `publish-smoke` (publish +
`--smoke-test` + page screenshots artifact), `pr-title`, `dependency-review`, `workflow-lint`
(actionlint + zizmor), `docs` (markdownlint + offline lychee), `ui-tests` (FlaUI against the
built app), `sonarcloud`, plus CodeQL via the code-scanning rule.
- Never add `paths:` filters to a workflow that provides a required check. Actions are pinned to
full commit SHAs with a `# vX.Y.Z` comment.
- SonarCloud (automatic analysis, project `poli0981_captureimg`) comments on PRs — fix what it
reports.
- SonarQube Cloud (project `poli0981_captureimg`, org `poli0981`) runs as CI-based analysis in the
`sonarcloud` job (automatic analysis is off): `dotnet sonarscanner` begin → build → tests with
Cobertura coverage + TRX → end, which waits for the quality gate ("Sonar way": no new issues,
≥ 80 % coverage on new code). `CaptureImage.UI`, `CaptureImage.App` (tested out of process by
`ui-tests`/`publish-smoke`) and `.github/**` scripts are excluded from coverage. The job passes
without analysing when it can't analyse: no `SONAR_TOKEN` in fork and Dependabot PRs, and the free
plan analyses only `main` and PRs (a non-PR run on another branch fails "not allowed to access
data from non main branches"). Fix what it reports.
- Dependabot NuGet updates rely on `EnableWindowsTargeting=true` in `Directory.Build.props` (the
updater runs on Linux).
- NuGet prunes the WPF projects' Windows Desktop packages (System.Drawing.Common, EventLog, …) only
@@ -105,7 +118,8 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
2. After the PR merges: `git tag -s vX.Y.Z -m "…"` and push the tag.
3. `release.yml` builds, tests, publishes framework-dependent, smoke-tests, packs with Velopack
(`packId CaptureImage`, `mainExe CaptureImage.App.exe`, channel `win`, `--framework
net10-x64-desktop` — never change the first three), attaches SBOM, SHA256SUMS and provenance
net10.0.14-x64-desktop` — never change the first three; the framework names the minimum runtime
patch, raised with .NET security releases), attaches SBOM, SHA256SUMS and provenance
attestations, and creates a **draft** release.
4. Verify the draft (see `docs/RELEASING.md`), then `gh release edit vX.Y.Z --draft=false`.
+7 -2
View File
@@ -42,10 +42,15 @@ Every pull request must pass the required checks before it can be merged (squash
- **build** — warnings are errors, the recommended .NET analyzers are on for `src/`, all tests pass.
- **format** — `dotnet format whitespace` and the style rules below.
- **deadcode** — JetBrains InspectCode finds no unused or redundant code.
- **audit** / **license** — no vulnerable packages; shipped dependencies use a GPL-compatible
license.
- **audit** / **license** — no vulnerable packages or .NET tools; shipped dependencies use a
GPL-compatible license.
- **publish-smoke** — the published app starts and opens every page.
- **ui-tests** — end-to-end tests drive the built app through UI Automation (FlaUI).
- **sonarcloud** — the [SonarQube Cloud](https://sonarcloud.io/project/overview?id=poli0981_captureimg)
quality gate: no new issues and at least 80 % test coverage on new code (the WPF shell in
`CaptureImage.UI`, the `CaptureImage.App` host and the CI scripts are left out of coverage; the
UI tests cover the first two). Pull requests from forks are analysed after they are merged,
because the analysis needs a repository secret.
- **pr-title** — the title follows [Conventional Commits](https://www.conventionalcommits.org/), e.g.
`fix(capture): keep alpha opaque` or `feat(ui)!: …` for breaking changes.
- **dependency-review**, **workflow-lint**, **docs**.
+1 -1
View File
@@ -34,7 +34,7 @@
</PropertyGroup>
<PropertyGroup Label="Version (single source of truth — the release workflow checks the tag against it)">
<Version>2.0.0</Version>
<Version>2.0.2</Version>
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^\d+\.\d+\.\d+').Value).0</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
+6 -6
View File
@@ -15,11 +15,11 @@
</ItemGroup>
<ItemGroup Label="Microsoft.Extensions">
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.14" />
</ItemGroup>
<ItemGroup Label="Logging">
@@ -33,7 +33,7 @@
<PackageVersion Include="Vortice.Direct3D11" Version="3.8.3" />
<PackageVersion Include="Vortice.DXGI" Version="3.8.3" />
<PackageVersion Include="Vortice.Direct2D1" Version="3.8.3" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.363" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.367" />
</ItemGroup>
<ItemGroup Label="Imaging">
+4 -2
View File
@@ -5,6 +5,8 @@
[![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0--or--later-blue.svg)](LICENSE)
[![.NET 10](https://img.shields.io/badge/.NET-10.0-512BD4.svg)](https://dotnet.microsoft.com/download/dotnet/10.0)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/poli0981/captureimg/badge)](https://securityscorecards.dev/viewer/?uri=github.com/poli0981/captureimg)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=poli0981_captureimg&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=poli0981_captureimg)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=poli0981_captureimg&metric=coverage)](https://sonarcloud.io/component_measures?id=poli0981_captureimg&metric=coverage)
A lightweight Windows screenshot tool for games that don't have their own screenshot key.
It sits in the tray, stays out of the way, and takes a clean capture when you press a hotkey.
@@ -68,8 +70,8 @@ small tray app that does nothing until you press a hotkey.
## Requirements
- **Windows 11 22H2 or later** (build 22621+), 64-bit.
- **.NET 10 Desktop Runtime** — installed automatically by Setup and by the in-app updater when it
is missing. The portable zip needs it installed
- **.NET 10 Desktop Runtime 10.0.14 or later** — installed automatically by Setup and by the in-app
updater when it is missing or older. The portable zip needs it installed
([download](https://dotnet.microsoft.com/download/dotnet/10.0)).
## Install
+2 -1
View File
@@ -65,7 +65,8 @@ targets rather than guarantees.
## Supply chain
- Dependencies are pinned centrally with lock files; Dependabot proposes updates after a cooldown,
and every pull request is checked for known-vulnerable and incompatibly licensed packages.
and every pull request is checked for known-vulnerable packages and build tools and for
incompatibly licensed packages.
- GitHub Actions are pinned to full commit SHAs and linted with actionlint and zizmor; CodeQL,
OpenSSF Scorecard and SonarCloud review the code.
- Releases are built by GitHub Actions from signed tags and ship with SHA-256 checksums, a CycloneDX
+6 -4
View File
@@ -191,7 +191,9 @@ shortcuts never change, so installed copies keep updating. See [RELEASING.md](RE
Every pull request runs: build with warnings as errors and the recommended .NET analyzers; unit,
view-model and integration tests with coverage; formatting and SPDX headers; JetBrains InspectCode
(dead and redundant code); vulnerable and incompatibly licensed dependencies; a publish of the app
followed by a smoke test that opens every page; PR title; dependency review; workflow lint
(actionlint, zizmor); Markdown lint and link check. End-to-end UI tests (FlaUI), CodeQL, OpenSSF
Scorecard and SonarCloud run as well.
(dead and redundant code); vulnerable dependencies and .NET tools, and incompatibly licensed
dependencies; a publish of the app followed by a smoke test that opens every page; end-to-end UI
tests (FlaUI); the SonarQube Cloud quality gate (CI-based analysis with test coverage: no new
issues, at least 80 % coverage on new code outside the WPF shell, the host and the CI scripts); PR
title; dependency review; workflow lint (actionlint, zizmor); Markdown lint and link check. CodeQL
and OpenSSF Scorecard run as well.
+1 -1
View File
@@ -36,7 +36,7 @@ The workflow then:
3. publishes the app (framework-dependent, `win-x64`) and runs it with `--smoke-test`;
4. packs it with Velopack (`vpk`, same version as the library): package id `CaptureImage`, main
executable `CaptureImage.App.exe`, channel `win`, shortcuts on the desktop and Start menu, the
.NET 10 Desktop Runtime as a prerequisite, full packages only;
.NET 10 Desktop Runtime (minimum patch from `RUNTIME`) as a prerequisite, full packages only;
5. adds a CycloneDX SBOM and `SHA256SUMS.txt`, attests build provenance, and creates or updates a
**draft** release with all assets.
+3 -2
View File
@@ -1,6 +1,6 @@
# Privacy Policy
_Last updated: 2026-10-19 (CaptureImage 2.0)_
_Last updated: 2026-10-26 (CaptureImage 2.0.2)_
This policy describes what **CaptureImage** reads on your computer, what it stores, and what it
sends over the network. It applies to the official builds published on the project's
@@ -79,7 +79,8 @@ No identifiers, cookies or system information are sent beyond what any HTTPS req
IP address and a standard user agent). GitHub may log these requests under
[its own privacy statement](https://docs.github.com/site-policy/privacy-policies/github-general-privacy-statement).
When the .NET Desktop Runtime is missing, Setup and the updater download it from Microsoft.
When the .NET Desktop Runtime is missing or older than the app needs, Setup and the updater
download it from Microsoft.
Links in the About page open in your browser; the app itself does not fetch them.
CaptureImage does **not** send crash reports, contact analytics or license servers, upload
+29 -29
View File
@@ -1,6 +1,6 @@
# Third-party Notices
_Last updated: 2026-10-19 (CaptureImage 2.0)_
_Last updated: 2026-10-26 (CaptureImage 2.0.2)_
CaptureImage is built on open-source components. This file lists every package that ships with
the app, with its license and upstream project; the short form is the repository root
@@ -37,33 +37,33 @@ within licenses compatible with **GPL-3.0-or-later**.
| Package | Version | License | Project |
|---|---|---|---|
| Microsoft.Extensions.Configuration | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Binder | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.CommandLine | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.EnvironmentVariables | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.FileExtensions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Json | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.UserSecrets | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.DependencyInjection | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.DependencyInjection.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Diagnostics | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Diagnostics.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileProviders.Physical | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileSystemGlobbing | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Hosting | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Hosting.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Configuration | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Console | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Debug | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.EventLog | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.EventSource | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Options | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Options.ConfigurationExtensions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Primitives | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Binder | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.CommandLine | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.EnvironmentVariables | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.FileExtensions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.Json | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Configuration.UserSecrets | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.DependencyInjection | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.DependencyInjection.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Diagnostics | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Diagnostics.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileProviders.Physical | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.FileSystemGlobbing | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Hosting | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Hosting.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Configuration | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Console | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.Debug | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.EventLog | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Logging.EventSource | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Options | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Options.ConfigurationExtensions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
| Microsoft.Extensions.Primitives | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
## Logging
@@ -84,7 +84,7 @@ within licenses compatible with **GPL-3.0-or-later**.
| Component | License | Project |
|---|---|---|
| .NET 10 Desktop Runtime (installed separately by Setup when missing) | MIT | <https://github.com/dotnet/runtime> |
| .NET 10 Desktop Runtime, 10.0.14 or later (installed separately by Setup when missing) | MIT | <https://github.com/dotnet/runtime> |
| Windows SDK projection for .NET (`Microsoft.Windows.SDK.NET`, C#/WinRT) | MIT | <https://github.com/microsoft/CsWinRT> |
| Fluent System Icons (font embedded in WPF UI) | MIT | <https://github.com/microsoft/fluentui-system-icons> |
Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.401",
"version": "10.0.403",
"rollForward": "latestFeature",
"allowPrerelease": false
},
+164 -164
View File
@@ -10,32 +10,32 @@
},
"Microsoft.Extensions.Hosting": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "Q+hmPoDqeHipHyJcY7mDCQiLDUcn9jIgjoCThcgaOgjLTTT3ApTe8p6M2+twsDyfKuuCsKhSNlnNjaaggtXxRA==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "q3f2GLZebtxWG/pDtckPrgIWV22pVmSLSLEkncdmbUz7Z6atwF2wn9ag5cZCc/ndcGe7ffHJom98scauFG+oNQ==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
"Microsoft.Extensions.Configuration.CommandLine": "10.0.13",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "10.0.13",
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
"Microsoft.Extensions.Configuration.Json": "10.0.13",
"Microsoft.Extensions.Configuration.UserSecrets": "10.0.13",
"Microsoft.Extensions.DependencyInjection": "10.0.13",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Diagnostics": "10.0.13",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
"Microsoft.Extensions.Hosting.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
"Microsoft.Extensions.Logging.Console": "10.0.13",
"Microsoft.Extensions.Logging.Debug": "10.0.13",
"Microsoft.Extensions.Logging.EventLog": "10.0.13",
"Microsoft.Extensions.Logging.EventSource": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
"Microsoft.Extensions.Configuration.CommandLine": "10.0.14",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "10.0.14",
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.14",
"Microsoft.Extensions.Configuration.Json": "10.0.14",
"Microsoft.Extensions.Configuration.UserSecrets": "10.0.14",
"Microsoft.Extensions.DependencyInjection": "10.0.14",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Diagnostics": "10.0.14",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
"Microsoft.Extensions.FileProviders.Physical": "10.0.14",
"Microsoft.Extensions.Hosting.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging.Configuration": "10.0.14",
"Microsoft.Extensions.Logging.Console": "10.0.14",
"Microsoft.Extensions.Logging.Debug": "10.0.14",
"Microsoft.Extensions.Logging.EventLog": "10.0.14",
"Microsoft.Extensions.Logging.EventSource": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14"
}
},
"Serilog": {
@@ -93,221 +93,221 @@
},
"Microsoft.Extensions.Configuration": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "inhujYI/nikhmLxYI6ZEcaCgZ28ipJsKMPPxxr2XWf3vM0Q2P+E9R3hDHABZOLBxzD3gjpgcbSH/+hd2+gvI2A==",
"resolved": "10.0.14",
"contentHash": "UcnvaEaMvRckDDhyqY1OZkFwBqpZArkHFKB6dWaQWT9XTuNttNNX8Cqsb/Sic2LfJxsMLJUXnYrxY3iX5LN9pQ==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.Abstractions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "DY4C2qzTt2lOIY3VoscBH/TCwTolI5DKOfgJLuI+k1QUvRNT5vTMS58AOerNiihdVRStO0wEpLeRWA8jytzHBQ==",
"resolved": "10.0.14",
"contentHash": "4YdfvaoWn3tB1xQQHGrhRTFWJ8fGOqxThxduynSZy9ZFTiSaUi3vX4EK/kj8h2HQMwTlks9MWV1fv2WRBv5/1w==",
"dependencies": {
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.Binder": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "yJJl/b0+W+GEWbu+7viw6C3h2BoNkB69Vlz7s/4e+hm4mYbJqfhdcDSi9sCXJw47blsBaiQd3UDPgDtop92+ug==",
"resolved": "10.0.14",
"contentHash": "brDb5kgle2iY2lWHgeV/KOqnBEpVnlMFigGJ/WW7KP9Nj6C/t53f/h5boYyVXB0bEhgpL+ctbewDJMI+zAMj1w==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.CommandLine": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "RwdNZ9JdGs8eZmeL5qRe7ugp0Irk3KVkWpC/w1c8kjJwu1R4HvCXYz9kwHZxn45WiaRBG5lphQKtqnBaJOQC+Q==",
"resolved": "10.0.14",
"contentHash": "/9IqkBeB7mE1enbN4Cfeu4HFPU9uR1JSJh2qwXfwr7SYBxETkTKRht/LoPfajmmlh+BJlH3jm79CLhQPFb9ovw==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "qJK2dm9/AxyPVfqqBaZtjkUFl2hnBR/CQnMJtSO5LdEoyATMqvZjeQVY+8l0oa6PM6qlVe28iMEyXIRQ0wyZjA==",
"resolved": "10.0.14",
"contentHash": "jB0UiYjpnneoBH1ZeXPlHYt4zUme6SZlnstL6gsH/0O/d5rOuN5lSIlOIfxXzapl8tAi7QmYOEogP09g/wcHzA==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.FileExtensions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "kwC1DY55CsqPmDtJAz+7alD3G+gJcM+XwHSZrcRO8mJGYB9hRq1qC6ZH8DL0SPW9WtJ/Bae5ikzPic8SxSv6Vw==",
"resolved": "10.0.14",
"contentHash": "NBIfm8vWNi3UJ9OI9thvREJeV6KzEdPjQ4ONdH+yPWutGBpVnwLbXiEqdEFaGAFYpAluGCfyCwKFgH9pd2scfw==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
"Microsoft.Extensions.FileProviders.Physical": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.Json": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "acCWM2+WR67kBAz6gAhD2zG+IZH9Q2VpKv5le7Msiu0vAMsnnLXpnV3BAzxd8/i+uOEo/dfb2XRYTynRVTDvEg==",
"resolved": "10.0.14",
"contentHash": "4Tn8eNg85x+ICDN4OLC7Dl/xvZNREZIf7VSOAdT4Q4KYf5Ip1zAk+0BAx8BsRTomgEpCYV4kKsNNnP/ZXUbQkw==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.14",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Configuration.UserSecrets": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "kQ/Tx972unP+ueQL8SSninthIj6w6XP2o0VnJPFC5HQIimPMwEN704MOspEgDkmm4FUL5SuxLEU0bNiW4HEZFA==",
"resolved": "10.0.14",
"contentHash": "z+dvl9uQnNzvq6Xco+UQyeujpP/BHs+ahHLPCBMxR5GW6M4JcsN1tupEgn5uWgR1fGCfmxS4QJEMt6eyizXGUA==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Configuration.Json": "10.0.13",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
"Microsoft.Extensions.FileProviders.Physical": "10.0.13"
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Configuration.Json": "10.0.14",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
"Microsoft.Extensions.FileProviders.Physical": "10.0.14"
}
},
"Microsoft.Extensions.Diagnostics": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "J9ODOrffj1mK3Et69elNsLGRguesPxvThTdVpFmQX7fLNPhIOgqHQfLdGnTBEwNAV3yf8yiyVlpDZNw2qN87Nw==",
"resolved": "10.0.14",
"contentHash": "80VqW8eKxQaxBOLDNpLUdxOlxzWn/jqBSxNBCfD8GCjcshNDpFvUgKh8uvvZwvkfBbwmNPWPWHyy9F+RLd1dlQ==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.14",
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.14"
}
},
"Microsoft.Extensions.Diagnostics.Abstractions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "oZzqZze8ed1fLS20HtIrkPxQXGRG/koq09srIw2ptnDHm9RHfwB++d35hosB/cXc55TH7Pshv85O0txongjCIg==",
"resolved": "10.0.14",
"contentHash": "vm+PPso6vOwGeX52MdOPh6z/R6KHgxQUwqq7k7Jc9jhy2JOxO2KB4xfoJQBBp2Ni8M4zKgJ4r2a1dgrYG7+MKw==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14"
}
},
"Microsoft.Extensions.FileProviders.Abstractions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "BZDwtN3uoWRghDi5lRRZPDjMMCg2Ds7J6YEYjqka/TLjqnzquEpXyvchrIMeoubwT1ns23ow6PPeAoBHJO81Rw==",
"resolved": "10.0.14",
"contentHash": "rAqf2Em2ZjLqNbcLJlboQnXNyJP604F960TsCKNiP00Ur6ExIc1mcwmNb8L2eTRT8RC8UKx/GjecoWcW2Sj7bw==",
"dependencies": {
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.FileProviders.Physical": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "U7HkgGCNPICN5k7NVK6dmLsSPSPeO/EbNcuxOl/5qdC9Ahjp9UZWKOvlnUC+rYurmoxIlwyv9e5j0BaQlTOELA==",
"resolved": "10.0.14",
"contentHash": "dcp6eCIk6ZpE3CTNmIna0ifgxsPel/MtOc23/Y/AJlD9SZZr7bhlKK2DAXYlrz81yMkMi6el/LHHUFKCZ3ufuQ==",
"dependencies": {
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
"Microsoft.Extensions.FileSystemGlobbing": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
"Microsoft.Extensions.FileSystemGlobbing": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.FileSystemGlobbing": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "vQVzmAbnzlhXSXA2caYnlxtG9GXxEwtj5bODiWLu06A6iqeJmfBtlfKjuOSJGRy0/CFaNUrm7u9nxEUlljc2Rg=="
"resolved": "10.0.14",
"contentHash": "xt6c/PWLL6+CiBiZA3PWRSfkwcPh+HCwiOLrgSUkhzBT7lrT/+QpIKPeuCQyDPspwOuG1q0cbJhuiGpRjr4UNQ=="
},
"Microsoft.Extensions.Hosting.Abstractions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "zIrbe9vkIFXxW3mOApIOWXw+xMwX7Cgsptr3ZSlglJt4hW2qp4fB/JU1NHgAevteBNH4PicvU9DsFPHxlnnloA==",
"resolved": "10.0.14",
"contentHash": "p6NUEkmlaB+FujQZTtyNBKFULQO+Fj8SKuYdYHASQso+RkeYdFDPNsMM4mtOHqx1GZNQnZm/inmsqGkja/Dw2w==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.14",
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Logging.Configuration": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "OyYJOaE9WbBx1Hp+Dd2zrqeFM0JwH5M/x0VL6tNUv3V18vIAVpix8UjhvY9eW/iXpguEHy68JO/Z9YkBOwftIw==",
"resolved": "10.0.14",
"contentHash": "CfFSNbVSXSl8UTH453c0HoY5owcpaY1PMh1xsB+3NWcEq6WUSPHRotydbnMJtmw7Kybp6cTba8e+/uaJI52ANw==",
"dependencies": {
"Microsoft.Extensions.Configuration": "10.0.13",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13",
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
"Microsoft.Extensions.Configuration": "10.0.14",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14",
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.14"
}
},
"Microsoft.Extensions.Logging.Console": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "i9rn0rHkiCxfNVbf4DRG7LOFcKPy/BioAxS07w6daWvIpLNRjskqDJcGGaYVFWndsq0iTRaS8Msry0t5fRYQug==",
"resolved": "10.0.14",
"contentHash": "8Qx57p3sUAajSZHLQf8eihZqMtSIeI4fZ1JVpL4fvg4QqSbbgJkN0X0owX1cVJJRW2Xw4uqtVv9F7LgdXOBQHQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging.Configuration": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14"
}
},
"Microsoft.Extensions.Logging.Debug": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "yBig0DNMq+3UgliwxYlUC48dg0fPqvqI5B3ljzmLTrpR6maoKTOO5i9QnPgQUmQoaQWZMgu74fuF6oSDihb6pg==",
"resolved": "10.0.14",
"contentHash": "8e79uonXzgIsZbdgc5pa2Ybk5W+vUbd+gfGS50E+BW9ApRv9s0qL1DTyqLv7VQEPxTHS/l8Y0AtS7K8do+TczQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.Logging.EventLog": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "OAK40lXhgMuvyNwvzW3fxLvvucN8yr5XS7dQRcPmtnPf+Pt1lpbMgao5T4Wa6VdFagtIeDZNgPtV5Ig4xstziQ==",
"resolved": "10.0.14",
"contentHash": "4HbWayQiJdw0lYthC45rElah2mJJeSlHDu3rcIrinGe95JdOt6I/vWQTNUFXiujIsHv3Z8MyA79ZC5P1Ww+jNg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14"
}
},
"Microsoft.Extensions.Logging.EventSource": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "SxJu3oczk+TJtHvpgAmCVzEkzx69/obA6GZCbGrbqYqc981YOAyfEprySBdFX7Yc5qatHJKHNTlpGeeBAQkZcA==",
"resolved": "10.0.14",
"contentHash": "Q06Q90D3qnrsKtf1QlaMELCED3ZdMV5SGIRIERUQTTSCoqTNKSitx3KMRgLdxBeqI5ZcbOu5InOu6xQ6o6zmUg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Logging": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Logging": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "tmMJgdrE4uhf1JcNs9CV9moAHW+hmDuvgMiPpnQxarKaUxqI2eN33sYK5S4l9Uw+rG9PJvlm4qPxMhvolTDTaQ==",
"resolved": "10.0.14",
"contentHash": "EeN/33S418m9oWEaZY4N5T+BNxtOqNTIFoFbIgBKwylh4OJPKIWFAzbIhpTdNbwUs26MhkmbLCAbdY+YCJ1dIQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Options.ConfigurationExtensions": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "xVO5HhATc09WXuS/RaDmx8ZeWS0mTpT1L0tkEDMSBHtAnNpNsDr0ge0wIO2jinCWWqpq5dL1tRTzpYNVlvyqLw==",
"resolved": "10.0.14",
"contentHash": "4wcIU0rE04ejEfCwHTftu9O8fgH6CRYCe+tseRapikUBn1Kic3QdO7ku22SwFyLrzdWGYPUZMEgv57ZYuuc5gA==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13",
"Microsoft.Extensions.Primitives": "10.0.13"
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14",
"Microsoft.Extensions.Primitives": "10.0.14"
}
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "10.0.13",
"contentHash": "ZjTwxzhiw2TMEzIbUDkMF0dfDB2I4NQgIfKD0ELu9/5Mk+SRGdKZcD0/lvBrRCAPo6KN2r0BW86MRancoyJkoA=="
"resolved": "10.0.14",
"contentHash": "1bbZqqCJTPba3inTADExbp/9PsGVyvGOX3zr6tFr7ySCgVkX9Lpw7BV0TizktNItd3SsbUu1sQfSAYm1GZMoNw=="
},
"SharpGen.Runtime": {
"type": "Transitive",
@@ -350,14 +350,14 @@
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"captureimage.infrastructure": {
"type": "Project",
"dependencies": {
"CaptureImage.Core": "[1.5.1, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )",
"CaptureImage.Core": "[2.0.2, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )",
"Serilog": "[4.4.0, )",
"SkiaSharp": "[4.153.1, )",
"Velopack": "[1.2.161, )",
@@ -369,22 +369,22 @@
"captureimage.ui": {
"type": "Project",
"dependencies": {
"CaptureImage.Core": "[1.5.1, )",
"CaptureImage.ViewModels": "[1.5.1, )",
"CaptureImage.Core": "[2.0.2, )",
"CaptureImage.ViewModels": "[2.0.2, )",
"CommunityToolkit.Mvvm": "[8.4.2, )",
"H.NotifyIcon.Wpf": "[2.4.1, )",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )",
"WPF-UI": "[4.3.0, )"
}
},
"captureimage.viewmodels": {
"type": "Project",
"dependencies": {
"CaptureImage.Core": "[1.5.1, )",
"CaptureImage.Core": "[2.0.2, )",
"CommunityToolkit.Mvvm": "[8.4.2, )",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"H.NotifyIcon.Wpf": {
@@ -398,37 +398,37 @@
},
"Microsoft.Extensions.DependencyInjection": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "4tnWU9vrU/A8NwYe9Z6wvieZ0EBb/uM82LAT+edNhdepOBWREZ7M7mzb941EIDPJaeOFdbVrDd5+7s9e89U6bQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "2LzcuVjemeXR+WdY9wGIr8iGb7fYsDAit+IScxXX2XJnX0b++mWcE/WO6fEGIqhdMfSQM2ZS5JGMHYZix7YXZg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
},
"Microsoft.Extensions.Logging": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "fqbiPy4nUp4H2XHKAVQXKN2y3T2h4cFIx1DAAgE6iY9OHkN/OA1cKFi+geJKRWGuX6pS5SFbsjIPWHJqrxE0eg==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "O2fXL6JmtkFwkigxS8fPTQpLXxGDjgZco5D+h88s++Cl0bDCs023PVkpNoifciJ+f30I82jnp8tpwF0wCLdFtA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "10.0.13",
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
"Microsoft.Extensions.Options": "10.0.13"
"Microsoft.Extensions.DependencyInjection": "10.0.14",
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
"Microsoft.Extensions.Options": "10.0.14"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"SkiaSharp": {
@@ -39,4 +39,7 @@ public enum CaptureError
/// <summary>Windows.Graphics.Capture is unavailable on this system.</summary>
NotSupported = 12,
/// <summary>A clipboard-only capture could not be copied (another app may hold the clipboard).</summary>
ClipboardFailure = 13,
}
+14 -3
View File
@@ -28,6 +28,7 @@ public static class HdrToneMapper
public const float KneeStart = 0.8f;
private const int LutSize = 4096;
private static readonly float MaxHalf = (float)Half.MaxValue;
private static readonly byte[] SrgbLut = BuildSrgbLut();
/// <summary>Return an 8-bit BGRA rendition of <paramref name="frame"/>; SDR frames are returned unchanged.</summary>
@@ -55,9 +56,9 @@ public static class HdrToneMapper
var dst = output.AsSpan(y * outStride, outStride);
for (var x = 0; x < width; x++)
{
var r = Math.Max(0f, (float)row[x * 4] * scale);
var g = Math.Max(0f, (float)row[(x * 4) + 1] * scale);
var b = Math.Max(0f, (float)row[(x * 4) + 2] * scale);
var r = Channel(row[x * 4], scale);
var g = Channel(row[(x * 4) + 1], scale);
var b = Channel(row[(x * 4) + 2], scale);
var max = Math.Max(r, Math.Max(g, b));
if (max > KneeStart)
@@ -94,6 +95,16 @@ public static class HdrToneMapper
public static float LinearToSrgb(float linear) =>
linear <= 0.0031308f ? 12.92f * linear : (1.055f * MathF.Pow(linear, 1f / 2.4f)) - 0.055f;
/// <summary>
/// One linear channel, rescaled. Negative values and NaN become 0; +infinity is capped at the
/// largest half value so the highlight shoulder takes it to white (∞ / ∞ would give NaN, i.e. black).
/// </summary>
private static float Channel(Half value, float scale)
{
var linear = (float)value;
return linear > 0f ? Math.Min(linear, MaxHalf) * scale : 0f;
}
private static byte Encode(float linear)
{
var index = (int)((linear * (LutSize - 1)) + 0.5f);
@@ -166,7 +166,7 @@ public sealed partial class CaptureCoordinator : IDisposable
}
// While suspended (hotkey recorder open) only remember the request; resuming registers.
IReadOnlyList<HotkeyRegistration> registrations = suspended ? [] : _hotkeys.Activate(hotkeys);
var registrations = suspended ? [] : _hotkeys.Activate(hotkeys);
lock (_gate)
{
_armed = true;
@@ -410,6 +410,11 @@ public sealed partial class CaptureCoordinator : IDisposable
var copied = clipboardMode != ClipboardMode.None
&& await _clipboard.CopyImageAsync(displayFrame, CancellationToken.None).ConfigureAwait(false);
if (clipboardMode == ClipboardMode.Copy && !copied)
{
// Nothing was written to disk either, so this is a failure, not a silent "success".
throw new CaptureException(CaptureError.ClipboardFailure, "The image could not be copied to the clipboard.");
}
AfterCapture(settings, displayFrame, record, copied, title);
return new CaptureOutcome(record is null ? CaptureOutcomeKind.Copied : CaptureOutcomeKind.Saved, mode) { Record = record };
@@ -36,20 +36,16 @@ public sealed record SaveRequest(
/// overwriting an existing file (a name stolen by a concurrent write is retried).
/// Encoding runs on the thread pool so callers on the UI thread never block.
/// </summary>
public sealed partial class CaptureFileWriter
public sealed partial class CaptureFileWriter(
IEnumerable<IImageEncoder> encoders,
FileNameStrategy fileNames,
ILogger<CaptureFileWriter> logger)
{
private const int MaxNameAttempts = 8;
private readonly IReadOnlyList<IImageEncoder> _encoders;
private readonly FileNameStrategy _fileNames;
private readonly ILogger<CaptureFileWriter> _logger;
public CaptureFileWriter(IEnumerable<IImageEncoder> encoders, FileNameStrategy fileNames, ILogger<CaptureFileWriter> logger)
{
_encoders = [.. encoders];
_fileNames = fileNames;
_logger = logger;
}
private readonly IReadOnlyList<IImageEncoder> _encoders = [.. encoders];
private readonly FileNameStrategy _fileNames = fileNames;
private readonly ILogger<CaptureFileWriter> _logger = logger;
public async Task<CaptureRecord> SaveAsync(SaveRequest request, CancellationToken cancellationToken = default)
{
@@ -21,7 +21,8 @@ namespace CaptureImage.Core.Pipeline;
/// reserved device names (CON, NUL, COM1…) get a trailing <c>_</c>; the name is capped at
/// <see cref="MaxNameLength"/> characters.</para>
/// </remarks>
public sealed class FileNameStrategy
/// <param name="fileExists">Existence check (injected so tests can fake collisions).</param>
public sealed class FileNameStrategy(Func<string, bool> fileExists)
{
/// <summary>Default template: <c>{Game}_{yyyy}-{MM}-{dd}_{HH}-{mm}-{ss}</c>.</summary>
public const string DefaultTemplate = "{Game}_{yyyy}-{MM}-{dd}_{HH}-{mm}-{ss}";
@@ -42,13 +43,7 @@ public sealed class FileNameStrategy
"COM¹", "COM²", "COM³", "LPT¹", "LPT²", "LPT³",
};
private readonly Func<string, bool> _fileExists;
/// <param name="fileExists">Existence check (injected so tests can fake collisions).</param>
public FileNameStrategy(Func<string, bool> fileExists)
{
_fileExists = fileExists;
}
private readonly Func<string, bool> _fileExists = fileExists;
/// <summary>
/// A full path under <paramref name="directory"/> that does not collide with an existing
+7 -7
View File
@@ -4,18 +4,18 @@
"net10.0": {
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
}
},
"net10.0/win-x64": {}
@@ -13,18 +13,13 @@ namespace CaptureImage.Infrastructure.Capture;
/// GPU reset or driver update the engine calls <see cref="Invalidate"/> and the next capture
/// gets a fresh device (v1 never recreated it, so every capture failed until restart).
/// </summary>
public sealed partial class D3D11DeviceManager : IDisposable
public sealed partial class D3D11DeviceManager(ILogger<D3D11DeviceManager> logger) : IDisposable
{
private readonly ILogger<D3D11DeviceManager> _logger;
private readonly ILogger<D3D11DeviceManager> _logger = logger;
private readonly Lock _gate = new();
private Session? _session;
private bool _disposed;
public D3D11DeviceManager(ILogger<D3D11DeviceManager> logger)
{
_logger = logger;
}
/// <summary>The device, its immediate context and the WinRT wrapper WGC needs.</summary>
internal sealed record Session(ID3D11Device Device, ID3D11DeviceContext Context, IDirect3DDevice WinRtDevice) : IDisposable
{
@@ -76,7 +71,7 @@ public sealed partial class D3D11DeviceManager : IDisposable
// usable GPU driver (virtual machines, CI runners).
FeatureLevel[] levels = [FeatureLevel.Level_11_1, FeatureLevel.Level_11_0];
var driver = DriverType.Hardware;
var result = D3D11.D3D11CreateDevice(null, driver, DeviceCreationFlags.BgraSupport, levels, out ID3D11Device device, out ID3D11DeviceContext context);
var result = D3D11.D3D11CreateDevice(null, driver, DeviceCreationFlags.BgraSupport, levels, out var device, out ID3D11DeviceContext context);
if (result.Failure)
{
driver = DriverType.Warp;
@@ -33,20 +33,16 @@ namespace CaptureImage.Infrastructure.Capture;
/// <item>8-bit frames are forced opaque so saved images are never see-through.</item>
/// </list>
/// </remarks>
public sealed partial class WgcCaptureEngine : ICaptureEngine, IDisposable
public sealed partial class WgcCaptureEngine(
D3D11DeviceManager devices,
ILogger<WgcCaptureEngine> logger) : ICaptureEngine, IDisposable
{
private static readonly TimeSpan FrameTimeout = TimeSpan.FromSeconds(3);
private readonly D3D11DeviceManager _devices;
private readonly ILogger<WgcCaptureEngine> _logger;
private readonly D3D11DeviceManager _devices = devices;
private readonly ILogger<WgcCaptureEngine> _logger = logger;
private readonly SemaphoreSlim _gate = new(1, 1);
public WgcCaptureEngine(D3D11DeviceManager devices, ILogger<WgcCaptureEngine> logger)
{
_devices = devices;
_logger = logger;
}
public async Task<CapturedFrame> CaptureAsync(CaptureSource source, CaptureOptions options, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(source);
@@ -15,7 +15,7 @@ namespace CaptureImage.Infrastructure.Capture;
/// vtable function pointers so no runtime-callable wrapper is created (v1 leaked one per
/// capture and kept full-size GPU textures alive until the next garbage collection).
/// </summary>
internal static unsafe class WinRtCaptureInterop
internal static unsafe partial class WinRtCaptureInterop
{
private const string GraphicsCaptureItemClass = "Windows.Graphics.Capture.GraphicsCaptureItem";
@@ -85,6 +85,6 @@ internal static unsafe class WinRtCaptureInterop
}
}
[DllImport("d3d11.dll", ExactSpelling = true)]
private static extern int CreateDirect3D11DeviceFromDXGIDevice(nint dxgiDevice, out nint graphicsDevice);
[LibraryImport("d3d11.dll")]
private static partial int CreateDirect3D11DeviceFromDXGIDevice(nint dxgiDevice, out nint graphicsDevice);
}
@@ -18,24 +18,20 @@ namespace CaptureImage.Infrastructure.Diagnostics;
/// system summary (Windows build, .NET, GPUs, monitors with DPI and HDR state). The user's
/// profile path is replaced with <c>%USERPROFILE%</c> in every text file.
/// </summary>
public sealed partial class DiagnosticsExporter : IDiagnosticsExporter
public sealed partial class DiagnosticsExporter(
AppPaths paths,
IDisplayService displays,
IUpdateService updates,
ILogger<DiagnosticsExporter> logger) : IDiagnosticsExporter
{
private const int MaxLogFiles = 5;
private readonly AppPaths _paths;
private readonly IDisplayService _displays;
private readonly IUpdateService _updates;
private readonly ILogger<DiagnosticsExporter> _logger;
private readonly AppPaths _paths = paths;
private readonly IDisplayService _displays = displays;
private readonly IUpdateService _updates = updates;
private readonly ILogger<DiagnosticsExporter> _logger = logger;
private readonly UserPathRedactionEnricher _redactor = new();
public DiagnosticsExporter(AppPaths paths, IDisplayService displays, IUpdateService updates, ILogger<DiagnosticsExporter> logger)
{
_paths = paths;
_displays = displays;
_updates = updates;
_logger = logger;
}
public string SuggestFileName() =>
$"CaptureImage-diagnostics-{DateTime.Now.ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}.zip";
@@ -10,16 +10,11 @@ using Vortice.WIC;
namespace CaptureImage.Infrastructure.Imaging;
/// <summary>Decodes PNG / JPEG / WebP / TIFF / JPEG XR files into BGRA frames with WIC.</summary>
public sealed partial class WicImageDecoder : IImageDecoder, IDisposable
public sealed partial class WicImageDecoder(ILogger<WicImageDecoder> logger) : IImageDecoder, IDisposable
{
private readonly ILogger<WicImageDecoder> _logger;
private readonly ILogger<WicImageDecoder> _logger = logger;
private readonly Lazy<IWICImagingFactory> _factory = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
public WicImageDecoder(ILogger<WicImageDecoder> logger)
{
_logger = logger;
}
public Task<CapturedFrame?> LoadAsync(string path, int maxDimension = 0, CancellationToken cancellationToken = default) =>
Task.Run(() => Load(path, maxDimension), cancellationToken);
@@ -21,27 +21,23 @@ namespace CaptureImage.Infrastructure.Library;
/// JPEG thumbnails. Files deleted outside the app drop out on the next read. The first time
/// the index is created, the output folders are scanned so captures made by v1 show up too.
/// </summary>
public sealed partial class CaptureLibraryService : ICaptureLibrary, IDisposable
public sealed partial class CaptureLibraryService(
AppPaths paths,
ISettingsStore settings,
IShellService shell,
ILogger<CaptureLibraryService> logger) : ICaptureLibrary, IDisposable
{
private const int MaxRecords = 2000;
private const int MaxSeededFiles = 500;
private readonly AppPaths _paths;
private readonly ISettingsStore _settings;
private readonly IShellService _shell;
private readonly ILogger<CaptureLibraryService> _logger;
private readonly AppPaths _paths = paths;
private readonly ISettingsStore _settings = settings;
private readonly IShellService _shell = shell;
private readonly ILogger<CaptureLibraryService> _logger = logger;
private readonly SemaphoreSlim _indexLock = new(1, 1);
private readonly Lazy<IWICImagingFactory> _wic = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
private List<CaptureRecord>? _records;
public CaptureLibraryService(AppPaths paths, ISettingsStore settings, IShellService shell, ILogger<CaptureLibraryService> logger)
{
_paths = paths;
_settings = settings;
_shell = shell;
_logger = logger;
}
public event EventHandler? Changed;
public async Task<IReadOnlyList<CaptureRecord>> GetAllAsync(CancellationToken cancellationToken = default)
@@ -9,14 +9,9 @@ using Serilog.Events;
namespace CaptureImage.Infrastructure.Logging;
/// <summary>Changes the live Serilog minimum level (no restart needed).</summary>
public sealed class SerilogLogLevelSwitcher : ILogLevelSwitcher
public sealed class SerilogLogLevelSwitcher(LoggingLevelSwitch levelSwitch) : ILogLevelSwitcher
{
private readonly LoggingLevelSwitch _levelSwitch;
public SerilogLogLevelSwitcher(LoggingLevelSwitch levelSwitch)
{
_levelSwitch = levelSwitch;
}
private readonly LoggingLevelSwitch _levelSwitch = levelSwitch;
public string CurrentLevel => _levelSwitch.MinimumLevel switch
{
@@ -20,16 +20,11 @@ namespace CaptureImage.Infrastructure.Ocr;
/// the engine limit are downscaled, engines are cached per language, and failures are
/// reported as failures instead of "no text found".
/// </summary>
public sealed partial class WindowsOcrService : IOcrService
public sealed partial class WindowsOcrService(ILogger<WindowsOcrService> logger) : IOcrService
{
private readonly ILogger<WindowsOcrService> _logger;
private readonly ILogger<WindowsOcrService> _logger = logger;
private readonly ConcurrentDictionary<string, OcrEngine?> _engines = new(StringComparer.OrdinalIgnoreCase);
public WindowsOcrService(ILogger<WindowsOcrService> logger)
{
_logger = logger;
}
public async Task<OcrResult> RecognizeAsync(CapturedFrame frame, string? languageTag, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(frame);
@@ -11,7 +11,7 @@ using Windows.Win32.UI.Shell;
namespace CaptureImage.Infrastructure.Platform;
/// <summary>Explorer, default-program and Recycle Bin integration.</summary>
public sealed partial class ShellService : IShellService
public sealed partial class ShellService(ILogger<ShellService> logger) : IShellService
{
private const uint FoDelete = 0x0003;
private const ushort FofSilent = 0x0004;
@@ -22,12 +22,7 @@ public sealed partial class ShellService : IShellService
private static readonly string ExplorerPath =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
private readonly ILogger<ShellService> _logger;
public ShellService(ILogger<ShellService> logger)
{
_logger = logger;
}
private readonly ILogger<ShellService> _logger = logger;
public bool Open(string path)
{
@@ -22,18 +22,13 @@ public sealed class SoundService : ISoundService
/// Windows 11 efficiency mode: EcoQoS plus below-normal priority while the app idles in the
/// tray. <see cref="BeginForegroundWork"/> lifts it for the duration of a capture.
/// </summary>
public sealed partial class PerformanceModeService : IPerformanceModeService
public sealed partial class PerformanceModeService(ILogger<PerformanceModeService> logger) : IPerformanceModeService
{
private readonly ILogger<PerformanceModeService> _logger;
private readonly ILogger<PerformanceModeService> _logger = logger;
private readonly Lock _gate = new();
private bool _background;
private int _foregroundWork;
public PerformanceModeService(ILogger<PerformanceModeService> logger)
{
_logger = logger;
}
public void SetBackground(bool isBackground)
{
lock (_gate)
@@ -112,17 +107,12 @@ public sealed partial class PerformanceModeService : IPerformanceModeService
/// "Start with Windows" via the per-user Run key. Points at the Velopack launcher in the
/// install root (stable across updates) when present, otherwise at the running executable.
/// </summary>
public sealed partial class AutostartService : IAutostartService
public sealed partial class AutostartService(ILogger<AutostartService> logger) : IAutostartService
{
private const string RunKey = @"Software\Microsoft\Windows\CurrentVersion\Run";
private const string ValueName = "CaptureImage";
private readonly ILogger<AutostartService> _logger;
public AutostartService(ILogger<AutostartService> logger)
{
_logger = logger;
}
private readonly ILogger<AutostartService> _logger = logger;
public bool IsEnabled
{
@@ -10,13 +10,25 @@ namespace CaptureImage.Infrastructure.Steam;
/// <summary>
/// Maps executables to installed Steam apps by reading <c>libraryfolders.vdf</c> and the
/// <c>appmanifest_*.acf</c> files of every library. Scanned once, lazily, thread-safe.
/// <c>appmanifest_*.acf</c> files of every library. Scanned once, lazily, thread-safe; a scan that
/// fails is retried a minute later rather than failing every lookup from then on.
/// </summary>
public sealed partial class SteamLibraryScanner : ISteamDetector
/// <param name="steamRoot">Returns Steam's install folder, or <c>null</c> when Steam isn't installed.</param>
/// <param name="logger">Logger.</param>
/// <param name="timeProvider">Clock for the retry delay (tests); the system clock by default.</param>
public sealed partial class SteamLibraryScanner(
Func<string?> steamRoot,
ILogger<SteamLibraryScanner> logger,
TimeProvider? timeProvider = null) : ISteamDetector
{
private readonly Func<string?> _steamRoot;
private readonly ILogger<SteamLibraryScanner> _logger;
private readonly Lazy<IReadOnlyList<SteamLibrary>> _libraries;
private static readonly TimeSpan RetryDelay = TimeSpan.FromMinutes(1);
private readonly Func<string?> _steamRoot = steamRoot;
private readonly ILogger<SteamLibraryScanner> _logger = logger;
private readonly TimeProvider _time = timeProvider ?? TimeProvider.System;
private readonly Lock _gate = new();
private IReadOnlyList<SteamLibrary>? _libraries;
private DateTimeOffset _retryAt = DateTimeOffset.MinValue;
/// <summary>Production constructor: Steam's install folder comes from the registry.</summary>
public SteamLibraryScanner(ILogger<SteamLibraryScanner> logger)
@@ -24,13 +36,37 @@ public sealed partial class SteamLibraryScanner : ISteamDetector
{
}
/// <param name="steamRoot">Returns Steam's install folder, or <c>null</c> when Steam isn't installed.</param>
/// <param name="logger">Logger.</param>
public SteamLibraryScanner(Func<string?> steamRoot, ILogger<SteamLibraryScanner> logger)
/// <summary>The scanned libraries, or none while a failed scan waits for its retry.</summary>
private IReadOnlyList<SteamLibrary> Libraries
{
_steamRoot = steamRoot;
_logger = logger;
_libraries = new Lazy<IReadOnlyList<SteamLibrary>>(LoadLibraries, LazyThreadSafetyMode.ExecutionAndPublication);
get
{
lock (_gate)
{
if (_libraries is not null)
{
return _libraries;
}
var now = _time.GetUtcNow();
if (now < _retryAt)
{
return [];
}
try
{
return _libraries = LoadLibraries();
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or System.Security.SecurityException
or ArgumentException or NotSupportedException or InvalidOperationException)
{
LogScanFailed(ex);
_retryAt = now + RetryDelay;
return [];
}
}
}
}
public SteamAppInfo? TryGetAppInfo(string executablePath)
@@ -50,7 +86,7 @@ public sealed partial class SteamLibraryScanner : ISteamDetector
return null;
}
foreach (var library in _libraries.Value)
foreach (var library in Libraries)
{
var common = Normalize(Path.Combine(library.Path, "steamapps", "common")) + Path.DirectorySeparatorChar;
if (!normalized.StartsWith(common, StringComparison.OrdinalIgnoreCase))
@@ -127,7 +163,19 @@ public sealed partial class SteamLibraryScanner : ISteamDetector
return apps;
}
foreach (var manifest in Directory.EnumerateFiles(steamapps, "appmanifest_*.acf"))
List<string> manifests;
try
{
manifests = [.. Directory.EnumerateFiles(steamapps, "appmanifest_*.acf")];
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or System.Security.SecurityException)
{
// One unreadable library (offline drive, no permission) must not hide the others.
LogLibraryUnreadable(ex, libraryPath);
return apps;
}
foreach (var manifest in manifests)
{
try
{
@@ -162,4 +210,10 @@ public sealed partial class SteamLibraryScanner : ISteamDetector
[LoggerMessage(Level = LogLevel.Information, Message = "Steam scan: {LibraryCount} libraries, {AppCount} installed apps.")]
private partial void LogScanned(int libraryCount, int appCount);
[LoggerMessage(Level = LogLevel.Warning, Message = "Could not read Steam library {LibraryPath}; skipping it.")]
private partial void LogLibraryUnreadable(Exception exception, string libraryPath);
[LoggerMessage(Level = LogLevel.Warning, Message = "Steam scan failed; trying again in a minute.")]
private partial void LogScanFailed(Exception exception);
}
@@ -119,13 +119,11 @@ public static class VdfParser
}
/// <summary>Cursor over the input text with helpers for quoted strings and trivia.</summary>
private sealed class VdfReader
private sealed class VdfReader(string text)
{
private readonly string _text;
private readonly string _text = text;
private int _pos;
public VdfReader(string text) { _text = text; _pos = 0; }
public int Position => _pos;
public bool Eof => _pos >= _text.Length;
@@ -213,12 +211,7 @@ public static class VdfParser
}
/// <summary>Thrown when a VDF document fails to parse.</summary>
public sealed class VdfParseException : FormatException
public sealed class VdfParseException(string message, int position) : FormatException(message)
{
public int Position { get; }
public VdfParseException(string message, int position) : base(message)
{
Position = position;
}
public int Position { get; } = position;
}
@@ -19,19 +19,14 @@ namespace CaptureImage.Infrastructure.Windowing;
/// DXGI adapter (hybrid-GPU laptops attach outputs to different adapters) and recreates the
/// DXGI factory when Windows reports it stale (HDR toggled, display plugged in).
/// </summary>
public sealed partial class DisplayService : IDisplayService, IDisposable
public sealed partial class DisplayService(ILogger<DisplayService> logger) : IDisplayService, IDisposable
{
private const uint MonitorDefaultToNearest = 2;
private readonly ILogger<DisplayService> _logger;
private readonly ILogger<DisplayService> _logger = logger;
private readonly Lock _gate = new();
private IDXGIFactory1? _factory;
public DisplayService(ILogger<DisplayService> logger)
{
_logger = logger;
}
public IReadOnlyList<MonitorInfo> GetMonitors()
{
var handles = new List<HMONITOR>(4);
@@ -16,22 +16,17 @@ namespace CaptureImage.Infrastructure.Windowing;
/// file when it has none. Results (including failures) are cached per path in a bounded
/// least-recently-used cache, so long sessions don't grow without limit.
/// </summary>
public sealed partial class IconExtractor : IDisposable
public sealed partial class IconExtractor(ILogger<IconExtractor> logger) : IDisposable
{
private const int Capacity = 256;
private const uint IconSize = 48;
private readonly ILogger<IconExtractor> _logger;
private readonly ILogger<IconExtractor> _logger = logger;
private readonly Lock _gate = new();
private readonly Dictionary<string, LinkedListNode<(string Path, byte[]? Png)>> _index = new(StringComparer.OrdinalIgnoreCase);
private readonly LinkedList<(string Path, byte[]? Png)> _order = new();
private readonly Lazy<IWICImagingFactory> _factory = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
public IconExtractor(ILogger<IconExtractor> logger)
{
_logger = logger;
}
public byte[]? TryGetIconPngBytes(string executablePath)
{
if (string.IsNullOrWhiteSpace(executablePath))
@@ -21,25 +21,21 @@ namespace CaptureImage.Infrastructure.Windowing;
/// also works for elevated processes (v1 used <c>Process.MainModule</c>, which throws for
/// games running as administrator and left them without icon or Steam badge).
/// </summary>
public sealed unsafe partial class TargetCatalog : ITargetCatalog
public sealed unsafe partial class TargetCatalog(
IconExtractor icons,
ISteamDetector steam,
ILogger<TargetCatalog> logger) : ITargetCatalog
{
private static readonly HashSet<string> ShellWindowClasses = new(StringComparer.Ordinal)
{
"Progman", "WorkerW", "Shell_TrayWnd", "Shell_SecondaryTrayWnd", "Windows.UI.Core.CoreWindow",
};
private readonly IconExtractor _icons;
private readonly ISteamDetector _steam;
private readonly ILogger<TargetCatalog> _logger;
private readonly IconExtractor _icons = icons;
private readonly ISteamDetector _steam = steam;
private readonly ILogger<TargetCatalog> _logger = logger;
private readonly uint _ownProcessId = (uint)Environment.ProcessId;
public TargetCatalog(IconExtractor icons, ISteamDetector steam, ILogger<TargetCatalog> logger)
{
_icons = icons;
_steam = steam;
_logger = logger;
}
public Task<IReadOnlyList<GameTarget>> EnumerateAsync(CancellationToken cancellationToken = default) =>
Task.Run<IReadOnlyList<GameTarget>>(() =>
{
@@ -4,21 +4,21 @@
"net10.0-windows10.0.22621": {
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"Microsoft.Windows.CsWin32": {
"type": "Direct",
"requested": "[0.3.363, )",
"resolved": "0.3.363",
"contentHash": "Fd1p6Fr5H6A+c4FO033CojR8jKsvYZm6vigrKvB/auI40KXb0Vb+ge0F6baGBZptc1yIKVxmh/Iu8/KvLVQ94A==",
"requested": "[0.3.367, )",
"resolved": "0.3.367",
"contentHash": "C4JVE3wmVjCvzpdBzC+HK/boVU6g4ZRDEZ7uDmMJHCkgjFHhiMb9vhe2+wffzWzyNNObpCsIAW4G1t+1CAIEWw==",
"dependencies": {
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
"Microsoft.Windows.SDK.Win32Metadata": "71.0.30-preview",
"Microsoft.Windows.SDK.Win32Metadata": "71.0.37-preview",
"Microsoft.Windows.WDK.Win32Metadata": "0.13.25-experimental"
}
},
@@ -80,8 +80,8 @@
},
"Microsoft.Windows.SDK.Win32Metadata": {
"type": "Transitive",
"resolved": "71.0.30-preview",
"contentHash": "h/FD+SrIlxgr+HD/WrJnLvpTdyWFAX7F0FCMPRxPJFTt4Qz70wGXKEBZvvIDX7om4hP0Tb7O0s1ND3aUvigL8g=="
"resolved": "71.0.37-preview",
"contentHash": "0y4uKnOzE+k2zUCxcTOJTOuRuOFiW01A+j1GpjyN11saEjkESLW9XrWkGYG/zdlAAb8oRk4oLdokkcx0X2z7yA=="
},
"Microsoft.Windows.WDK.Win32Metadata": {
"type": "Transitive",
@@ -127,14 +127,14 @@
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
}
},
"net10.0-windows10.0.22621/win-x64": {
+1 -1
View File
@@ -72,7 +72,7 @@ public sealed class InverseBoolConverter : IValueConverter
/// <summary>PNG bytes (window icons) → image, cached per byte array.</summary>
public sealed class BytesToImageConverter : IValueConverter
{
private static readonly ConditionalWeakTable<byte[], BitmapImage> Cache = new();
private static readonly ConditionalWeakTable<byte[], BitmapImage> Cache = [];
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
+1
View File
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.About;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_About}"
d:DataContext="{d:DesignInstance Type=vm:AboutViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="AboutPage"
mc:Ignorable="d">
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Dashboard;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Dashboard}"
d:DataContext="{d:DesignInstance Type=vm:DashboardViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="DashboardPage"
mc:Ignorable="d">
+2 -1
View File
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Library;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Library}"
d:DataContext="{d:DesignInstance Type=vm:LibraryViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="LibraryPage"
mc:Ignorable="d">
@@ -82,7 +83,7 @@
VirtualizingPanel.VirtualizationMode="Recycling">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<ui:VirtualizingWrapPanel ItemSize="232,190" SpacingMode="Uniform" />
<ui:VirtualizingWrapPanel ItemSize="232,190" SpacingMode="None" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
+1
View File
@@ -10,6 +10,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Logs;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Logs}"
d:DataContext="{d:DesignInstance Type=vm:LogViewerViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="LogsPage"
mc:Ignorable="d">
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Profiles;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Profiles}"
d:DataContext="{d:DesignInstance Type=vm:ProfilesViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="ProfilesPage"
mc:Ignorable="d">
@@ -10,6 +10,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Settings;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Settings}"
d:DataContext="{d:DesignInstance Type=vm:SettingsViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="SettingsPage"
mc:Ignorable="d">
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:CaptureImage.ViewModels.Update;assembly=CaptureImage.ViewModels"
Title="{loc:Tr Nav_Update}"
d:DataContext="{d:DesignInstance Type=vm:UpdateViewModel}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
AutomationProperties.AutomationId="UpdatePage"
mc:Ignorable="d">
+17 -17
View File
@@ -19,27 +19,27 @@
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"Microsoft.Windows.CsWin32": {
"type": "Direct",
"requested": "[0.3.363, )",
"resolved": "0.3.363",
"contentHash": "Fd1p6Fr5H6A+c4FO033CojR8jKsvYZm6vigrKvB/auI40KXb0Vb+ge0F6baGBZptc1yIKVxmh/Iu8/KvLVQ94A==",
"requested": "[0.3.367, )",
"resolved": "0.3.367",
"contentHash": "C4JVE3wmVjCvzpdBzC+HK/boVU6g4ZRDEZ7uDmMJHCkgjFHhiMb9vhe2+wffzWzyNNObpCsIAW4G1t+1CAIEWw==",
"dependencies": {
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
"Microsoft.Windows.SDK.Win32Metadata": "71.0.30-preview",
"Microsoft.Windows.SDK.Win32Metadata": "71.0.37-preview",
"Microsoft.Windows.WDK.Win32Metadata": "0.13.25-experimental"
}
},
@@ -72,8 +72,8 @@
},
"Microsoft.Windows.SDK.Win32Metadata": {
"type": "Transitive",
"resolved": "71.0.30-preview",
"contentHash": "h/FD+SrIlxgr+HD/WrJnLvpTdyWFAX7F0FCMPRxPJFTt4Qz70wGXKEBZvvIDX7om4hP0Tb7O0s1ND3aUvigL8g=="
"resolved": "71.0.37-preview",
"contentHash": "0y4uKnOzE+k2zUCxcTOJTOuRuOFiW01A+j1GpjyN11saEjkESLW9XrWkGYG/zdlAAb8oRk4oLdokkcx0X2z7yA=="
},
"Microsoft.Windows.WDK.Win32Metadata": {
"type": "Transitive",
@@ -91,16 +91,16 @@
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"captureimage.viewmodels": {
"type": "Project",
"dependencies": {
"CaptureImage.Core": "[1.5.1, )",
"CaptureImage.Core": "[2.0.2, )",
"CommunityToolkit.Mvvm": "[8.4.2, )",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
}
},
@@ -17,25 +17,21 @@ public sealed record SponsorLink(string Name, Uri Url);
/// <summary>
/// About page: version, contact, links, sponsors, legal documents and third-party notices.
/// </summary>
public sealed partial class AboutViewModel : ViewModelBase
public sealed partial class AboutViewModel(
IShellService shell,
ILocalizationService localization,
AppInfo appInfo) : ViewModelBase
{
public const string RepositoryUrl = "https://github.com/poli0981/captureimg";
public const string ContactEmail = "contact@poli0981.dev";
public const string SponsorEmail = "sponsor@poli0981.dev";
public const string LinksPageUrl = "https://poli0981.dev/links";
private readonly IShellService _shell;
private readonly IShellService _shell = shell;
public AboutViewModel(IShellService shell, ILocalizationService localization, AppInfo appInfo)
{
_shell = shell;
Localization = localization;
AppInfo = appInfo;
}
public ILocalizationService Localization { get; } = localization;
public ILocalizationService Localization { get; }
public AppInfo AppInfo { get; }
public AppInfo AppInfo { get; } = appInfo;
public string AppName => "CaptureImage";
@@ -78,30 +78,30 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
public ObservableCollection<HotkeyStatusItem> Hotkeys { get; } = [];
[ObservableProperty]
private string _searchText = string.Empty;
public partial string SearchText { get; set; } = string.Empty;
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(CaptureSelectedCommand), nameof(LockSelectedCommand), nameof(CreateProfileCommand))]
private TargetItemViewModel? _selectedTarget;
public partial TargetItemViewModel? SelectedTarget { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(HasNoTargets))]
private bool _isLoading;
public partial bool IsLoading { get; set; }
[ObservableProperty]
private bool _isArmed;
public partial bool IsArmed { get; set; }
[ObservableProperty]
private bool _isBusy;
public partial bool IsBusy { get; set; }
[ObservableProperty]
private string _statusText = string.Empty;
public partial string StatusText { get; set; } = string.Empty;
[ObservableProperty]
private string? _lockedTargetName;
public partial string? LockedTargetName { get; set; }
[ObservableProperty]
private bool _hasHotkeyProblem;
public partial bool HasHotkeyProblem { get; set; }
public bool HasNoTargets => !IsLoading && Targets.Count == 0;
@@ -8,24 +8,18 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace CaptureImage.ViewModels.Dashboard;
/// <summary>One capturable window in the Dashboard list. Updated in place on refresh.</summary>
public sealed partial class TargetItemViewModel : ViewModelBase
public sealed partial class TargetItemViewModel(GameTarget target, ILocalizationService localization) : ViewModelBase
{
private readonly ILocalizationService _localization;
private readonly ILocalizationService _localization = localization;
[ObservableProperty]
private GameTarget _target;
public partial GameTarget Target { get; set; } = target;
[ObservableProperty]
private string? _profileName;
public partial string? ProfileName { get; set; }
[ObservableProperty]
private bool _isLocked;
public TargetItemViewModel(GameTarget target, ILocalizationService localization)
{
_target = target;
_localization = localization;
}
public partial bool IsLocked { get; set; }
public nint WindowHandle => Target.WindowHandle;
@@ -15,20 +15,14 @@ using Microsoft.Extensions.Logging;
namespace CaptureImage.ViewModels.Library;
/// <summary>One saved capture in the Library grid. The thumbnail loads the first time the view asks for it.</summary>
public sealed partial class CaptureItemViewModel : ViewModelBase
public sealed partial class CaptureItemViewModel(CaptureRecord record, ICaptureLibrary library) : ViewModelBase
{
private const int ThumbnailSize = 320;
private readonly ICaptureLibrary _library;
private readonly ICaptureLibrary _library = library;
private bool _thumbnailRequested;
private string? _thumbnailPath;
public CaptureItemViewModel(CaptureRecord record, ICaptureLibrary library)
{
Record = record;
_library = library;
}
public CaptureRecord Record { get; }
public CaptureRecord Record { get; } = record;
public string FileName => Record.FileName;
@@ -130,25 +124,25 @@ public sealed partial class LibraryViewModel : ViewModelBase, IDisposable
public ObservableCollection<string> Games { get; } = [];
[ObservableProperty]
private string _searchText = string.Empty;
public partial string SearchText { get; set; } = string.Empty;
[ObservableProperty]
private string? _selectedGame;
public partial string? SelectedGame { get; set; }
[ObservableProperty]
private bool _hdrOnly;
public partial bool HdrOnly { get; set; }
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(OpenCommand), nameof(RevealCommand), nameof(CopyImageCommand), nameof(CopyPathCommand),
nameof(ExtractTextCommand), nameof(PinCommand), nameof(DeleteCommand), nameof(OpenHdrCommand))]
private CaptureItemViewModel? _selectedItem;
public partial CaptureItemViewModel? SelectedItem { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsEmpty))]
private bool _isLoading;
public partial bool IsLoading { get; set; }
[ObservableProperty]
private string _summaryText = string.Empty;
public partial string SummaryText { get; set; } = string.Empty;
public bool IsEmpty => !IsLoading && Items.Count == 0;
@@ -15,7 +15,7 @@ namespace CaptureImage.ViewModels.Localization;
/// this assembly. Drives live culture switching: XAML binds to the indexer, and every
/// change raises <c>PropertyChanged("Item[]")</c> so all bindings refresh in place.
/// </summary>
public sealed partial class ResxLocalizationService : ILocalizationService
public sealed partial class ResxLocalizationService(ILogger<ResxLocalizationService> logger) : ILocalizationService
{
private const string ResourceBaseName = "CaptureImage.ViewModels.Resources.Strings.Strings";
@@ -34,8 +34,8 @@ public sealed partial class ResxLocalizationService : ILocalizationService
new("ru-RU"),
};
private readonly ResourceManager _resourceManager;
private readonly ILogger<ResxLocalizationService> _logger;
private readonly ResourceManager _resourceManager = new(ResourceBaseName, typeof(ResxLocalizationService).Assembly);
private readonly ILogger<ResxLocalizationService> _logger = logger;
/// <summary>
/// Tracks <c>(culture, key)</c> pairs we've already logged a "missing string" warning for.
@@ -44,14 +44,7 @@ public sealed partial class ResxLocalizationService : ILocalizationService
/// </summary>
private readonly ConcurrentDictionary<string, byte> _loggedMissingKeys = new();
private CultureInfo _currentCulture;
public ResxLocalizationService(ILogger<ResxLocalizationService> logger)
{
_resourceManager = new ResourceManager(ResourceBaseName, typeof(ResxLocalizationService).Assembly);
_currentCulture = CultureInfo.GetCultureInfo("en-US");
_logger = logger;
}
private CultureInfo _currentCulture = CultureInfo.GetCultureInfo("en-US");
public event PropertyChangedEventHandler? PropertyChanged;
public event EventHandler? CultureChanged;
@@ -82,17 +82,17 @@ public sealed partial class LogViewerViewModel : ViewModelBase, IDisposable
public IReadOnlyList<LocalizedOption<LogEntryLevel>> LevelOptions { get; }
[ObservableProperty]
private LogEntryLevel _minimumLevel = LogEntryLevel.Verbose;
public partial LogEntryLevel MinimumLevel { get; set; } = LogEntryLevel.Verbose;
[ObservableProperty]
private string _searchText = string.Empty;
public partial string SearchText { get; set; } = string.Empty;
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(CopySelectedCommand))]
private LogEntry? _selectedEntry;
public partial LogEntry? SelectedEntry { get; set; }
[ObservableProperty]
private bool _isPaused;
public partial bool IsPaused { get; set; }
/// <summary>Set by the view; the list only tracks the buffer while the page is visible.</summary>
public bool IsPageActive
@@ -13,34 +13,24 @@ namespace CaptureImage.ViewModels.Preview;
/// "Save this capture?" window. <see cref="Result"/> completes with <c>true</c> (save) or
/// <c>false</c> (discard — also when the window is closed).
/// </summary>
public sealed partial class PreviewViewModel : ViewModelBase
public sealed partial class PreviewViewModel(
CapturedFrame frame,
string title,
IOcrService ocr,
IClipboardService clipboard,
IToastService toasts,
ILocalizationService localization) : ViewModelBase
{
private readonly IOcrService _ocr;
private readonly IClipboardService _clipboard;
private readonly IToastService _toasts;
private readonly IOcrService _ocr = ocr;
private readonly IClipboardService _clipboard = clipboard;
private readonly IToastService _toasts = toasts;
private readonly TaskCompletionSource<bool> _result = new(TaskCreationOptions.RunContinuationsAsynchronously);
public PreviewViewModel(
CapturedFrame frame,
string title,
IOcrService ocr,
IClipboardService clipboard,
IToastService toasts,
ILocalizationService localization)
{
Frame = frame;
Title = title;
_ocr = ocr;
_clipboard = clipboard;
_toasts = toasts;
Localization = localization;
}
public ILocalizationService Localization { get; } = localization;
public ILocalizationService Localization { get; }
public CapturedFrame Frame { get; } = frame;
public CapturedFrame Frame { get; }
public string Title { get; }
public string Title { get; } = title;
public string Dimensions => $"{Frame.Width} × {Frame.Height}";
@@ -48,7 +38,7 @@ public sealed partial class PreviewViewModel : ViewModelBase
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(ExtractTextCommand))]
private bool _isRecognizing;
public partial bool IsRecognizing { get; set; }
[RelayCommand]
private void Save() => _result.TrySetResult(true);
@@ -15,16 +15,11 @@ using CommunityToolkit.Mvvm.Messaging;
namespace CaptureImage.ViewModels.Profiles;
/// <summary>One game profile in the list.</summary>
public sealed partial class ProfileItemViewModel : ViewModelBase
public sealed partial class ProfileItemViewModel(GameProfile profile) : ViewModelBase
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(Name), nameof(MatchSummary), nameof(Enabled), nameof(AutoArm))]
private GameProfile _profile;
public ProfileItemViewModel(GameProfile profile)
{
_profile = profile;
}
public partial GameProfile Profile { get; set; } = profile;
public string Id => Profile.Id;
@@ -104,43 +99,43 @@ public sealed partial class ProfilesViewModel : ViewModelBase, IRecipient<Create
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(HasSelection))]
[NotifyCanExecuteChangedFor(nameof(DeleteCommand), nameof(BrowseExecutableCommand), nameof(BrowseOutputFolderCommand), nameof(ClearOutputFolderCommand))]
private ProfileItemViewModel? _selectedProfile;
public partial ProfileItemViewModel? SelectedProfile { get; set; }
[ObservableProperty]
private string _name = string.Empty;
public partial string Name { get; set; } = string.Empty;
[ObservableProperty]
private bool _enabled = true;
public partial bool Enabled { get; set; } = true;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(MatchesNothing))]
private string _executablePath = string.Empty;
public partial string ExecutablePath { get; set; } = string.Empty;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(MatchesNothing))]
private string _executableName = string.Empty;
public partial string ExecutableName { get; set; } = string.Empty;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(MatchesNothing), nameof(SteamAppIdInvalid))]
private string _steamAppId = string.Empty;
public partial string SteamAppId { get; set; } = string.Empty;
[ObservableProperty]
private string _outputDirectory = string.Empty;
public partial string OutputDirectory { get; set; } = string.Empty;
[ObservableProperty]
private string _format = string.Empty;
public partial string Format { get; set; } = string.Empty;
[ObservableProperty]
private string _fileNameTemplate = string.Empty;
public partial string FileNameTemplate { get; set; } = string.Empty;
[ObservableProperty]
private string _hdrMode = string.Empty;
public partial string HdrMode { get; set; } = string.Empty;
[ObservableProperty]
private bool _autoArm;
public partial bool AutoArm { get; set; }
[ObservableProperty]
private bool _lockTarget = true;
public partial bool LockTarget { get; set; } = true;
public bool HasSelection => SelectedProfile is not null;
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>يُطوَّر CaptureImage بمساعدة كبيرة من مساعد برمجة يعمل بالذكاء الاصطناعي (Claude من Anthropic عبر Claude Code) في كتابة الشيفرة والاختبارات والتوثيق. يراجع المشرف كل تغيير ويختبره قبل الإصدار.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>التطوير بمساعدة الذكاء الاصطناعي</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>دعم الالتقاط</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>يمكن لـ CaptureImage التقاط معظم الألعاب النافذية وعديمة الحدود عبر Windows.Graphics.Capture، لكن ليست كل لعبة تعمل. الأسطح المحمية بـ DRM، وألعاب Direct3D 9 بالشاشة الكاملة الحصرية، والألعاب ذات خطافات anti-cheat قد تعيد إطارات سوداء أو ترفض الالتقاط. تُجرَّب آلية احتياطية GDI PrintWindow للتطبيقات القديمة. راجع docs/legal/DISCLAIMER.md §2 للقائمة الكاملة.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>يمكن لـ CaptureImage التقاط معظم الألعاب النافذية وعديمة الحدود عبر Windows.Graphics.Capture، لكن ليست كل لعبة تعمل. الأسطح المحمية بـ DRM، وألعاب Direct3D 9 بالشاشة الكاملة الحصرية، والألعاب ذات خطافات anti-cheat قد تعيد إطارات سوداء أو ترفض الالتقاط. راجع docs/legal/DISCLAIMER.md §2 للقائمة الكاملة.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>تواصل مع المطور</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>المطور</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>إخلاءات المسؤولية</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>أداة خفيفة لالتقاط الشاشة على Windows للألعاب التي لا تحتوي على مفتاح التقاط مدمج.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>مكونات الطرف الثالث</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>الترجمات</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>حزم لغة الفيتنامية والعربية واليابانية والصينية المبسطة والكورية والإسبانية والفرنسية والألمانية والبرتغالية البرازيلية والروسية مترجمة بمساعدة الآلة. قد لا تتطابق المصطلحات مع العرف المحلي، وبعض الكلمات التقنية (hotkey، toast، frame، إلخ) تُركت بالإنجليزية عمداً. نرحب بمتحدثي اللغة الأم الراغبين في المراجعة لإرسال طلبات سحب على ملفات .resx في src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>حزم لغة الفيتنامية والعربية واليابانية والصينية المبسطة والكورية والإسبانية والفرنسية والألمانية والبرتغالية البرازيلية والروسية مترجمة بمساعدة الآلة. قد لا تتطابق المصطلحات مع العرف المحلي، وبعض الكلمات التقنية (hotkey، toast، frame، إلخ) تُركت بالإنجليزية عمداً. نرحب بمتحدثي اللغة الأم الراغبين في المراجعة لإرسال طلبات سحب على ملفات .resx في src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>الإصدار</value></data>
<data name="Common_Browse" xml:space="preserve"><value>استعراض…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>النوافذ المفتوحة</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>تم إلغاء الالتقاط.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>تعذّر نسخ الصورة إلى الحافظة. ربما يستخدمها تطبيق آخر؛ حاول مجددًا.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>تعذّر ترميز الصورة.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>تعذّر حفظ الملف. تحقق من مجلد الإخراج والمساحة الفارغة على القرص.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>توقف برنامج تشغيل الرسومات عن الاستجابة. حاول مجددًا بعد قليل.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage wird mit erheblicher Unterstützung eines KI-Programmierassistenten (Claude von Anthropic, über Claude Code) für Code, Tests und Dokumentation entwickelt. Der Maintainer prüft und testet jede Änderung vor der Veröffentlichung.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>KI-unterstützte Entwicklung</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Aufnahmeunterstützung</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage kann die meisten Spiele im Fenster- oder randlosen Modus über Windows.Graphics.Capture aufnehmen, jedoch nicht jeden Titel. DRM-geschützte Oberflächen, exklusive Vollbild-Direct3D-9-Spiele und Titel mit Anti-Cheat-Hooks können schwarze Frames liefern oder die Aufnahme verweigern. Für Legacy-Apps wird ein GDI-PrintWindow-Fallback versucht. Vollständige Liste in docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage kann die meisten Spiele im Fenster- oder randlosen Modus über Windows.Graphics.Capture aufnehmen, jedoch nicht jeden Titel. DRM-geschützte Oberflächen, exklusive Vollbild-Direct3D-9-Spiele und Titel mit Anti-Cheat-Hooks können schwarze Frames liefern oder die Aufnahme verweigern. Vollständige Liste in docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Mit dem Entwickler verbinden</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Entwickler</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Hinweise</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Schlanke Windows-Bildschirmaufnahme für Spiele ohne integrierte Screenshot-Taste.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Drittanbieterkomponenten</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Übersetzungen</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Die Sprachpakete Vietnamesisch, Arabisch, Japanisch, vereinfachtes Chinesisch, Koreanisch, Spanisch, Französisch, Deutsch, brasilianisches Portugiesisch und Russisch wurden maschinell unterstützt. Die Terminologie entspricht möglicherweise nicht den muttersprachlichen Konventionen, und einige Fachbegriffe (hotkey, toast, frame usw.) bleiben absichtlich auf Englisch. Muttersprachler, die Korrektur lesen möchten, sind herzlich eingeladen, Pull Requests gegen die .resx-Dateien in src/CaptureImage.UI/Resources/Strings/ einzureichen.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Die Sprachpakete Vietnamesisch, Arabisch, Japanisch, vereinfachtes Chinesisch, Koreanisch, Spanisch, Französisch, Deutsch, brasilianisches Portugiesisch und Russisch wurden maschinell unterstützt. Die Terminologie entspricht möglicherweise nicht den muttersprachlichen Konventionen, und einige Fachbegriffe (hotkey, toast, frame usw.) bleiben absichtlich auf Englisch. Muttersprachler, die Korrektur lesen möchten, sind herzlich eingeladen, Pull Requests gegen die .resx-Dateien in src/CaptureImage.ViewModels/Resources/Strings/ einzureichen.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Version</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Durchsuchen…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Geöffnete Fenster</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Aufnahme abgebrochen.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>Das Bild konnte nicht in die Zwischenablage kopiert werden. Möglicherweise wird sie von einer anderen App verwendet; erneut versuchen.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>Das Bild konnte nicht kodiert werden.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>Die Datei konnte nicht gespeichert werden. Ausgabeordner und freien Speicherplatz prüfen.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>Der Grafiktreiber reagiert nicht mehr. Gleich noch einmal versuchen.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage se desarrolla con una ayuda considerable de un asistente de programación con IA (Claude de Anthropic, a través de Claude Code) para el código, las pruebas y la documentación. El responsable revisa y prueba cada cambio antes de publicarlo.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>Desarrollo asistido por IA</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Compatibilidad de captura</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage puede capturar la mayoría de los juegos en ventana o sin bordes mediante Windows.Graphics.Capture, pero no todos los títulos funcionan. Las superficies protegidas por DRM, los juegos en pantalla completa exclusiva con Direct3D 9 y los títulos con ganchos anticheat pueden devolver fotogramas en negro o rechazar la captura. Para apps antiguas se intenta un fallback con GDI PrintWindow. Consulta la lista completa en docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage puede capturar la mayoría de los juegos en ventana o sin bordes mediante Windows.Graphics.Capture, pero no todos los títulos funcionan. Las superficies protegidas por DRM, los juegos en pantalla completa exclusiva con Direct3D 9 y los títulos con ganchos anticheat pueden devolver fotogramas en negro o rechazar la captura. Consulta la lista completa en docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Conecta con el desarrollador</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Desarrollador</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avisos legales</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Captura de pantalla ligera para Windows pensada para juegos sin tecla de captura propia.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Componentes de terceros</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traducciones</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Los paquetes de idioma vietnamita, árabe, japonés, chino simplificado, coreano, español, francés, alemán, portugués (Brasil) y ruso están traducidos con asistencia automática. Es posible que la terminología no coincida con las convenciones nativas, y algunos términos técnicos (hotkey, toast, frame, etc.) se mantienen en inglés a propósito. Los hablantes nativos dispuestos a revisarlos pueden enviar pull requests sobre los archivos .resx en src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Los paquetes de idioma vietnamita, árabe, japonés, chino simplificado, coreano, español, francés, alemán, portugués (Brasil) y ruso están traducidos con asistencia automática. Es posible que la terminología no coincida con las convenciones nativas, y algunos términos técnicos (hotkey, toast, frame, etc.) se mantienen en inglés a propósito. Los hablantes nativos dispuestos a revisarlos pueden enviar pull requests sobre los archivos .resx en src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Versión</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Examinar…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Ventanas abiertas</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Captura cancelada.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>No se pudo copiar la imagen al portapapeles. Puede que otra aplicación lo esté usando; inténtalo de nuevo.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>No se pudo codificar la imagen.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>No se pudo guardar el archivo. Comprueba la carpeta de salida y el espacio libre en disco.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>El controlador gráfico dejó de responder. Inténtalo de nuevo en un momento.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage est développé avec l'aide importante d'un assistant de programmation IA (Claude d'Anthropic, via Claude Code) pour le code, les tests et la documentation. Le mainteneur relit et teste chaque modification avant sa publication.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>Développement assisté par IA</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Prise en charge de la capture</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage peut capturer la plupart des jeux fenêtrés et sans bordure via Windows.Graphics.Capture, mais pas tous. Les surfaces protégées par DRM, les jeux Direct3D 9 en plein écran exclusif et les titres avec hooks anti-triche peuvent renvoyer des images noires ou refuser la capture. Un repli GDI PrintWindow est tenté pour les applications héritées. Voir docs/legal/DISCLAIMER.md §2 pour la liste complète.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage peut capturer la plupart des jeux fenêtrés et sans bordure via Windows.Graphics.Capture, mais pas tous. Les surfaces protégées par DRM, les jeux Direct3D 9 en plein écran exclusif et les titres avec hooks anti-triche peuvent renvoyer des images noires ou refuser la capture. Voir docs/legal/DISCLAIMER.md §2 pour la liste complète.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Contactez le développeur</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Développeur</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avertissements</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Capture d'écran Windows légère pour les jeux sans touche de capture intégrée.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Composants tiers</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traductions</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Les packs de langue vietnamien, arabe, japonais, chinois simplifié, coréen, espagnol, français, allemand, portugais (Brésil) et russe sont assistés par machine. La terminologie peut ne pas correspondre aux conventions natives, et certains termes techniques (hotkey, toast, frame, etc.) sont volontairement conservés en anglais. Les locuteurs natifs prêts à relire sont chaleureusement invités à soumettre des pull requests sur les fichiers .resx dans src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Les packs de langue vietnamien, arabe, japonais, chinois simplifié, coréen, espagnol, français, allemand, portugais (Brésil) et russe sont assistés par machine. La terminologie peut ne pas correspondre aux conventions natives, et certains termes techniques (hotkey, toast, frame, etc.) sont volontairement conservés en anglais. Les locuteurs natifs prêts à relire sont chaleureusement invités à soumettre des pull requests sur les fichiers .resx dans src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Version</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Parcourir…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Fenêtres ouvertes</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Capture annulée.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>Impossible de copier l'image dans le presse-papiers. Une autre application l'utilise peut-être ; réessayez.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>Impossible d'encoder l'image.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>Impossible d'enregistrer le fichier. Vérifiez le dossier de sortie et l'espace disque disponible.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>Le pilote graphique ne répond plus. Réessayez dans un instant.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage は、コード・テスト・ドキュメントの作成に AI コーディングアシスタント(Anthropic の Claude、Claude Code 経由)の大きな助けを借りて開発されています。すべての変更はリリース前にメンテナーがレビューし、テストしています。</value></data>
<data name="About_AiSection" xml:space="preserve"><value>AI 支援開発</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>キャプチャ対応</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage は Windows.Graphics.Capture により多くのウィンドウ・ボーダーレスゲームをキャプチャできますが、すべてのタイトルで動作するわけではありません。DRM 保護されたサーフェス、排他的フルスクリーンの Direct3D 9 ゲーム、アンチチートフックを持つタイトルは、黒フレームを返したりキャプチャを拒否することがあります。レガシーアプリには GDI PrintWindow フォールバックを試みます。完全な一覧は docs/legal/DISCLAIMER.md §2 を参照してください。</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage は Windows.Graphics.Capture により多くのウィンドウ・ボーダーレスゲームをキャプチャできますが、すべてのタイトルで動作するわけではありません。DRM 保護されたサーフェス、排他的フルスクリーンの Direct3D 9 ゲーム、アンチチートフックを持つタイトルは、黒フレームを返したりキャプチャを拒否することがあります。完全な一覧は docs/legal/DISCLAIMER.md §2 を参照してください。</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>開発者とつながる</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>開発者</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>免責事項</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>スクリーンショット機能のないゲーム向けの軽量 Windows 画面キャプチャツール。</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>サードパーティコンポーネント</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>翻訳について</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>ベトナム語、アラビア語、日本語、中国語(簡体)、韓国語、スペイン語、フランス語、ドイツ語、ポルトガル語(ブラジル)、ロシア語の言語パックは機械支援で翻訳されています。用語が母語の慣習と一致しない場合があり、一部の技術用語(hotkey、toast、frame など)はあえて英語のままにしています。校正に協力してくださるネイティブスピーカーの方は、src/CaptureImage.UI/Resources/Strings/ の .resx ファイルへの Pull Request を歓迎します。</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>ベトナム語、アラビア語、日本語、中国語(簡体)、韓国語、スペイン語、フランス語、ドイツ語、ポルトガル語(ブラジル)、ロシア語の言語パックは機械支援で翻訳されています。用語が母語の慣習と一致しない場合があり、一部の技術用語(hotkey、toast、frame など)はあえて英語のままにしています。校正に協力してくださるネイティブスピーカーの方は、src/CaptureImage.ViewModels/Resources/Strings/ の .resx ファイルへの Pull Request を歓迎します。</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>バージョン</value></data>
<data name="Common_Browse" xml:space="preserve"><value>参照…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>開いているウィンドウ</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>キャプチャをキャンセルしました。</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>画像をクリップボードにコピーできませんでした。別のアプリが使用中の可能性があります。もう一度お試しください。</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>画像をエンコードできませんでした。</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>ファイルを保存できませんでした。出力フォルダーとディスクの空き容量を確認してください。</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>グラフィックドライバーが応答しなくなりました。しばらくしてからもう一度お試しください。</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage는 코드, 테스트, 문서 작성에 AI 코딩 도우미(Anthropic의 Claude, Claude Code 사용)의 상당한 도움을 받아 개발됩니다. 모든 변경 사항은 릴리스 전에 관리자가 검토하고 테스트합니다.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>AI 보조 개발</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>캡처 지원</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage는 Windows.Graphics.Capture를 통해 대부분의 창 모드 및 테두리 없는 게임을 캡처할 수 있지만, 모든 타이틀에서 작동하지는 않습니다. DRM 보호된 표면, 독점 전체 화면 Direct3D 9 게임, 안티치트 후크가 있는 타이틀은 검은 프레임을 반환하거나 캡처를 거부할 수 있습니다. 레거시 앱에는 GDI PrintWindow 폴백이 시도됩니다. 전체 목록은 docs/legal/DISCLAIMER.md §2를 참조하세요.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage는 Windows.Graphics.Capture를 통해 대부분의 창 모드 및 테두리 없는 게임을 캡처할 수 있지만, 모든 타이틀에서 작동하지는 않습니다. DRM 보호된 표면, 독점 전체 화면 Direct3D 9 게임, 안티치트 후크가 있는 타이틀은 검은 프레임을 반환하거나 캡처를 거부할 수 있습니다. 전체 목록은 docs/legal/DISCLAIMER.md §2를 참조하세요.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>개발자와 연결</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>개발자</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>면책 조항</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>스크린샷 키가 없는 게임을 위한 가벼운 Windows 화면 캡처 도구.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>타사 구성 요소</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>번역</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>베트남어, 아랍어, 일본어, 중국어(간체), 한국어, 스페인어, 프랑스어, 독일어, 브라질 포르투갈어, 러시아어 언어 팩은 기계 보조로 번역되었습니다. 용어가 모국어 관습과 일치하지 않을 수 있으며, 일부 기술 용어(hotkey, toast, frame 등)는 의도적으로 영어로 유지되었습니다. 교정에 도움을 주실 원어민 분들의 src/CaptureImage.UI/Resources/Strings/ .resx 파일에 대한 풀 리퀘스트를 환영합니다.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>베트남어, 아랍어, 일본어, 중국어(간체), 한국어, 스페인어, 프랑스어, 독일어, 브라질 포르투갈어, 러시아어 언어 팩은 기계 보조로 번역되었습니다. 용어가 모국어 관습과 일치하지 않을 수 있으며, 일부 기술 용어(hotkey, toast, frame 등)는 의도적으로 영어로 유지되었습니다. 교정에 도움을 주실 원어민 분들의 src/CaptureImage.ViewModels/Resources/Strings/ .resx 파일에 대한 풀 리퀘스트를 환영합니다.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>버전</value></data>
<data name="Common_Browse" xml:space="preserve"><value>찾아보기…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>열린 창</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>캡처가 취소되었습니다.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>이미지를 클립보드에 복사할 수 없습니다. 다른 앱이 클립보드를 사용 중일 수 있습니다. 다시 시도하세요.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>이미지를 인코딩할 수 없습니다.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>파일을 저장할 수 없습니다. 출력 폴더와 디스크 여유 공간을 확인하세요.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>그래픽 드라이버가 응답하지 않습니다. 잠시 후 다시 시도하세요.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>O CaptureImage é desenvolvido com ajuda considerável de um assistente de programação com IA (Claude, da Anthropic, via Claude Code) para código, testes e documentação. O mantenedor revisa e testa cada alteração antes do lançamento.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>Desenvolvimento assistido por IA</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Suporte de captura</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>O CaptureImage consegue capturar a maioria dos jogos em janela ou sem borda via Windows.Graphics.Capture, mas nem todos os títulos funcionam. Superfícies protegidas por DRM, jogos Direct3D 9 em tela cheia exclusiva e títulos com hooks anti-cheat podem retornar quadros pretos ou recusar a captura. Um fallback GDI PrintWindow é tentado para apps legados. Veja docs/legal/DISCLAIMER.md §2 para a lista completa.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>O CaptureImage consegue capturar a maioria dos jogos em janela ou sem borda via Windows.Graphics.Capture, mas nem todos os títulos funcionam. Superfícies protegidas por DRM, jogos Direct3D 9 em tela cheia exclusiva e títulos com hooks anti-cheat podem retornar quadros pretos ou recusar a captura. Veja docs/legal/DISCLAIMER.md §2 para a lista completa.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Conecte-se com o desenvolvedor</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Desenvolvedor</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avisos</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Captura de tela leve para Windows voltada a jogos sem tecla de captura nativa.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Componentes de terceiros</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traduções</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Os pacotes de idioma vietnamita, árabe, japonês, chinês simplificado, coreano, espanhol, francês, alemão, português (Brasil) e russo são assistidos por máquina. A terminologia pode não corresponder às convenções nativas, e algumas palavras técnicas (hotkey, toast, frame etc.) são mantidas em inglês de propósito. Falantes nativos dispostos a revisar são bem-vindos a abrir pull requests nos arquivos .resx em src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Os pacotes de idioma vietnamita, árabe, japonês, chinês simplificado, coreano, espanhol, francês, alemão, português (Brasil) e russo são assistidos por máquina. A terminologia pode não corresponder às convenções nativas, e algumas palavras técnicas (hotkey, toast, frame etc.) são mantidas em inglês de propósito. Falantes nativos dispostos a revisar são bem-vindos a abrir pull requests nos arquivos .resx em src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Versão</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Procurar…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Janelas abertas</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Captura cancelada.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>Não foi possível copiar a imagem para a área de transferência. Outro aplicativo pode estar usando-a; tente novamente.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>Não foi possível codificar a imagem.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>Não foi possível salvar o arquivo. Verifique a pasta de saída e o espaço livre em disco.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>O driver gráfico parou de responder. Tente novamente em instantes.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage is developed with substantial help from an AI coding assistant (Claude by Anthropic, through Claude Code) for code, tests and documentation. The maintainer reviews and tests every change before release.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>AI-assisted development</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Capture support</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage can capture most windowed and borderless games via Windows.Graphics.Capture, but not every title works. DRM-protected surfaces, exclusive-fullscreen Direct3D 9 games, and titles with anti-cheat hooks may return black frames or refuse capture. A GDI PrintWindow fallback is attempted for legacy apps. See docs/legal/DISCLAIMER.md §2 for the full list.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage can capture most windowed and borderless games via Windows.Graphics.Capture, but not every title works. DRM-protected surfaces, exclusive-fullscreen Direct3D 9 games, and titles with anti-cheat hooks may return black frames or refuse capture. See docs/legal/DISCLAIMER.md §2 for the full list.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Connect with the developer</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Developer</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Disclaimers</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Lightweight Windows screen capture for games without a built-in screenshot key.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Third-party components</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Translations</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>The Vietnamese, Arabic, Japanese, Simplified Chinese, Korean, Spanish, French, German, Brazilian Portuguese, and Russian language packs are machine-assisted. Terminology may not match native conventions, and some technical words (hotkey, toast, frame, etc.) are kept in English on purpose. Native speakers willing to proofread are warmly invited to submit pull requests against the .resx files in src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>The Vietnamese, Arabic, Japanese, Simplified Chinese, Korean, Spanish, French, German, Brazilian Portuguese, and Russian language packs are machine-assisted. Terminology may not match native conventions, and some technical words (hotkey, toast, frame, etc.) are kept in English on purpose. Native speakers willing to proofread are warmly invited to submit pull requests against the .resx files in src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Version</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Browse…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Open windows</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Capture cancelled.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>The image could not be copied to the clipboard. Another app may be using it; try again.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>The image could not be encoded.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>The file could not be saved. Check the output folder and free disk space.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>The graphics driver stopped responding. Try again in a moment.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage разрабатывается при значительной помощи ИИ-ассистента для программирования (Claude от Anthropic через Claude Code) — для кода, тестов и документации. Сопровождающий проверяет и тестирует каждое изменение перед выпуском.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>Разработка с помощью ИИ</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Поддержка захвата</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage может захватывать большинство оконных и безрамочных игр через Windows.Graphics.Capture, но не каждый тайтл. Поверхности с DRM, эксклюзивный полноэкранный Direct3D 9 и игры с анти-чит хуками могут возвращать чёрные кадры или отказывать в захвате. Для устаревших приложений используется резервный механизм GDI PrintWindow. Полный список — docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage может захватывать большинство оконных и безрамочных игр через Windows.Graphics.Capture, но не каждый тайтл. Поверхности с DRM, эксклюзивный полноэкранный Direct3D 9 и игры с анти-чит хуками могут возвращать чёрные кадры или отказывать в захвате. Полный список — docs/legal/DISCLAIMER.md §2.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Связаться с разработчиком</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Разработчик</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Примечания</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Лёгкая утилита захвата экрана Windows для игр без встроенной клавиши скриншота.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Сторонние компоненты</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Переводы</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Языковые пакеты вьетнамский, арабский, японский, упрощённый китайский, корейский, испанский, французский, немецкий, бразильский португальский и русский подготовлены при помощи машинного перевода. Терминология может отличаться от привычной носителям, а некоторые технические слова (hotkey, toast, frame и т.п.) намеренно оставлены на английском. Носители языка, готовые проверить переводы, приглашаются открыть pull request к файлам .resx в src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Языковые пакеты вьетнамский, арабский, японский, упрощённый китайский, корейский, испанский, французский, немецкий, бразильский португальский и русский подготовлены при помощи машинного перевода. Терминология может отличаться от привычной носителям, а некоторые технические слова (hotkey, toast, frame и т.п.) намеренно оставлены на английском. Носители языка, готовые проверить переводы, приглашаются открыть pull request к файлам .resx в src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Версия</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Обзор…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Открытые окна</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Снимок отменён.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>Не удалось скопировать изображение в буфер обмена. Возможно, его использует другое приложение; повторите попытку.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>Не удалось закодировать изображение.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>Не удалось сохранить файл. Проверьте папку вывода и свободное место на диске.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>Графический драйвер перестал отвечать. Повторите попытку чуть позже.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage được phát triển với sự hỗ trợ đáng kể từ trợ lý lập trình AI (Claude của Anthropic, qua Claude Code) cho mã nguồn, kiểm thử và tài liệu. Người duy trì xem xét và kiểm thử mọi thay đổi trước khi phát hành.</value></data>
<data name="About_AiSection" xml:space="preserve"><value>Phát triển có hỗ trợ AI</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Khả năng chụp</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage có thể chụp hầu hết game cửa sổ và borderless qua Windows.Graphics.Capture, nhưng không phải game nào cũng hoạt động. Bề mặt có DRM, game Direct3D 9 exclusive-fullscreen, và game có hook anti-cheat có thể trả khung đen hoặc từ chối chụp. Cơ chế dự phòng GDI PrintWindow được thử cho ứng dụng cũ. Xem docs/legal/DISCLAIMER.md §2 để biết danh sách đầy đủ.</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage có thể chụp hầu hết game cửa sổ và borderless qua Windows.Graphics.Capture, nhưng không phải game nào cũng hoạt động. Bề mặt có DRM, game Direct3D 9 exclusive-fullscreen, và game có hook anti-cheat có thể trả khung đen hoặc từ chối chụp. Xem docs/legal/DISCLAIMER.md §2 để biết danh sách đầy đủ.</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>Kết nối với nhà phát triển</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>Nhà phát triển</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>Tuyên bố miễn trừ</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>Công cụ chụp màn hình Windows gọn nhẹ cho các game không có phím chụp có sẵn.</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>Thành phần third-party</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Bản dịch</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Các gói ngôn ngữ tiếng Việt, tiếng Ả Rập, tiếng Nhật, tiếng Trung giản thể, tiếng Hàn, tiếng Tây Ban Nha, tiếng Pháp, tiếng Đức, tiếng Bồ Đào Nha (Brazil) và tiếng Nga đang dùng bản dịch máy. Thuật ngữ có thể không khớp với quy ước bản ngữ, và một số từ kỹ thuật (hotkey, toast, frame, v.v.) được giữ tiếng Anh có chủ đích. Người bản ngữ sẵn lòng hiệu đính xin gửi pull request vào các tệp .resx trong src/CaptureImage.UI/Resources/Strings/.</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Các gói ngôn ngữ tiếng Việt, tiếng Ả Rập, tiếng Nhật, tiếng Trung giản thể, tiếng Hàn, tiếng Tây Ban Nha, tiếng Pháp, tiếng Đức, tiếng Bồ Đào Nha (Brazil) và tiếng Nga đang dùng bản dịch máy. Thuật ngữ có thể không khớp với quy ước bản ngữ, và một số từ kỹ thuật (hotkey, toast, frame, v.v.) được giữ tiếng Anh có chủ đích. Người bản ngữ sẵn lòng hiệu đính xin gửi pull request vào các tệp .resx trong src/CaptureImage.ViewModels/Resources/Strings/.</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>Phiên bản</value></data>
<data name="Common_Browse" xml:space="preserve"><value>Duyệt…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>Các cửa sổ đang mở</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>Đã huỷ chụp.</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>Không thể sao chép ảnh vào bộ nhớ tạm. Có thể một ứng dụng khác đang dùng bộ nhớ tạm; hãy thử lại.</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>Không thể mã hoá hình ảnh.</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>Không thể lưu tệp. Hãy kiểm tra thư mục lưu và dung lượng ổ đĩa còn trống.</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>Driver đồ hoạ ngừng phản hồi. Hãy thử lại sau giây lát.</value></data>
@@ -35,7 +35,7 @@
<data name="About_AiNotice" xml:space="preserve"><value>CaptureImage 的代码、测试和文档在开发中大量借助了 AI 编程助手(Anthropic 的 Claude,通过 Claude Code)。每项更改在发布前都由维护者审查和测试。</value></data>
<data name="About_AiSection" xml:space="preserve"><value>AI 辅助开发</value></data>
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>截图支持</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage 通过 Windows.Graphics.Capture 可截取大多数窗口化和无边框游戏,但并非所有游戏都受支持。受 DRM 保护的画面、独占全屏 Direct3D 9 游戏以及带反作弊钩子的游戏可能会返回黑屏或拒绝截图。对于旧应用会尝试 GDI PrintWindow 回退。完整列表请参阅 docs/legal/DISCLAIMER.md §2。</value></data>
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage 通过 Windows.Graphics.Capture 可截取大多数窗口化和无边框游戏,但并非所有游戏都受支持。受 DRM 保护的画面、独占全屏 Direct3D 9 游戏以及带反作弊钩子的游戏可能会返回黑屏或拒绝截图。完整列表请参阅 docs/legal/DISCLAIMER.md §2。</value></data>
<data name="About_ContactSection" xml:space="preserve"><value>与开发者联系</value></data>
<data name="About_DeveloperLabel" xml:space="preserve"><value>开发者</value></data>
<data name="About_DisclaimersSection" xml:space="preserve"><value>免责声明</value></data>
@@ -65,7 +65,7 @@
<data name="About_Tagline" xml:space="preserve"><value>面向无内置截图键游戏的轻量级 Windows 屏幕截图工具。</value></data>
<data name="About_ThirdPartySection" xml:space="preserve"><value>第三方组件</value></data>
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>翻译</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>越南语、阿拉伯语、日语、简体中文、韩语、西班牙语、法语、德语、巴西葡萄牙语和俄语语言包采用机器辅助翻译。术语可能与母语习惯不一致,部分技术术语(hotkey、toast、frame 等)有意保留为英文。欢迎母语为相关语言的志愿者校对,可通过对 src/CaptureImage.UI/Resources/Strings/ 下的 .resx 文件提交 Pull Request。</value></data>
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>越南语、阿拉伯语、日语、简体中文、韩语、西班牙语、法语、德语、巴西葡萄牙语和俄语语言包采用机器辅助翻译。术语可能与母语习惯不一致,部分技术术语(hotkey、toast、frame 等)有意保留为英文。欢迎母语为相关语言的志愿者校对,可通过对 src/CaptureImage.ViewModels/Resources/Strings/ 下的 .resx 文件提交 Pull Request。</value></data>
<data name="About_VersionLabel" xml:space="preserve"><value>版本</value></data>
<data name="Common_Browse" xml:space="preserve"><value>浏览…</value></data>
@@ -96,6 +96,7 @@
<data name="Dashboard_Windows" xml:space="preserve"><value>已打开的窗口</value></data>
<data name="Error_Cancelled" xml:space="preserve"><value>已取消截图。</value></data>
<data name="Error_ClipboardFailure" xml:space="preserve"><value>无法将图像复制到剪贴板。可能有其他应用正在使用剪贴板,请重试。</value></data>
<data name="Error_EncodingFailure" xml:space="preserve"><value>无法编码图像。</value></data>
<data name="Error_FileWriteFailure" xml:space="preserve"><value>无法保存文件。请检查输出文件夹和可用磁盘空间。</value></data>
<data name="Error_GraphicsDeviceFailure" xml:space="preserve"><value>显卡驱动程序停止响应。请稍后重试。</value></data>
@@ -15,31 +15,21 @@ namespace CaptureImage.ViewModels.Settings;
/// capture hotkeys are released while recording so the combination reaches the recorder),
/// and rejects invalid, duplicate or already-taken combinations with a message.
/// </summary>
public sealed partial class HotkeyBindingViewModel : ViewModelBase
public sealed partial class HotkeyBindingViewModel(
CaptureMode mode,
ISettingsStore settings,
CaptureCoordinator coordinator,
IHotkeyService hotkeys,
ILocalizationService localization) : ViewModelBase
{
private readonly ISettingsStore _settings;
private readonly CaptureCoordinator _coordinator;
private readonly IHotkeyService _hotkeys;
private readonly ISettingsStore _settings = settings;
private readonly CaptureCoordinator _coordinator = coordinator;
private readonly IHotkeyService _hotkeys = hotkeys;
private IDisposable? _suspension;
public HotkeyBindingViewModel(
CaptureMode mode,
ISettingsStore settings,
CaptureCoordinator coordinator,
IHotkeyService hotkeys,
ILocalizationService localization)
{
Mode = mode;
_settings = settings;
_coordinator = coordinator;
_hotkeys = hotkeys;
Localization = localization;
_binding = settings.Current.Hotkeys.Get(mode);
}
public ILocalizationService Localization { get; } = localization;
public ILocalizationService Localization { get; }
public CaptureMode Mode { get; }
public CaptureMode Mode { get; } = mode;
public string ModeName => Localization[$"Mode_{Mode}"];
@@ -47,17 +37,17 @@ public sealed partial class HotkeyBindingViewModel : ViewModelBase
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(DisplayText), nameof(IsDefault))]
private HotkeyBinding _binding;
public partial HotkeyBinding Binding { get; set; } = settings.Current.Hotkeys.Get(mode);
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(DisplayText))]
private bool _isRecording;
public partial bool IsRecording { get; set; }
[ObservableProperty]
private string _message = string.Empty;
public partial string Message { get; set; } = string.Empty;
[ObservableProperty]
private bool _hasError;
public partial bool HasError { get; set; }
public string DisplayText => IsRecording
? Localization["Hotkey_PressKeys"]
@@ -136,46 +136,46 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsJpeg), nameof(IsWebp), nameof(IsPng), nameof(FileNamePreview))]
private ImageFormat _defaultFormat;
public partial ImageFormat DefaultFormat { get; set; }
[ObservableProperty]
private int _jpegQuality;
public partial int JpegQuality { get; set; }
[ObservableProperty]
private int _webpQuality;
public partial int WebpQuality { get; set; }
[ObservableProperty]
private string _pngCompression = "Balanced";
public partial string PngCompression { get; set; } = "Balanced";
/// <summary>Configured folder; empty means <see cref="DefaultOutputDirectory"/>.</summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(EffectiveOutputDirectory), nameof(HasCustomOutputDirectory))]
private string _outputDirectory = string.Empty;
public partial string OutputDirectory { get; set; } = string.Empty;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(FileNamePreview))]
private string _fileNameTemplate = FileNameStrategy.DefaultTemplate;
public partial string FileNameTemplate { get; set; } = FileNameStrategy.DefaultTemplate;
[ObservableProperty]
private bool _previewBeforeSave;
public partial bool PreviewBeforeSave { get; set; }
[ObservableProperty]
private int _countdownSeconds;
public partial int CountdownSeconds { get; set; }
[ObservableProperty]
private string _clipboardMode = "None";
public partial string ClipboardMode { get; set; } = "None";
[ObservableProperty]
private bool _includeCursor;
public partial bool IncludeCursor { get; set; }
[ObservableProperty]
private bool _includeWindowFrame;
public partial bool IncludeWindowFrame { get; set; }
[ObservableProperty]
private string _hdrMode = "Auto";
public partial string HdrMode { get; set; } = "Auto";
[ObservableProperty]
private bool _saveHdrSidecar;
public partial bool SaveHdrSidecar { get; set; }
public bool IsJpeg => DefaultFormat == ImageFormat.Jpeg;
@@ -202,37 +202,37 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
// ---- Behaviour, startup, appearance ---------------------------------------------
[ObservableProperty]
private bool _minimizeToTray;
public partial bool MinimizeToTray { get; set; }
[ObservableProperty]
private bool _startMinimized;
public partial bool StartMinimized { get; set; }
[ObservableProperty]
private bool _soundEnabled;
public partial bool SoundEnabled { get; set; }
[ObservableProperty]
private bool _openFolderAfterSave;
public partial bool OpenFolderAfterSave { get; set; }
[ObservableProperty]
private bool _autoPinAfterCapture;
public partial bool AutoPinAfterCapture { get; set; }
[ObservableProperty]
private bool _showNotifications;
public partial bool ShowNotifications { get; set; }
[ObservableProperty]
private bool _armOnStartup;
public partial bool ArmOnStartup { get; set; }
[ObservableProperty]
private bool _startWithWindows;
public partial bool StartWithWindows { get; set; }
[ObservableProperty]
private string _theme = "System";
public partial string Theme { get; set; } = "System";
[ObservableProperty]
private string _language = "en-US";
public partial string Language { get; set; } = "en-US";
[ObservableProperty]
private string _logLevel = "Information";
public partial string LogLevel { get; set; } = "Information";
// ---- Commands ---------------------------------------------------------------------
@@ -59,13 +59,13 @@ public sealed partial class ShellViewModel : ViewModelBase, IDisposable
public string Subtitle => AppInfo.DisplayVersion;
[ObservableProperty]
private bool _isArmed;
public partial bool IsArmed { get; set; }
[ObservableProperty]
private bool _isBusy;
public partial bool IsBusy { get; set; }
[ObservableProperty]
private string _trayToolTip = "CaptureImage";
public partial string TrayToolTip { get; set; } = "CaptureImage";
public string ArmMenuText => IsArmed ? Localization["Tray_Disarm"] : Localization["Tray_Arm"];
@@ -46,7 +46,7 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
Localization = localization;
AppInfo = appInfo;
_logger = logger;
_status = updates.IsAvailable ? UpdateStatus.Idle : UpdateStatus.Unavailable;
Status = updates.IsAvailable ? UpdateStatus.Idle : UpdateStatus.Unavailable;
_updates.LogEmitted += OnLogEmitted;
Localization.PropertyChanged += OnLocalizationChanged;
@@ -61,19 +61,19 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(StatusText), nameof(IsWorking), nameof(ShowProgress), nameof(IsUpdateAvailable), nameof(IsReady), nameof(HasFailed))]
[NotifyCanExecuteChangedFor(nameof(CheckCommand), nameof(DownloadCommand), nameof(InstallAndRestartCommand), nameof(CancelCommand))]
private UpdateStatus _status;
public partial UpdateStatus Status { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(StatusText))]
private string? _availableVersion;
public partial string? AvailableVersion { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(HasReleaseNotes))]
private string? _releaseNotes;
public partial string? ReleaseNotes { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsProgressIndeterminate))]
private int _progress;
public partial int Progress { get; set; }
public string StatusText => Status == UpdateStatus.UpdateAvailable
? Localization.Format("Update_Status_UpdateAvailable", AvailableVersion ?? "?")
@@ -10,23 +10,23 @@
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
}
},
@@ -221,6 +221,34 @@ public class HdrToneMapperTests
above.Should().BeApproximately(below, 1e-5f);
}
[Fact]
public void InfiniteHighlight_BecomesWhite()
{
var pixel = ToneMapOne(new RgbaPixel(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, 1f), Hdr240);
pixel.Should().Be(new BgraPixel(255, 255, 255, 255));
}
[Fact]
public void InfiniteChannel_KeepsItsHue()
{
var pixel = ToneMapOne(new RgbaPixel(float.PositiveInfinity, 0.5f, 0.5f, 1f), Hdr240);
pixel.R.Should().Be(255);
pixel.G.Should().BeLessThan(8, "finite channels are negligible next to an infinite one");
pixel.B.Should().BeLessThan(8);
}
[Fact]
public void NaNChannel_BecomesZero_AndTheOthersStillRollOff()
{
var withNaN = ToneMapOne(new RgbaPixel(float.NaN, 0.9f, 0.5f, 1f), HdrInfo.Sdr);
withNaN.Should().Be(ToneMapOne(new RgbaPixel(0f, 0.9f, 0.5f, 1f), HdrInfo.Sdr));
withNaN.R.Should().Be(0);
withNaN.G.Should().BeCloseTo(SrgbByte(HdrToneMapper.CompressHighlight(0.9f)), 1, "a highlight next to a NaN is still compressed");
}
private static BgraPixel ToneMapOne(RgbaPixel pixel, HdrInfo? hdr) =>
Frames.ReadBgra(HdrToneMapper.ToSdr(Frames.SolidHalf(1, 1, pixel, hdr)), 0, 0);
@@ -774,6 +774,34 @@ public sealed class CaptureCoordinatorCaptureTests : IDisposable
_h.Toasts.Received(1).Show(ToastKind.Success, "L:Toast_ClipboardCopied", "Elden Ring", null);
}
[Fact]
public async Task ClipboardCopy_ThatFails_IsReportedAsAFailure()
{
_h.UpdateCapture(c => c with { ClipboardMode = "Copy" });
_h.Clipboard.CopyImageAsync(Arg.Any<CapturedFrame>(), Arg.Any<CancellationToken>()).Returns(false);
var outcome = await Coordinator.CaptureAsync(CaptureMode.Window, Ct);
outcome.Kind.Should().Be(CaptureOutcomeKind.Failed);
outcome.Error.Should().Be(CaptureError.ClipboardFailure);
_h.Output.RelativeFiles().Should().BeEmpty();
_h.Sound.DidNotReceive().PlayCaptureSound();
_h.Toasts.Received(1).Show(ToastKind.Error, "L:Toast_CaptureFailed", "L:Error_ClipboardFailure", null);
}
[Fact]
public async Task ClipboardCopyAndSave_ThatFailsToCopy_StillSavesTheFile()
{
_h.UpdateCapture(c => c with { ClipboardMode = "CopyAndSave" });
_h.Clipboard.CopyImageAsync(Arg.Any<CapturedFrame>(), Arg.Any<CancellationToken>()).Returns(false);
var outcome = await Coordinator.CaptureAsync(CaptureMode.Window, Ct);
outcome.Kind.Should().Be(CaptureOutcomeKind.Saved);
File.Exists(GameFile()).Should().BeTrue();
_h.Toasts.Received(1).Show(ToastKind.Success, "L:Toast_CaptureSaved", CoordinatorHarness.GameStem + ".png", null);
}
[Fact]
public async Task ClipboardCopyAndSave_DoesBoth()
{
@@ -20,16 +20,13 @@ internal sealed record EncodeCall(CapturedFrame Frame, ImageFormat Format, Encod
/// two halves with <see cref="Midway"/> in between, so a failure there leaves a partially
/// written file behind — exactly what the writer has to clean up.
/// </summary>
internal sealed class FakeImageEncoder : IImageEncoder
/// <param name="supported">Format/pixel-format pairs to accept; empty means <see cref="DefaultSupport"/>.</param>
internal sealed class FakeImageEncoder(
params (ImageFormat Format, FramePixelFormat PixelFormat)[] supported) : IImageEncoder
{
private readonly ConcurrentQueue<EncodeCall> _calls = new();
private readonly HashSet<(ImageFormat, FramePixelFormat)> _supported;
/// <param name="supported">Format/pixel-format pairs to accept; empty means <see cref="DefaultSupport"/>.</param>
public FakeImageEncoder(params (ImageFormat Format, FramePixelFormat PixelFormat)[] supported)
{
_supported = supported.Length > 0 ? [.. supported] : [.. DefaultSupport];
}
private readonly HashSet<(ImageFormat, FramePixelFormat)> _supported =
supported.Length > 0 ? [.. supported] : [.. DefaultSupport];
/// <summary>Every 8-bit output format, plus the JPEG XR sidecar from FP16.</summary>
public static IReadOnlyList<(ImageFormat Format, FramePixelFormat PixelFormat)> DefaultSupport { get; } =
@@ -10,16 +10,11 @@ namespace CaptureImage.Core.Tests.TestSupport;
/// wait until code under test is really blocked on <c>Task.Delay(…, timeProvider, …)</c>
/// before advancing the clock, so no advance is ever lost to a race.
/// </summary>
internal sealed class SignalingTimeProvider : TimeProvider, IDisposable
internal sealed class SignalingTimeProvider(DateTimeOffset start) : TimeProvider, IDisposable
{
private readonly SemaphoreSlim _timerCreated = new(0);
public SignalingTimeProvider(DateTimeOffset start)
{
Fake = new FakeTimeProvider(start);
}
public FakeTimeProvider Fake { get; }
public FakeTimeProvider Fake { get; } = new(start);
public override TimeZoneInfo LocalTimeZone => Fake.LocalTimeZone;
@@ -193,22 +193,22 @@
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
}
},
@@ -176,7 +176,7 @@ public sealed class WgcIntegrationTests : IDisposable
{
SkipUnlessCaptureIsSupported();
var monitors = _displays.GetMonitors();
var monitor = monitors.FirstOrDefault(m => m.IsPrimary) ?? monitors.FirstOrDefault();
var monitor = monitors.FirstOrDefault(m => m.IsPrimary) ?? (monitors.Count > 0 ? monitors[0] : null);
if (monitor is null)
{
Assert.Skip("No monitor is attached to this session.");
@@ -13,6 +13,7 @@
<PackageReference Include="AwesomeAssertions" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
</ItemGroup>
<ItemGroup>
@@ -52,10 +52,10 @@ public sealed class DiagnosticsExporterTests : IDisposable
[Fact]
public async Task ExportAsync_BundlesSystemInfoSettingsAndLogs()
{
File.WriteAllText(_paths.SettingsFile, """{"version":3,"culture":"vi-VN"}""");
await File.WriteAllTextAsync(_paths.SettingsFile, """{"version":3,"culture":"vi-VN"}""", Ct);
WriteLog("captureimage-20261018.log", "yesterday", hoursAgo: 24);
WriteLog("captureimage-20261019.log", "today", hoursAgo: 1);
File.WriteAllText(Path.Combine(_paths.LogsDirectory, "readme.txt"), "not a log");
await File.WriteAllTextAsync(Path.Combine(_paths.LogsDirectory, "readme.txt"), "not a log", Ct);
var destination = _temp.Combine("diagnostics.zip");
var result = await CreateExporter().ExportAsync(destination, Ct);
@@ -89,7 +89,7 @@ public sealed class DiagnosticsExporterTests : IDisposable
});
await store.FlushAsync(Ct);
}
File.ReadAllText(_paths.SettingsFile).Should().Contain(JsonEncodedText.Encode(Profile).ToString(), "the test needs the escaped form on disk");
(await File.ReadAllTextAsync(_paths.SettingsFile, Ct)).Should().Contain(JsonEncodedText.Encode(Profile).ToString(), "the test needs the escaped form on disk");
WriteLog("captureimage-20261019.log", $"Saved {Path.Combine(Profile, "Pictures", "a.png")}\nOpened {Profile.ToUpperInvariant()}\\Desktop\n", hoursAgo: 0);
var destination = _temp.Combine("diagnostics.zip");
@@ -154,7 +154,7 @@ public sealed class DiagnosticsExporterTests : IDisposable
public async Task ExportAsync_ReplacesAnExistingFile()
{
var destination = _temp.Combine("diagnostics.zip");
File.WriteAllText(destination, "an older export");
await File.WriteAllTextAsync(destination, "an older export", Ct);
await CreateExporter().ExportAsync(destination, Ct);
@@ -165,7 +165,7 @@ public sealed class DiagnosticsExporterTests : IDisposable
public async Task ExportAsync_LeftoverTempFileFromAnInterruptedExport_DoesNotBlockTheNextOne()
{
var destination = _temp.Combine("diagnostics.zip");
File.WriteAllText(destination + ".tmp", "half-written zip from a crash");
await File.WriteAllTextAsync(destination + ".tmp", "half-written zip from a crash", Ct);
await CreateExporter().ExportAsync(destination, Ct);
@@ -68,7 +68,7 @@ public sealed class SkiaImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Png, new EncoderSettings());
File.ReadAllBytes(path)[..8].Should().Equal(PngSignature);
(await File.ReadAllBytesAsync(path, Ct))[..8].Should().Equal(PngSignature);
var decoded = await _decoder.LoadAsync(path, cancellationToken: Ct);
decoded.Should().NotBeNull();
decoded.ShouldHaveSamePixelsAs(frame);
@@ -83,7 +83,7 @@ public sealed class SkiaImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Png, new EncoderSettings());
// IHDR colour type (byte 25): 2 = truecolour without alpha.
File.ReadAllBytes(path)[25].Should().Be(2);
(await File.ReadAllBytesAsync(path, Ct))[25].Should().Be(2);
var decoded = await _decoder.LoadAsync(path, cancellationToken: Ct);
decoded.Should().NotBeNull();
decoded.ShouldHaveSamePixelsAs(frame);
@@ -115,7 +115,7 @@ public sealed class SkiaImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Jpeg, new EncoderSettings(JpegQuality: quality));
File.ReadAllBytes(path)[..3].Should().Equal(0xFF, 0xD8, 0xFF);
(await File.ReadAllBytesAsync(path, Ct))[..3].Should().Equal(0xFF, 0xD8, 0xFF);
var decoded = await _decoder.LoadAsync(path, cancellationToken: Ct);
decoded.Should().NotBeNull();
decoded.Width.Should().Be(32);
@@ -144,7 +144,7 @@ public sealed class SkiaImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Webp, new EncoderSettings(WebpQuality: 90));
var bytes = File.ReadAllBytes(path);
var bytes = await File.ReadAllBytesAsync(path, Ct);
Encoding.ASCII.GetString(bytes, 0, 4).Should().Be("RIFF");
Encoding.ASCII.GetString(bytes, 8, 4).Should().Be("WEBP");
// Skia decodes WebP everywhere; WIC needs an optional Windows codec (see WicImageDecoderTests).
@@ -163,7 +163,7 @@ public sealed class WicImageDecoderTests : IDisposable
{
var complete = await WriteAsync(TestFrames.Bgra(64, 64, TestFrames.Gradient), ImageFormat.Png);
var truncated = _temp.Combine("truncated.png");
await File.WriteAllBytesAsync(truncated, File.ReadAllBytes(complete)[..40], Ct);
await File.WriteAllBytesAsync(truncated, (await File.ReadAllBytesAsync(complete, Ct))[..40], Ct);
(await _decoder.LoadAsync(truncated, cancellationToken: Ct)).Should().BeNull();
}
@@ -65,7 +65,7 @@ public sealed class WicImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Tiff);
File.ReadAllBytes(path)[..4].Should().Equal(0x49, 0x49, 0x2A, 0x00); // "II*\0", little-endian TIFF
(await File.ReadAllBytesAsync(path, Ct))[..4].Should().Equal(0x49, 0x49, 0x2A, 0x00); // "II*\0", little-endian TIFF
var decoded = await _decoder.LoadAsync(path, cancellationToken: Ct);
decoded.Should().NotBeNull();
decoded.ShouldHaveSamePixelsAs(frame);
@@ -85,7 +85,7 @@ public sealed class WicImageEncoderTests : IDisposable
var path = await EncodeToFileAsync(frame, ImageFormat.Jxr);
File.ReadAllBytes(path)[..4].Should().Equal(0x49, 0x49, 0xBC, 0x01); // JPEG XR "II\xBC\x01"
(await File.ReadAllBytesAsync(path, Ct))[..4].Should().Equal(0x49, 0x49, 0xBC, 0x01); // JPEG XR "II\xBC\x01"
var decoded = await _decoder.LoadAsync(path, cancellationToken: Ct);
decoded.Should().NotBeNull();
decoded.Width.Should().Be(32);
@@ -56,7 +56,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
var records = await library.GetAllAsync(Ct);
records.Should().BeEmpty();
File.ReadAllText(_paths.LibraryIndexFile).Trim().Should().Be("[]");
(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct)).Trim().Should().Be("[]");
}
[Fact]
@@ -116,13 +116,13 @@ public sealed class CaptureLibraryServiceTests : IDisposable
.Select(i => new CaptureRecord(Path.Combine(_output, $"old-{i}.png"), Noon.AddMinutes(-i), 1, 1, ImageFormat.Png, 1, CaptureMode.Window, null))
.ToList();
Directory.CreateDirectory(_paths.DataDirectory);
File.WriteAllText(_paths.LibraryIndexFile, JsonSerializer.Serialize(existing, SettingsJsonContext.Default.ListCaptureRecord));
await File.WriteAllTextAsync(_paths.LibraryIndexFile, JsonSerializer.Serialize(existing, SettingsJsonContext.Default.ListCaptureRecord), Ct);
using var library = CreateLibrary();
var newest = await SaveCaptureAsync("newest.png", 10, 10, Noon.AddDays(1));
await library.AddAsync(newest, Ct);
using var index = JsonDocument.Parse(File.ReadAllText(_paths.LibraryIndexFile));
using var index = JsonDocument.Parse(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct));
var paths = index.RootElement.EnumerateArray().Select(r => r.GetProperty("filePath").GetString()).ToList();
paths.Should().HaveCount(2000);
paths[0].Should().Be(newest.FilePath);
@@ -144,7 +144,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
(await library.GetAllAsync(Ct)).Should().ContainSingle().Which.FilePath.Should().Be(kept.FilePath);
}
File.ReadAllText(_paths.LibraryIndexFile).Should().NotContain("deleted.png");
(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct)).Should().NotContain("deleted.png");
}
[Fact]
@@ -152,13 +152,13 @@ public sealed class CaptureLibraryServiceTests : IDisposable
{
await SaveCaptureAsync("on-disk.png", 12, 8, Noon);
Directory.CreateDirectory(_paths.DataDirectory);
File.WriteAllText(_paths.LibraryIndexFile, "{ definitely not a list");
await File.WriteAllTextAsync(_paths.LibraryIndexFile, "{ definitely not a list", Ct);
using var library = CreateLibrary();
var records = await library.GetAllAsync(Ct);
records.Should().ContainSingle().Which.FileName.Should().Be("on-disk.png");
File.ReadAllText(_paths.LibraryIndexFile).Should().Contain("on-disk.png");
(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct)).Should().Contain("on-disk.png");
}
// ---- First-run seeding ---------------------------------------------------------------
@@ -176,9 +176,9 @@ public sealed class CaptureLibraryServiceTests : IDisposable
var jpeg = await WriteImageAsync(Path.Combine(_output, "mid.jpg"), 50, 20, ImageFormat.Jpeg, Noon.AddHours(-2));
var hdr = await WriteImageAsync(Path.Combine(_output, "hdr.png"), 64, 48, ImageFormat.Png, Noon.AddHours(-1));
var sidecar = Path.Combine(_output, "hdr.jxr");
File.WriteAllBytes(sidecar, [0x49, 0x49, 0xBC, 0x01]);
await File.WriteAllBytesAsync(sidecar, [0x49, 0x49, 0xBC, 0x01], Ct);
var fromProfile = await WriteImageAsync(Path.Combine(profileFolder, "profile.png"), 16, 9, ImageFormat.Png, Noon.AddMinutes(-30));
File.WriteAllText(Path.Combine(_output, "notes.txt"), "not an image");
await File.WriteAllTextAsync(Path.Combine(_output, "notes.txt"), "not an image", Ct);
await WriteImageAsync(Path.Combine(_temp.CreateDirectory("Captures", "nested"), "nested.png"), 8, 8, ImageFormat.Png, Noon);
using var library = CreateLibrary();
@@ -194,7 +194,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
[Fact]
public async Task GetAllAsync_FirstRun_ListsAnUnreadableImageWithZeroSize()
{
File.WriteAllText(Path.Combine(_output, "broken.png"), "not really a png");
await File.WriteAllTextAsync(Path.Combine(_output, "broken.png"), "not really a png", Ct);
using var library = CreateLibrary();
var record = (await library.GetAllAsync(Ct)).Should().ContainSingle().Subject;
@@ -226,7 +226,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
using var library = CreateLibrary();
var record = await SaveCaptureAsync("hdr.png", 10, 10, Noon);
var sidecar = Path.ChangeExtension(record.FilePath, ".jxr");
File.WriteAllBytes(sidecar, [0x49, 0x49, 0xBC, 0x01]);
await File.WriteAllBytesAsync(sidecar, [0x49, 0x49, 0xBC, 0x01], Ct);
record = record with { HdrFilePath = sidecar };
await library.AddAsync(record, Ct);
var changed = 0;
@@ -240,7 +240,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
changed.Should().Be(1);
// The substitute does not delete anything, so the record must be gone from the index itself.
(await library.GetAllAsync(Ct)).Should().BeEmpty();
File.ReadAllText(_paths.LibraryIndexFile).Should().NotContain("hdr.png");
(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct)).Should().NotContain("hdr.png");
}
[Fact]
@@ -250,7 +250,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
using var library = CreateLibrary();
var record = await SaveCaptureAsync("locked.png", 10, 10, Noon);
var sidecar = Path.ChangeExtension(record.FilePath, ".jxr");
File.WriteAllBytes(sidecar, [0x49, 0x49, 0xBC, 0x01]);
await File.WriteAllBytesAsync(sidecar, [0x49, 0x49, 0xBC, 0x01], Ct);
record = record with { HdrFilePath = sidecar };
await library.AddAsync(record, Ct);
var changed = 0;
@@ -276,7 +276,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
deleted.Should().BeTrue();
_shell.DidNotReceive().MoveToRecycleBin(Arg.Any<string>());
File.ReadAllText(_paths.LibraryIndexFile).Should().NotContain("gone.png");
(await File.ReadAllTextAsync(_paths.LibraryIndexFile, Ct)).Should().NotContain("gone.png");
}
// ---- Thumbnails ------------------------------------------------------------------------
@@ -293,7 +293,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
thumbnail.Should().NotBeNull();
Path.GetDirectoryName(thumbnail).Should().Be(_paths.ThumbnailCacheDirectory);
thumbnail.Should().EndWith("_64.jpg");
File.ReadAllBytes(thumbnail)[..3].Should().Equal(0xFF, 0xD8, 0xFF);
(await File.ReadAllBytesAsync(thumbnail, Ct))[..3].Should().Equal(0xFF, 0xD8, 0xFF);
var image = await decoder.LoadAsync(thumbnail, cancellationToken: Ct);
image.Should().NotBeNull();
image.Width.Should().Be(64);
@@ -302,9 +302,9 @@ public sealed class CaptureLibraryServiceTests : IDisposable
Directory.GetFiles(_paths.ThumbnailCacheDirectory, "*.tmp").Should().BeEmpty();
// A cached thumbnail is served as is, not regenerated.
File.WriteAllBytes(thumbnail, [1, 2, 3]);
await File.WriteAllBytesAsync(thumbnail, [1, 2, 3], Ct);
(await library.GetThumbnailAsync(record, 64, Ct)).Should().Be(thumbnail);
File.ReadAllBytes(thumbnail).Should().Equal(1, 2, 3);
(await File.ReadAllBytesAsync(thumbnail, Ct)).Should().Equal(1, 2, 3);
}
[Fact]
@@ -357,7 +357,7 @@ public sealed class CaptureLibraryServiceTests : IDisposable
using var library = CreateLibrary();
var missing = new CaptureRecord(Path.Combine(_output, "missing.png"), Noon, 1, 1, ImageFormat.Png, 1, CaptureMode.Window, null);
var broken = missing with { FilePath = Path.Combine(_output, "broken.png") };
File.WriteAllText(broken.FilePath, "not a png");
await File.WriteAllTextAsync(broken.FilePath, "not a png", Ct);
(await library.GetThumbnailAsync(missing, 64, Ct)).Should().BeNull();
(await library.GetThumbnailAsync(broken, 64, Ct)).Should().BeNull();
@@ -77,7 +77,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
using var store = await LoadStoreAsync(legacy);
// The v1 file is only read: v1.5.1 keeps working if the user goes back to it.
File.ReadAllText(legacy).Should().Be(V151SettingsJson);
(await File.ReadAllTextAsync(legacy, Ct)).Should().Be(V151SettingsJson);
File.GetLastWriteTimeUtc(legacy).Should().Be(legacyWrittenAt);
var s = store.Current;
@@ -107,7 +107,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
s.UI.ShowLogViewer.Should().BeNull();
// The pre-migration document is kept next to the migrated one.
File.ReadAllText(Backups("v2").Should().ContainSingle().Subject).Should().Be(V151SettingsJson);
(await File.ReadAllTextAsync(Backups("v2").Should().ContainSingle().Subject, Ct)).Should().Be(V151SettingsJson);
// settings.json now holds a v3 document without the retired v2 fields.
var json = ReadSettingsFile();
@@ -187,7 +187,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
using var store = await LoadStoreAsync(legacy);
store.Current.Culture.Should().Be("vi-VN");
File.ReadAllText(legacy).Should().Be(V151SettingsJson);
(await File.ReadAllTextAsync(legacy, Ct)).Should().Be(V151SettingsJson);
}
[Fact]
@@ -214,7 +214,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
using var store = await LoadStoreAsync();
store.Current.Should().BeEquivalentTo(new AppSettings());
File.ReadAllText(Backups("corrupt").Should().ContainSingle().Subject).Should().Be(content);
(await File.ReadAllTextAsync(Backups("corrupt").Should().ContainSingle().Subject, Ct)).Should().Be(content);
ReadSettingsFile().GetProperty("version").GetInt32().Should().Be(AppSettings.CurrentVersion);
}
@@ -237,7 +237,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
using var store = await LoadStoreAsync();
File.ReadAllText(Backups("v7").Should().ContainSingle().Subject).Should().Be(future);
(await File.ReadAllTextAsync(Backups("v7").Should().ContainSingle().Subject, Ct)).Should().Be(future);
store.Current.Version.Should().Be(AppSettings.CurrentVersion);
store.Current.Culture.Should().Be("fr-FR");
store.Current.Theme.Should().Be("Dark");
@@ -612,7 +612,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
store.Current.Should().BeEquivalentTo(new AppSettings { Culture = "vi-VN" });
changed.Should().Be(1);
using (var backup = JsonDocument.Parse(File.ReadAllText(Backups("reset").Should().ContainSingle().Subject)))
using (var backup = JsonDocument.Parse(await File.ReadAllTextAsync(Backups("reset").Should().ContainSingle().Subject, Ct)))
{
backup.RootElement.GetProperty("theme").GetString().Should().Be("Dark");
backup.RootElement.GetProperty("capture").GetProperty("jpegQuality").GetInt32().Should().Be(40);
@@ -670,7 +670,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
private async Task ShouldRejectImportAsync(JsonSettingsStore store, string importPath)
{
var before = store.Current;
var fileBefore = File.ReadAllText(_paths.SettingsFile);
var fileBefore = await File.ReadAllTextAsync(_paths.SettingsFile, Ct);
var changed = 0;
store.Changed += (_, _) => changed++;
@@ -678,7 +678,7 @@ public sealed class JsonSettingsStoreTests : IDisposable
await act.Should().ThrowAsync<InvalidDataException>();
store.Current.Should().BeSameAs(before);
File.ReadAllText(_paths.SettingsFile).Should().Be(fileBefore);
(await File.ReadAllTextAsync(_paths.SettingsFile, Ct)).Should().Be(fileBefore);
changed.Should().Be(0);
}
@@ -9,6 +9,7 @@ using CaptureImage.Core.Models;
using CaptureImage.Infrastructure.Steam;
using CaptureImage.Infrastructure.Tests.TestSupport;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Time.Testing;
using Xunit;
namespace CaptureImage.Infrastructure.Tests.Steam;
@@ -211,6 +212,27 @@ public sealed class SteamLibraryScannerTests : IDisposable
scanner.TryGetAppInfo(later).Should().BeNull();
}
[Fact]
public void TryGetAppInfo_AfterAFailedScan_RetriesAMinuteLater()
{
WriteLibraryFolders(_steamRoot);
var exe = InstallApp(_steamRoot, Dota);
var time = new FakeTimeProvider(DateTimeOffset.UnixEpoch);
var failing = true;
var scanner = new SteamLibraryScanner(
() => failing ? throw new InvalidOperationException("registry hiccup") : _steamRoot,
NullLogger<SteamLibraryScanner>.Instance,
time);
scanner.TryGetAppInfo(exe).Should().BeNull("the scan failed");
failing = false;
scanner.TryGetAppInfo(exe).Should().BeNull("a failed scan waits before trying again");
time.Advance(TimeSpan.FromMinutes(1));
scanner.TryGetAppInfo(exe).Should().Be(Dota, "the scan is retried instead of failing every lookup");
}
// ---- Fake Steam installation -------------------------------------------------------
private SteamLibraryScanner CreateScanner(Func<string?>? steamRoot = null) =>
@@ -8,6 +8,12 @@
"resolved": "9.6.0",
"contentHash": "8kdtgI+tZIgP46ncnk650/dU4JSrn+n2Dkic8FvjIFn72P6Nv1Afyr5F8F3PsokHg1GBSBVo1/Z+eZOrU5esSA=="
},
"Microsoft.Extensions.TimeProvider.Testing": {
"type": "Direct",
"requested": "[10.11.0, )",
"resolved": "10.11.0",
"contentHash": "DTivKZ2Du0dJideTTa6vPj/eXKNRu+RxtjBX7NOOUXHBtHx1ehbE+lM+j3/5M3wU6BqzcZqEEyR4+FnPKs2rTA=="
},
"Microsoft.Testing.Extensions.CodeCoverage": {
"type": "Direct",
"requested": "[18.12.0, )",
@@ -220,14 +226,14 @@
"captureimage.core": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
}
},
"captureimage.infrastructure": {
"type": "Project",
"dependencies": {
"CaptureImage.Core": "[1.5.1, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )",
"CaptureImage.Core": "[2.0.2, )",
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )",
"Serilog": "[4.4.0, )",
"SkiaSharp": "[4.153.1, )",
"Velopack": "[1.2.161, )",
@@ -238,17 +244,17 @@
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.13, )",
"resolved": "10.0.13",
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
"requested": "[10.0.14, )",
"resolved": "10.0.14",
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
}
},
"Serilog": {
@@ -16,7 +16,7 @@ namespace CaptureImage.ViewModels.Tests.Localization;
/// test doesn't leak into the next one running on the same test runner thread.
/// </summary>
[Collection(LocalizationTestCollection.Name)]
public class ResxLocalizationServiceTests : IDisposable
public sealed class ResxLocalizationServiceTests : IDisposable
{
private readonly CultureInfo _savedUICulture;
private readonly CultureInfo _savedCulture;
@@ -0,0 +1,80 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (c) CaptureImage Contributors
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using AwesomeAssertions;
using Xunit;
namespace CaptureImage.ViewModels.Tests.Shell;
/// <summary>
/// Dependency upgrades touch more than <c>Directory.Packages.props</c>: the third-party notices
/// (linked from the About page and shipped with the app) must list exactly the packages in the
/// app's lock file at the locked versions, and the <c>vpk</c> tool that packs a release must
/// match the Velopack library inside it.
/// </summary>
public sealed partial class DependencyManifestTests
{
[Fact]
public void ThirdPartyNotices_ListEveryShippedPackageAtItsLockedVersion()
{
var locked = LockedAppPackages();
var listed = PackagesListedInNotices();
locked.Should().NotBeEmpty();
listed.Should().BeEquivalentTo(locked, "docs/legal/THIRD_PARTY_NOTICES.md must follow src/CaptureImage.App/packages.lock.json");
}
[Fact]
public void VelopackLibrary_MatchesTheVpkTool()
{
var root = RepositoryRoot();
var library = XDocument.Load(Path.Combine(root, "Directory.Packages.props")).Descendants("PackageVersion")
.Single(e => (string?)e.Attribute("Include") == "Velopack")
.Attribute("Version")!.Value;
using var manifest = JsonDocument.Parse(File.ReadAllText(Path.Combine(root, ".config", "dotnet-tools.json")));
var tool = manifest.RootElement.GetProperty("tools").GetProperty("vpk").GetProperty("version").GetString();
tool.Should().Be(library, "the release is packed by vpk and updated by the Velopack library, which must agree on the package format");
}
/// <summary>Package id → resolved version for everything the app's publish output contains.</summary>
private static Dictionary<string, string> LockedAppPackages()
{
var path = Path.Combine(RepositoryRoot(), "src", "CaptureImage.App", "packages.lock.json");
using var lockFile = JsonDocument.Parse(File.ReadAllText(path));
// One entry per framework plus one per framework/RID; the RID entry repeats packages with native assets.
var graph = lockFile.RootElement.GetProperty("dependencies").EnumerateObject()
.Single(framework => !framework.Name.Contains('/', StringComparison.Ordinal)).Value;
return graph.EnumerateObject()
.Where(package => package.Value.GetProperty("type").GetString() != "Project")
.ToDictionary(package => package.Name, package => package.Value.GetProperty("resolved").GetString()!, StringComparer.Ordinal);
}
/// <summary>Package id → version from the notices' <c>| Package | Version | License | Project |</c> tables.</summary>
private static Dictionary<string, string> PackagesListedInNotices()
{
var path = Path.Combine(RepositoryRoot(), "docs", "legal", "THIRD_PARTY_NOTICES.md");
return File.ReadLines(path)
.Select(line => PackageRow().Match(line))
.Where(match => match.Success)
.ToDictionary(match => match.Groups["id"].Value, match => match.Groups["version"].Value, StringComparer.Ordinal);
}
private static string RepositoryRoot()
{
for (var dir = new DirectoryInfo(AppContext.BaseDirectory); dir is not null; dir = dir.Parent)
{
if (File.Exists(Path.Combine(dir.FullName, "CaptureImage.sln")))
{
return dir.FullName;
}
}
throw new DirectoryNotFoundException("CaptureImage.sln not found above the test output folder.");
}
[GeneratedRegex(@"^\| (?<id>[A-Za-z0-9][A-Za-z0-9.\-]*) \| (?<version>\d[^ |]*) \|")]
private static partial Regex PackageRow();
}
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff. Show more