Struct NLSMap
Represents a JSON-serializable structure that keys [N]ame and [D]escription on lang ISO.
It respects JSONWritingOptions.NLSMapLanguageISO and NLSMapLanguageISODefault
Implements
System.Collections.Generic.IEnumerable<
System.Collections.Generic.KeyValuePair<
System.String,
NLSMap.NDPair>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: NFX.dll
Syntax
[Serializable]
public struct NLSMap : IEnumerable<KeyValuePair<string, NLSMap.NDPair>>, IEnumerable, IJSONWritable
Constructors
NLSMap(IConfigSectionNode)
Makes NLSMap out of conf node: eng{n='Cucumber' d='It is green'} deu{n='Gurke' d='Es ist grün'}
Declaration
public NLSMap(IConfigSectionNode nlsNode)
Parameters
NLSMap(String)
Makes NLSMap out of JSON string: {eng: {n: 'Cucumber',d: 'It is green'}, deu: {n='Gurke',d='Es ist grün'}}
Declaration
public NLSMap(string nlsConf)
Parameters
| Type |
Name |
Description |
| System.String |
nlsConf |
|
Fields
MAX_ISO_COUNT
Declaration
public const int MAX_ISO_COUNT = 10000
Field Value
| Type |
Description |
| System.Int32 |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Item[Int32]
Declaration
public NLSMap.NDPair this[int iso] { get; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
iso |
|
Property Value
Item[String]
Declaration
public NLSMap.NDPair this[string langIso] { get; }
Parameters
| Type |
Name |
Description |
| System.String |
langIso |
|
Property Value
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
Get(NLSMap.GetParts, String, String, String)
Tries to get the specified part(s) from the map defaulting to another lang if requested lang is not found.
Returns null if nothing is found
Declaration
public string Get(NLSMap.GetParts tp, string langIso = null, string dfltLangIso = null, string concat = null)
Parameters
| Type |
Name |
Description |
| NLSMap.GetParts |
tp |
|
| System.String |
langIso |
|
| System.String |
dfltLangIso |
|
| System.String |
concat |
|
Returns
| Type |
Description |
| System.String |
|
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<string, NLSMap.NDPair>> GetEnumerator()
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, NLSMap.NDPair>> |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
OverrideBy(NLSMap)
Takes entries from this instance and overides them by ISO keys from another instance returning the new instance
Declaration
public NLSMap OverrideBy(NLSMap other)
Parameters
| Type |
Name |
Description |
| NLSMap |
other |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.ValueType.ToString()
TryGet(String, out String, NLSMap.GetParts, String, String, String)
Tries to get the specified part(s) from the JSON content that represents map defaulting to another lang if requested lang is not found.
Returns null if nothing is found
Declaration
public static bool TryGet(string json, out string result, NLSMap.GetParts tp, string langIso = null, string dfltLangIso = null, string concat = null)
Parameters
| Type |
Name |
Description |
| System.String |
json |
|
| System.String |
result |
|
| NLSMap.GetParts |
tp |
|
| System.String |
langIso |
|
| System.String |
dfltLangIso |
|
| System.String |
concat |
|
Returns
| Type |
Description |
| System.Boolean |
|
WriteAsJSON(TextWriter, Int32, JSONWritingOptions)
Writes NLSMap either as a dict or as a {n:"", d: ""} pair as Options.NLSMapLanguageISO filter dictates
Declaration
public void WriteAsJSON(TextWriter wri, int nestingLevel, JSONWritingOptions options = null)
Parameters
| Type |
Name |
Description |
| System.IO.TextWriter |
wri |
|
| System.Int32 |
nestingLevel |
|
| JSONWritingOptions |
options |
|
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods