Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Fixed handling of field properties in C# backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Aug 13, 2013
1 parent d4b4ec6 commit beead40
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Generator/Generators/CSharp/CSharpTextTemplate.cs
Expand Up @@ -858,11 +858,18 @@ private void GenerateClassProperties(Class @class)
WriteLine("public {0} {1}", prop.Type, prop.Name);
WriteStartBraceIndent();

GeneratePropertyGetter(prop.GetMethod, @class);

if (prop.SetMethod != null)
if (prop.Field != null)
{
GeneratePropertyGetter(prop.Field, @class);
GeneratePropertySetter(prop.Field, @class);
}
else
{
GeneratePropertySetter(prop.SetMethod, @class);
if (prop.GetMethod != null)
GeneratePropertyGetter(prop.GetMethod, @class);

if (prop.SetMethod != null)
GeneratePropertySetter(prop.SetMethod, @class);
}

WriteCloseBraceIndent();
Expand Down

0 comments on commit beead40

Please sign in to comment.