private void ctor(IConfigSectionNode nlsNode) { if (!nlsNode.HasChildren) return; var cnt = nlsNode.ChildCount; if (cnt>MAX_ISO_COUNT) throw new NFXException("Exceeded NLSMap.MAX_ISO_COUNT"); m_Data = new NDPair[cnt]; for(var i=0; i<cnt; i++) { var node = nlsNode[i]; m_Data[i] = new NDPair( IOMiscUtils.PackISO3CodeToInt(node.Name), node.AttrByName("n").Value, node.AttrByName("d").Value ); } }
private void ctor(IConfigSectionNode nlsNode) { if (!nlsNode.HasChildren) { return; } var cnt = nlsNode.ChildCount; if (cnt > MAX_ISO_COUNT) { throw new AzosException("Exceeded NLSMap.MAX_ISO_COUNT"); } m_Data = new NDPair[cnt]; for (var i = 0; i < cnt; i++) { var node = nlsNode[i]; m_Data[i] = new NDPair(Atom.Encode(node.Name), node.AttrByName("n").Value, node.AttrByName("d").Value); } }
private string getSwitch(NDPair p, GetParts tp, string concat) { switch(tp) { case GetParts.Name: { return p.Name; } case GetParts.Description: { return p.Description; } case GetParts.NameOrDescription: { if (p.Name.IsNotNullOrWhiteSpace()) return p.Name; return p.Description; } case GetParts.DescriptionOrName: { if (p.Description.IsNotNullOrWhiteSpace()) return p.Description; return p.Name; } case GetParts.NameAndDescription: { var isName = p.Name.IsNotNullOrWhiteSpace(); var isDescr = p.Description.IsNotNullOrWhiteSpace(); if (isName && isDescr) return p.Name+concat+p.Description; if (isName) return p.Name; if (isDescr) return p.Description; return null; } case GetParts.DescriptionAndName: { var isName = p.Name.IsNotNullOrWhiteSpace(); var isDescr = p.Description.IsNotNullOrWhiteSpace(); if (isName && isDescr) return p.Description+concat+p.Name; if (isDescr) return p.Description; if (isName) return p.Name; return null; } } return null; }