Skip to content

Commit

Permalink
Make separateNamespaceHierarchy imply separateFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Oct 2, 2023
1 parent aebd9a3 commit 658d01d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion XmlSchemaClassGenerator.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ A file name may be given by appending a pipe sign (|) followed by a file name (l
{ "cc|complexTypesForCollections", "generate complex types for collections (default is true)", v => generateComplexTypesForCollections = v != null },
{ "s|useShouldSerialize", "use ShouldSerialize pattern instead of Specified pattern (default is false)", v => useShouldSerialize = v != null },
{ "sf|separateFiles", "generate a separate file for each class (default is false)", v => separateClasses = v != null },
{ "nh|namespaceHierarchy", "generate a separate folder for namespace hierarchy. Accepted only if \"separateFiles\" is true (default is false)", v=> separateNamespaceHierarchy = v != null },
{ "nh|namespaceHierarchy", "generate a separate folder for namespace hierarchy. Implies \"separateFiles\" if true (default is false)", v=> separateNamespaceHierarchy = v != null },
{ "sg|separateSubstitutes", "generate a separate property for each element of a substitution group (default is false)", v => separateSubstitutes = v != null },
{ "dnfin|doNotForceIsNullable", "do not force generator to emit IsNullable = true in XmlElement annotation for nillable elements when element is nullable (minOccurs < 1 or parent element is choice) (default is false)", v => doNotForceIsNullable = v != null },
{ "cn|compactTypeNames", "use type names without namespace qualifier for types in the using list (default is false)", v => compactTypeNames = v != null },
Expand Down
4 changes: 2 additions & 2 deletions XmlSchemaClassGenerator/FileOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override void Write(CodeNamespace cn)
var cu = new CodeCompileUnit();
cu.Namespaces.Add(cn);

if (Configuration?.SeparateClasses == true)
if (Configuration?.SeparateClasses == true || Configuration?.SeparateNamespaceHierarchy == true)
{
WriteSeparateFiles(cn);
}
Expand Down Expand Up @@ -71,7 +71,7 @@ private void WriteSeparateFiles(CodeNamespace cn)
var validatedNamespaceName = ValidateName(cn.Name);

var namespacePath = validatedNamespaceName;

if (Configuration?.SeparateNamespaceHierarchy == true)
{
namespacePath = Path.Combine(validatedNamespaceName.Split('.'));
Expand Down

0 comments on commit 658d01d

Please sign in to comment.