private static void LoadAsmClassifier(ClassifierCollection dict, XDocument xdoc, string elementName, string tydef) { var collection = xdoc.Root.Element(elementName + "Collection"); if (collection != null) { string key = null; foreach (var xe in collection.Elements(elementName)) { key = xe.Value; var realdef = new ClassifierDefinition() { classifier = tydef }; if (xe.HasAttributes) { var attr = xe.Attribute("val"); if (attr != null) { key = attr.Value; } realdef.brief = xe.Value; } #if DEBUG TryCatchDictAdd(dict, key, realdef); #else dict.Add(xe.Value, tydef); #endif } } }
static void TryCatchDictAdd(ClassifierCollection dict, string key, ClassifierDefinition value) { try { dict.Add(key, value); } catch { Debugger.Break(); } }