Class InlinePasswordState
- Namespace
- Archiver.App.Core
- Assembly
- Archiver.App.Core.dll
T-F199: the encryption password typed inline under the checkbox, checked while typing with Core's EncryptionPasswordRule. Like a Windows PIN box, a field keeps only allowed characters; a refused one blocks until that field is emptied, because in a Ukrainian layout the ASCII left over in both fields would still match. Holds the text only while the window needs it: the caller clears it after the operation, when encryption is turned off, when the format changes and when the window closes; nothing is persisted or logged.
public sealed class InlinePasswordState
- Inheritance
-
InlinePasswordState
- Inherited Members
Properties
CanProceed
True when the password can be used.
public bool CanProceed { get; }
Property Value
Issue
The first problem: a refused character, then the rule's order, then the confirmation.
public InlinePasswordIssue Issue { get; }
Property Value
LooksLikeWrongKeyboardLayout
A refused letter suggests a non-English keyboard layout (the Ukrainian-layout trap).
public bool LooksLikeWrongKeyboardLayout { get; }
Property Value
MessageKey
The resource key of the one line shown under the fields, or null while the user is still typing or the password is fine. The layout hint replaces the characters error it explains.
public string? MessageKey { get; }
Property Value
Password
The password as kept (allowed characters only).
public string Password { get; }
Property Value
ShowsError
True when the issue deserves a visible message (not merely "keep typing").
public bool ShowsError { get; }
Property Value
Methods
AllowsCompress(bool, ArchiveContainerFormat)
False while an applicable password is not yet usable.
public bool AllowsCompress(bool encryptChecked, ArchiveContainerFormat format)
Parameters
encryptCheckedboolformatArchiveContainerFormat
Returns
Applies(bool, ArchiveContainerFormat)
True when the password is asked for: the box is ticked and the format is ZIP. A tar format hides the box without unticking it, and tar has no password.
public static bool Applies(bool encryptChecked, ArchiveContainerFormat format)
Parameters
encryptCheckedboolformatArchiveContainerFormat
Returns
Clear()
Forgets both fields.
public void Clear()
SetConfirmation(string)
Takes the confirmation field's text; returns what the field should show.
public string SetConfirmation(string value)
Parameters
valuestring
Returns
SetPassword(string)
Takes the password field's text; returns what the field should show.
public string SetPassword(string value)
Parameters
valuestring