Class RecoveryPanel
- Namespace
- Archiver.App.Core
- Assembly
- Archiver.App.Core.dll
T-F275 step 3c: the Archive Browser's line about the PAR2 files next to the open archive. Before a test it says only that files were found (whether they are usable is known after the test); after a test it carries Core's verdict for that archive. Pure, so the rules are tested without a window.
public sealed record RecoveryPanel : IEquatable<RecoveryPanel>
- Inheritance
-
RecoveryPanel
- Implements
- Inherited Members
Constructors
RecoveryPanel(bool, RecoveryPanelSeverity, string)
T-F275 step 3c: the Archive Browser's line about the PAR2 files next to the open archive. Before a test it says only that files were found (whether they are usable is known after the test); after a test it carries Core's verdict for that archive. Pure, so the rules are tested without a window.
public RecoveryPanel(bool HasFiles, RecoveryPanelSeverity Severity, string Text)
Parameters
HasFilesboolPAR2 files lie next to the archive (HasFilesFor(string)).
SeverityRecoveryPanelSeverityInformational until a test has run.
TextstringThe line shown.
Properties
HasFiles
PAR2 files lie next to the archive (HasFilesFor(string)).
public bool HasFiles { get; init; }
Property Value
None
No PAR2 files, or none looked for: nothing is shown.
public static RecoveryPanel None { get; }
Property Value
OffersRepair
Whether Repair is worth offering (step 4c): before any check, since only reading the archive tells, and after one that found damage the set can rebuild. Not after a match, a repair, or a verdict no repair changes.
public bool OffersRepair { get; init; }
Property Value
Severity
Informational until a test has run.
public RecoveryPanelSeverity Severity { get; init; }
Property Value
Text
The line shown.
public string Text { get; init; }
Property Value
Methods
After(string, ArchiveResult, Func<CoreText?, string, string>)
The panel after a test of archivePath: what the set said about that
archive, in Core's words. Another archive's verdict is never taken, and a result that says
nothing about a set (none was found after all) leaves the panel as it was.
public RecoveryPanel After(string archivePath, ArchiveResult result, Func<CoreText?, string, string> render)
Parameters
Returns
AfterRepair(string, ArchiveResult, Func<CoreText?, string, string>)
The panel after a repair of archivePath (step 4c): that it was repaired
and where the copy is, in Core's words, or what After(string, ArchiveResult, Func<CoreText?, string, string>) makes of the result
when nothing was repaired.
public RecoveryPanel AfterRepair(string archivePath, ArchiveResult result, Func<CoreText?, string, string> render)
Parameters
Returns
Found(string, string?)
Files were found and no test has run. listingError is why the archive
could not be opened, when it could not: the archive stays open for the test instead of
the error being all the user gets (the case recovery data exists for).
public static RecoveryPanel Found(string foundText, string? listingError = null)
Parameters
Returns
IsOpenAt(bool, bool)
Whether the panel shows where the user is: only in the archive opened from disk. A nested archive is a temporary copy with no set next to it, and a real folder is not an archive. Where it shows, Test is offered even if ShowsTest alone would hide it: a tar-family archive, or one whose listing failed, is checked by its set.
public bool IsOpenAt(bool insideArchive, bool nested)
Parameters
Returns
MatchLine(string, ArchiveResult, Func<CoreText?, string, string>)
The lines a "no errors" dialog adds for archivePath: that its set matches.
public static string? MatchLine(string archivePath, ArchiveResult result, Func<CoreText?, string, string> render)
Parameters
Returns
NeedsAnotherFolder(string, ArchiveResult)
Whether the repair of archivePath built nothing because the copy could
not be written where it was meant to go: another folder may do.
public static bool NeedsAnotherFolder(string archivePath, ArchiveResult result)
Parameters
archivePathstringresultArchiveResult
Returns
RepairedCopy(string, ArchiveResult)
The repaired copy of archivePath in a repair's result, or null.
public static string? RepairedCopy(string archivePath, ArchiveResult result)
Parameters
archivePathstringresultArchiveResult