Table of Contents

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

bool

Issue

The first problem: a refused character, then the rule's order, then the confirmation.

public InlinePasswordIssue Issue { get; }

Property Value

InlinePasswordIssue

LooksLikeWrongKeyboardLayout

A refused letter suggests a non-English keyboard layout (the Ukrainian-layout trap).

public bool LooksLikeWrongKeyboardLayout { get; }

Property Value

bool

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

string

Password

The password as kept (allowed characters only).

public string Password { get; }

Property Value

string

ShowsError

True when the issue deserves a visible message (not merely "keep typing").

public bool ShowsError { get; }

Property Value

bool

Methods

AllowsCompress(bool, ArchiveContainerFormat)

False while an applicable password is not yet usable.

public bool AllowsCompress(bool encryptChecked, ArchiveContainerFormat format)

Parameters

encryptChecked bool
format ArchiveContainerFormat

Returns

bool

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

encryptChecked bool
format ArchiveContainerFormat

Returns

bool

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

value string

Returns

string

SetPassword(string)

Takes the password field's text; returns what the field should show.

public string SetPassword(string value)

Parameters

value string

Returns

string