using System; using System.Collections.Generic; using System.Diagnostics; using System.Xml.Linq; namespace CsvHelper.DocsGenerator.Infos { [DebuggerDisplay("Name = {Name}")] public class NamespaceInfo : Info { public AssemblyInfo Assembly { get; protected set; } public string Namespace { get; protected set; } public List Types { get; private set; } = new List(); public List Classes { get; private set; } = new List(); public List Interfaces { get; private set; } = new List(); public List Enums { get; private set; } = new List(); public NamespaceInfo(AssemblyInfo assemblyInfo, string @namespace, List types, XElement xmlDocs) { Assembly = assemblyInfo; Namespace = @namespace; foreach (var type in types) { var typeInfo = new TypeInfo(type, xmlDocs); Types.Add(typeInfo); if (type.IsClass) { Classes.Add(typeInfo); } else if (type.IsInterface) { Interfaces.Add(typeInfo); } else if (type.IsEnum) { Enums.Add(typeInfo); } } } } }