public void WriteMember(AMember member, bool inner) { if (inner) { Paragraph paragraph = doc.InsertParagraph($"{member.GetType().Name}: {member.Name}", false, new Formatting() { Size = 18 }); paragraph.IndentationBefore = 0.6f; } if (!string.IsNullOrWhiteSpace(member.ReturnValue)) { Paragraph paragraph = doc.InsertParagraph($"Return values: {member.ReturnValue}", false, new Formatting() { Size = 14, FontColor = Color.DarkGray }); paragraph.IndentationBefore = 0.8f; } foreach (ATag tag in member.Tags) { tag.WriteParagraph(ref doc); } foreach (AMember aMember in member.Members) { WriteMember(aMember, true); } doc.InsertParagraph(" ", false, new Formatting() { Size = !inner ? 10 : 20 }); }
public void Parse(string uri) { this.Title = uri.Split('\\').LastOrDefault().Replace(".xml", ""); XDocument xml = XDocument.Load(uri); foreach (XElement element in xml.Descendants("member")) { string[] memberName = element.Attribute("name").Value.Split(':'); AMember member = MemberFactory.CreateAMember(memberName[0]); member.SetAssemblyName(memberName[1]); member.Parse(element); bool isNew = true; foreach (KeyValuePair <string, Assembly> keyValue in this.Pages) { foreach (AMember aMember in keyValue.Value.Members) { if (member.AssemblyName.Contains(aMember.AssemblyName + "." + aMember.Name)) { isNew = false; aMember.Members.Add(member); } } } if (isNew) { if (!this.Pages.ContainsKey(member.AssemblyName)) { this.Pages.Add(member.AssemblyName, new Assembly() { Name = member.AssemblyName }); } this.Pages[member.AssemblyName].Members.Add(member); } } }