summaryrefslogtreecommitdiff
path: root/ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Infos/NamespaceInfo.cs
blob: a143391183351cd2ddca671699df4049d8b069e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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<TypeInfo> Types { get; private set; } = new List<TypeInfo>();

		public List<TypeInfo> Classes { get; private set; } = new List<TypeInfo>();

		public List<TypeInfo> Interfaces { get; private set; } = new List<TypeInfo>();

		public List<TypeInfo> Enums { get; private set; } = new List<TypeInfo>();

		public NamespaceInfo(AssemblyInfo assemblyInfo, string @namespace, List<Type> 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);
				}
			}
		}
	}
}