From 083fca29b6eee5c84adec079cbe3f54c2a7792fc Mon Sep 17 00:00:00 2001 From: "Hadil Ap. dos Santos Junior" Date: Fri, 8 Jan 2021 08:07:05 -0300 Subject: [PATCH] Added localized MetaName, issue #728 --- src/CommandLine/BaseAttribute.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/CommandLine/BaseAttribute.cs b/src/CommandLine/BaseAttribute.cs index be0a3826..30e25f14 100644 --- a/src/CommandLine/BaseAttribute.cs +++ b/src/CommandLine/BaseAttribute.cs @@ -13,7 +13,7 @@ public abstract class BaseAttribute : Attribute private int max; private object @default; private Infrastructure.LocalizableAttributeProperty helpText; - private string metaValue; + private Infrastructure.LocalizableAttributeProperty metaValue; private Type resourceType; /// @@ -24,7 +24,7 @@ protected internal BaseAttribute() min = -1; max = -1; helpText = new Infrastructure.LocalizableAttributeProperty(nameof(HelpText)); - metaValue = string.Empty; + metaValue = new Infrastructure.LocalizableAttributeProperty(nameof(MetaValue)); resourceType = null; } @@ -101,16 +101,8 @@ public string HelpText /// public string MetaValue { - get { return metaValue; } - set - { - if (value == null) - { - throw new ArgumentNullException("value"); - } - - metaValue = value; - } + get => metaValue.Value ?? string.Empty; + set => metaValue.Value = value ?? throw new ArgumentNullException("value"); } ///