From 0a6640da36f6ebae4de8866244a067a11947111c Mon Sep 17 00:00:00 2001 From: Michael Ganss Date: Sat, 28 Dec 2019 19:14:23 +0100 Subject: [PATCH] Fix #154 --- .../XmlSchemaClassGenerator.Tests.csproj | 1 + XmlSchemaClassGenerator/TypeModel.cs | 16 ++++++++++++---- .../XmlSchemaClassGenerator.csproj | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj b/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj index 35ae4149..69e43069 100644 --- a/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj +++ b/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj @@ -12,6 +12,7 @@ false false false + latest diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index 64d4638b..b340161a 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -914,10 +914,18 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi { var ifNotEquals = new CodeConditionStatement( new CodeBinaryOperatorExpression( - new CodeMethodInvokeExpression(valueExpression, "Equals", getValueOrDefaultExpression), - CodeBinaryOperatorType.ValueEquality, - new CodePrimitiveExpression(false) - ), + new CodeBinaryOperatorExpression( + new CodeMethodInvokeExpression(valueExpression, "Equals", getValueOrDefaultExpression), + CodeBinaryOperatorType.ValueEquality, + new CodePrimitiveExpression(false) + ), + CodeBinaryOperatorType.BooleanOr, + new CodeBinaryOperatorExpression( + new CodeMethodInvokeExpression(specifiedExpression, "Equals", hasValueExpression), + CodeBinaryOperatorType.ValueEquality, + new CodePrimitiveExpression(false) + ) + ), setValueStatement, setSpecifiedStatement, new CodeExpressionStatement(new CodeMethodInvokeExpression(null, "OnPropertyChanged", diff --git a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj index 49ed3b2c..2fd0d5b3 100644 --- a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj +++ b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj @@ -18,6 +18,7 @@ git git://github.com/mganss/XmlSchemaClassGenerator XmlSchemaClassGenerator + latest