private void AddMember(Type type, XElement element, Metric.MetricsSource source) { var memberName = element.Attribute("Name").Value; var member = type.Members.FirstOrDefault(x => x.Name == memberName); if (member == null) { member = new Member(); member.Name = memberName; type.Members.Add(member); } member.AddMetrics(Metric.CreateMetric(element, source)); }
private void AddType(Namespace namespaceEl, XElement element, Metric.MetricsSource source) { var typeName = element.Attribute("Name").Value; var type = namespaceEl.Types.FirstOrDefault(x => x.Name == typeName); if (type == null) { type = new Type(); type.Name = typeName; namespaceEl.Types.Add(type); } type.AddMetrics(Metric.CreateMetric(element, source)); element.Descendants("Member").ToList().ForEach(x => AddMember(type, x, source)); }