◆ LocalizableAttributeProperty()
CommandLine.Infrastructure.LocalizableAttributeProperty.LocalizableAttributeProperty |
( |
string |
propertyName | ) |
|
◆ GetLocalizedValue()
string CommandLine.Infrastructure.LocalizableAttributeProperty.GetLocalizedValue |
( |
| ) |
|
|
private |
Definition at line 37 of file LocalizableAttributeProperty.cs.
38 {
40 {
42 }
43
45 {
46
48 {
49 throw new
50 ArgumentException($"Invalid resource type '{_type.FullName}'! {_type.Name} is not visible for the parser! Change resources 'Access Modifier' to 'Public'",
52 );
53 }
54
55 PropertyInfo propertyInfo =
56 _type.GetProperty(
_value, BindingFlags.Public | BindingFlags.GetProperty | BindingFlags.Static);
57
58 if (propertyInfo == null ||
59 !propertyInfo.CanRead ||
60 (propertyInfo.PropertyType != typeof(string) && !propertyInfo.PropertyType.CanCast<string>()))
61 {
62 throw new ArgumentException($"Invalid resource property name! Localized value: {_value}",
64 );
65 }
66
68 }
69
71 .Cast<string>();
72 }
PropertyInfo _localizationPropertyInfo
◆ _localizationPropertyInfo
PropertyInfo CommandLine.Infrastructure.LocalizableAttributeProperty._localizationPropertyInfo |
|
private |
◆ _propertyName
readonly string CommandLine.Infrastructure.LocalizableAttributeProperty._propertyName |
|
private |
◆ _type
Type CommandLine.Infrastructure.LocalizableAttributeProperty._type |
|
private |
◆ _value
string CommandLine.Infrastructure.LocalizableAttributeProperty._value |
|
private |
◆ ResourceType
Type CommandLine.Infrastructure.LocalizableAttributeProperty.ResourceType |
|
set |
◆ Value
string CommandLine.Infrastructure.LocalizableAttributeProperty.Value |
|
getset |
The documentation for this class was generated from the following file: