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)); }
private void AddNamespace(Module module, XElement element, Metric.MetricsSource source) { var namespaceName = element.Attribute("Name").Value; var namespaceEl = module.Namespaces.FirstOrDefault(x => x.Name == namespaceName); if (namespaceEl == null) { namespaceEl = new Namespace(); namespaceEl.Name = namespaceName; module.Namespaces.Add(namespaceEl); } namespaceEl.AddMetrics(Metric.CreateMetric(element, source)); element.Descendants("Type").ToList().ForEach(x => AddType(namespaceEl, x, source)); }