Skip to content

Commit

Permalink
Reverted some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Fuchs committed May 11, 2017
1 parent 9e372e2 commit 2d4a3f0
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions XmlSchemaClassGenerator/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ private IEnumerable<PropertyModel> CreatePropertiesForElements(Uri source, TypeM
{
var properties = new List<PropertyModel>();
var order = 0;
var count = 0;
foreach (var item in items)
{
PropertyModel property = null;
Expand Down Expand Up @@ -809,7 +808,6 @@ private IEnumerable<PropertyModel> CreatePropertiesForElements(Uri source, TypeM
}

var propertyName = ToTitleCase(element.QualifiedName.Name);
propertyName = CreatePrefix(count, propertyName);
if (propertyName == typeModel.Name)
{
propertyName += "Property"; // member names cannot be the same as their enclosing type
Expand All @@ -819,8 +817,7 @@ private IEnumerable<PropertyModel> CreatePropertiesForElements(Uri source, TypeM
{
OwningType = typeModel,
XmlSchemaName = element.QualifiedName,
Name = propertyName, // TODO: Name = originalName,
// TODO: OrderName = propertyName,
Name = propertyName,
Type = CreateTypeModel(source, element.ElementSchemaType, elementQualifiedName),
IsNillable = element.IsNillable,
IsNullable = item.MinOccurs < 1.0m,
Expand Down Expand Up @@ -878,22 +875,11 @@ private IEnumerable<PropertyModel> CreatePropertiesForElements(Uri source, TypeM

properties.Add(property);
}

count++;
}

return properties;
}

private static string CreatePrefix(int count, string propertyName)
{
if ((char)('a' + count) <= 'z')
propertyName = (char)('a' + count) + "_" + propertyName;
else
propertyName = "z" + (char)('a' + (count - 26)) + "_" + propertyName;
return propertyName;
}

private NamespaceModel CreateNamespaceModel(Uri source, XmlQualifiedName qualifiedName)
{
NamespaceModel namespaceModel = null;
Expand Down

0 comments on commit 2d4a3f0

Please sign in to comment.