in tools/simpleresgen/mono/ResXResourceReader.cs [277:323]
private void ParseDataNode (bool meta)
{
OrderedDictionary hashtable = ((meta && ! useResXDataNodes) ? hashtm : hasht);
Point pos = new Point (xmlReader.LineNumber, xmlReader.LinePosition);
string name = GetAttribute ("name");
string type_name = GetAttribute ("type");
string mime_type = GetAttribute ("mimetype");
string comment = null;
string value = GetDataValue (meta, out comment);
ResXDataNode node = new ResXDataNode (name, mime_type, type_name, value, comment, pos, BasePath);
if (useResXDataNodes) {
hashtable [name] = node;
return;
}
if (name == null)
throw new ArgumentException (string.Format (CultureInfo.CurrentCulture,
"Could not find a name for a resource. The resource value was '{0}'.",
node.GetValue ((AssemblyName []) null).ToString()));
// useResXDataNodes is false, add to dictionary of values
if (assemblyNames != null) {
try {
hashtable [name] = node.GetValue (assemblyNames);
} catch (TypeLoadException ex) {
// different error messages depending on type of resource, hacky solution
if (node.handler is TypeConverterFromResXHandler)
hashtable [name] = null;
else
throw ex;
}
} else { // there is a typeresolver or its null
try {
hashtable [name] = node.GetValue (typeresolver);
} catch (TypeLoadException ex) {
if (node.handler is TypeConverterFromResXHandler)
hashtable [name] = null;
else
throw ex;
}
}
}