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)); }
public static string GetOpCodeDocumentation(OpCode code) { int index = (int)code.Code; int hi = index >> 8; if (hi == 0xFE) index -= 0xFD00; else if (hi != 0) return null; var s = cachedOpCodeDocs[index]; if (s != null) return s; var docProvider = XmlDocLoader.MscorlibDocumentation; if (docProvider != null) { string docXml = docProvider.GetDocumentation("F:System.Reflection.Emit.OpCodes." + code.Code.ToString()); if (docXml != null) { XmlDocRenderer renderer = new XmlDocRenderer(); renderer.AddXmlDocumentation(docXml); return cachedOpCodeDocs[index] = renderer.ToString(); } } return null; }
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; }