Class TranslationList
Wrapper for a Dictionary<TKey, TValue>, has custom JSON reading to take a string or dictionary of translations.
null = empty list.
[JsonConverter(typeof(TranslationListConverter))]
[TypeConverter(typeof(TranslationListTypeConverter))]
public sealed class TranslationList : List<KeyValuePair<string, string>>, IList<KeyValuePair<string, string>>, IReadOnlyList<KeyValuePair<string, string>>, IReadOnlyCollection<KeyValuePair<string, string>>, IList, ICollection, ICloneable, IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable
- Inheritance
-
TranslationList
- Implements
- Inherited Members
- Extension Methods
Constructors
TranslationList()
public TranslationList()
TranslationList(IDictionary<string, string>)
public TranslationList(IDictionary<string, string> dictionary)
Parameters
dictionaryIDictionary<string, string>
TranslationList(int)
public TranslationList(int capacity)
Parameters
capacityint
TranslationList(int, string)
public TranslationList(int capacity, string @default)
Parameters
TranslationList(string)
public TranslationList(string @default)
Parameters
defaultstring
TranslationList(TranslationList)
public TranslationList(TranslationList copy)
Parameters
copyTranslationList
Fields
DefaultCharLength
public const int DefaultCharLength = 255
Field Value
Methods
Add(string?, string)
Use language overload if possible.
public void Add(string? code, string value)
Parameters
Add(LanguageInfo?, string)
public void Add(LanguageInfo? language, string value)
Parameters
languageLanguageInfovaluestring
Clone()
public TranslationList Clone()
Returns
Translate(LanguageInfo?)
public string? Translate(LanguageInfo? language)
Parameters
languageLanguageInfo
Returns
Translate(LanguageInfo?, string?)
public string? Translate(LanguageInfo? language, string? @default)
Parameters
languageLanguageInfodefaultstring