Beispiel #1
0
 public void CanRenderDocForHttpRuntimeAppDomainAppId()
 {
     var type = typeof(HttpRuntime);
     var member = type.GetMember("AppDomainAppId")[0];
     var docProvider = XmlDocLoader.LoadDocumentation(member.Module);
     Assert.IsNotNull(docProvider);
     string documentation = docProvider.GetDocumentation(XmlDocKeyProvider.GetKey(member));
     Assert.IsFalse(String.IsNullOrEmpty(documentation));
     var renderer = new XmlDocRenderer();
     renderer.AddXmlDocumentation(documentation);
     var renderedDoc = renderer.CreateTextBlock();
     Assert.IsFalse(String.IsNullOrEmpty(renderedDoc));
 }
Beispiel #2
0
        private static string GetDoc(MemberInfo member)
        {
            try
            {
                var docProvider = XmlDocLoader.LoadDocumentation(member.Module);
                if (docProvider != null)
                {
                    string documentation = docProvider.GetDocumentation(XmlDocKeyProvider.GetKey(member));
                    if (documentation != null)
                    {
                        var renderer = new XmlDocRenderer();
                        renderer.AddXmlDocumentation(documentation);
                        return renderer.CreateTextBlock();
                    }
                }
            }
            catch
            {
                return "Exception for " + member.Name;
            }

            return String.Empty;
        }