예제 #1
0
        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
                }
            }
        }
예제 #2
0
 static void TryCatchDictAdd(ClassifierCollection dict, string key, ClassifierDefinition value)
 {
     try
     {
         dict.Add(key, value);
     }
     catch
     {
         Debugger.Break();
     }
 }