Skip to content

Commit

Permalink
Improve support for group references (see c94de71 and #299)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Jan 20, 2022
1 parent cc81e3a commit 585d6f3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions XmlSchemaClassGenerator/ModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ private void RenameInterfacePropertiesIfRenamedInDerivedClasses()
{
if (implementationClassProperty.Name != implementationClassProperty.OriginalPropertyName
&& implementationClassProperty.OriginalPropertyName == interfaceProperty.Name
&& implementationClassProperty.XmlSchemaName == interfaceProperty.XmlSchemaName
&& implementationClassProperty.XmlParent?.Parent is XmlSchemaGroup implementationGroup
&& interfaceProperty.XmlParent?.Parent is XmlSchemaGroup interfaceGroup
&& implementationGroup.QualifiedName == interfaceGroup.QualifiedName)
&& implementationClassProperty.XmlSchemaName == interfaceProperty.XmlSchemaName)
{
RenameInterfacePropertyInBaseClasses(interfaceModel, implementationClass, interfaceProperty, implementationClassProperty.Name);
interfaceProperty.Name = implementationClassProperty.Name;
Expand Down Expand Up @@ -944,7 +941,7 @@ private IEnumerable<PropertyModel> CreatePropertiesForElements(Uri source, TypeM
CreateTypeModel(group, groupRef.RefName);
}

var groupItems = GetElements(group.Particle).Where(p => !processedItems.Any(q => p.XmlParticle == q.XmlParticle)).ToList();
var groupItems = GetElements(groupRef.Particle).Where(p => !processedItems.Any(q => p.XmlParticle == q.XmlParticle)).ToList();
var groupProperties = CreatePropertiesForElements(source, typeModel, item, groupItems, order: order, processedItems: processedItems).ToList();
if (_configuration.EmitOrder)
{
Expand Down

0 comments on commit 585d6f3

Please sign in to comment.