Ensure mandatory character replacements remain marked mandatory
This commit is contained in:
parent
d165dfbeb5
commit
63200592bf
2 changed files with 4 additions and 4 deletions
|
|
@ -12,9 +12,9 @@ namespace FileManager
|
||||||
public const int FIXED_COUNT = 6;
|
public const int FIXED_COUNT = 6;
|
||||||
|
|
||||||
internal const char QUOTE_MARK = '"';
|
internal const char QUOTE_MARK = '"';
|
||||||
[JsonIgnore] public bool Mandatory { get; internal set; }
|
[JsonIgnore] public bool Mandatory { get; set; }
|
||||||
[JsonProperty] public char CharacterToReplace { get; private set; }
|
[JsonProperty] public char CharacterToReplace { get; private set; }
|
||||||
[JsonProperty] public string ReplacementString { get; set; }
|
[JsonProperty] public string ReplacementString { get; private set; }
|
||||||
[JsonProperty] public string Description { get; set; }
|
[JsonProperty] public string Description { get; set; }
|
||||||
public override string ToString() => $"{CharacterToReplace} → {ReplacementString} ({Description})";
|
public override string ToString() => $"{CharacterToReplace} → {ReplacementString} ({Description})";
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace FileManager
|
||||||
ReplacementString = replacementString;
|
ReplacementString = replacementString;
|
||||||
Description = description;
|
Description = description;
|
||||||
}
|
}
|
||||||
private Replacement(char charToReplace, string replacementString, string description, bool mandatory = false)
|
private Replacement(char charToReplace, string replacementString, string description, bool mandatory)
|
||||||
: this(charToReplace, replacementString, description)
|
: this(charToReplace, replacementString, description)
|
||||||
{
|
{
|
||||||
Mandatory = mandatory;
|
Mandatory = mandatory;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace LibationAvalonia.Dialogs
|
||||||
{
|
{
|
||||||
var replacements = SOURCE
|
var replacements = SOURCE
|
||||||
.Where(r=> !r.IsDefault)
|
.Where(r=> !r.IsDefault)
|
||||||
.Select(r => new Replacement(r.Character, r.ReplacementText, r.Description))
|
.Select(r => new Replacement(r.Character, r.ReplacementText, r.Description) { Mandatory = r.Mandatory })
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (config is not null)
|
if (config is not null)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue