private static CachingXDocument?TryGetXmlDocsDocument(AssemblyName assemblyName, string?pathToXmlFile) { if (Cache.TryGetValue(assemblyName.FullName, out var document)) { return(document); } if (pathToXmlFile is null) { return(null); } if (DynamicApis.FileExists(pathToXmlFile) == false) { Cache[assemblyName.FullName] = null; return(null); } document = new CachingXDocument(pathToXmlFile); Cache[assemblyName.FullName] = document; return(document); }
private static XElement?GetXmlDocsElement(this ParameterInfo parameter, CachingXDocument xml) { var name = GetMemberElementName(parameter.Member); var element = xml.GetXmlDocsElement(name); if (element != null) { ReplaceInheritdocElements(parameter.Member, element); IEnumerable result; if (parameter.IsRetval || string.IsNullOrEmpty(parameter.Name)) { result = element.Elements("returns"); } else { result = element.Elements("param").Where(x => x.Attribute("name")?.Value == parameter.Name); } return(result.OfType <XElement>().FirstOrDefault()); } return(null); }
internal static XElement?GetXmlDocsElement(this XDocument xml, string name) { return(CachingXDocument.GetXmlDocsElement(xml, name)); }
private static XElement?GetXmlDocsElement(this MemberInfo member, CachingXDocument xml) { var name = GetMemberElementName(member); return(xml.GetXmlDocsElement(name)); }
internal static XElement?GetXmlDocsElement(this XDocument xml, string name) { var result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']"); return(CachingXDocument.GetXmlDocsElement(xml, name)); }