private void ReadProperty(ExtractorContext context, string referenceName, XElement element) { XElement summary = element.Element("summary"); if (summary != null) { string summaryText = summary.Value.Trim(); context.AddPropertySummary(referenceName, summaryText); } }
private void ReadType(ExtractorContext context, string referenceName, XElement element) { XElement summary = element.Element("summary"); if (summary != null) { string summaryText = summary.Value.Trim(); context.AddDocumentation(referenceName, element.ToString()); } }
/// <summary> /// Manages the lifecycle of the ExtractorContext and delegates to child extractors. /// </summary> /// <param name="contextFunc"></param> /// <returns>A ProjectData object with all types from the requested assemblies</returns> public ProjectData Extract(Action<IExtractorContext> contextFunc) { ProjectData projectData = new ProjectData(); using (ExtractorContext context = new ExtractorContext(projectData)) { contextFunc(context); DllExtractor.Extract(context); XmlExtractor.Extract(context); } return projectData; }
private void ReadXDocument(ExtractorContext context, XDocument document) { var members = document.Document.Root.Element("members").Elements("member"); foreach (XElement member in members){ string referenceName = member.Attributes("name").FirstOrDefault().Value; if (ReferenceName.IsProperty(referenceName)) ReadProperty(context, referenceName, member); else if (ReferenceName.IsType(referenceName)) ReadType(context, referenceName, member); } }
public void Extract(ExtractorContext context) { foreach (FileInfo fi in context.XmlDocumentation) { //var xmlReader = new XmlTextReader(fi.FullName); //xmlReader.Close(); FileStream stream = new FileStream(fi.FullName, FileMode.Open); XDocument doc = XDocument.Load(stream); //XmlReader reader = XmlReader.Create(stream); ReadXDocument(context, doc); stream.Close(); } }