From 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 12 May 2023 09:24:40 +0800 Subject: *misc --- .../Generators/DocumentGenerator.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Generators/DocumentGenerator.cs (limited to 'ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Generators/DocumentGenerator.cs') diff --git a/ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Generators/DocumentGenerator.cs b/ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Generators/DocumentGenerator.cs new file mode 100644 index 0000000..614e182 --- /dev/null +++ b/ThirdParty/CsvHelper-master/docs-src/CsvHelper.DocsGenerator/Generators/DocumentGenerator.cs @@ -0,0 +1,42 @@ +using CsvHelper.DocsGenerator.Infos; +using System; +using System.Text; + +namespace CsvHelper.DocsGenerator.Generators +{ + public abstract class DocumentGenerator + { + //protected readonly HtmlFormatter htmlFormatter = new HtmlFormatter(); + protected readonly LinkGenerator linkGenerator = new LinkGenerator(); + protected readonly AssemblyInfo assemblyInfo; + protected readonly NamespaceInfo namespaceInfo; + protected readonly TypeInfo typeInfo; + protected readonly StringBuilder content = new StringBuilder(); + + public DocumentGenerator(AssemblyInfo assemblyInfo) + { + this.assemblyInfo = assemblyInfo ?? throw new ArgumentNullException(nameof(assemblyInfo)); + } + + public DocumentGenerator(NamespaceInfo namespaceInfo) + { + this.namespaceInfo = namespaceInfo; + } + + public DocumentGenerator(TypeInfo typeInfo) + { + this.typeInfo = typeInfo ?? throw new ArgumentNullException(nameof(typeInfo)); + } + + public string Generate() + { + content.Clear(); + + GenerateContent(); + + return content.ToString(); + } + + protected abstract void GenerateContent(); + } +} -- cgit v1.1-26-g67d0