예제 #1
0
        public bool LoadXmlDocFrom(DocResolver resolver, string location)
        {
            try
            {
                var ext         = Path.GetExtension(location);
                var xmlFilePath = location.Substring(0, location.Length - ext.Length) + ".xml";

                return(resolver.ParseXml(xmlFilePath));
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #2
0
        public DocResolver GetResolver(Assembly assembly)
        {
            DocResolver resolver;

            if (!_resolvers.TryGetValue(assembly, out resolver))
            {
                resolver = _resolvers[assembly] = new DocResolver();
                if (!LoadXmlDocFrom(resolver, assembly.Location))
                {
                    var fi = new FileInfo(assembly.Location);
                    LoadXmlDocFrom(resolver, Path.Combine(bindingManager.prefs.xmlDocDir, fi.Name));
                }
            }
            return(resolver);
        }