From fc84a41dd365f1006498be1b71afef81aad87fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Verdier?= Date: Fri, 23 Aug 2019 13:41:04 +0200 Subject: [PATCH] Remove summary tag when there is no doc --- XmlSchemaClassGenerator.Tests/XmlTests.cs | 8 -------- XmlSchemaClassGenerator/TypeModel.cs | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/XmlSchemaClassGenerator.Tests/XmlTests.cs b/XmlSchemaClassGenerator.Tests/XmlTests.cs index 02d7e156..2cd9afa9 100644 --- a/XmlSchemaClassGenerator.Tests/XmlTests.cs +++ b/XmlSchemaClassGenerator.Tests/XmlTests.cs @@ -567,8 +567,6 @@ namespace Test using System.Xml.Serialization; - /// - /// [System.CodeDom.Compiler.GeneratedCodeAttribute(""Tests"", ""1.0.0.1"")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(""group-name"", Namespace="""")] @@ -583,8 +581,6 @@ public partial class Group_Name [System.Xml.Serialization.XmlTextAttribute()] public string Value { get; set; } - /// - /// [System.Xml.Serialization.XmlAttributeAttribute(""justify"", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public SimpleType Justify { get; set; } @@ -596,16 +592,12 @@ public partial class Group_Name public bool JustifySpecified { get; set; } } - /// - /// [System.CodeDom.Compiler.GeneratedCodeAttribute(""Tests"", ""1.0.0.1"")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(""simpleType"", Namespace="""")] public enum SimpleType { - /// - /// [System.Xml.Serialization.XmlEnumAttribute(""foo"")] Foo, } diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index 47514f3f..08370166 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -67,9 +67,9 @@ public class DocumentationModel public string Text { get; set; } public static bool DisableComments { get; set; } - public static IEnumerable GetComments(IEnumerable docs) + public static IEnumerable GetComments(IList docs) { - if (DisableComments) + if (DisableComments || docs.Count == 0) yield break; yield return new CodeCommentStatement("", true);