Browse Source

Fixed handling of field properties in C# backend.

pull/28/head
triton 12 years ago
parent
commit
beead40dec
  1. 15
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

15
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -858,11 +858,18 @@ namespace CppSharp.Generators.CSharp
WriteLine("public {0} {1}", prop.Type, prop.Name); WriteLine("public {0} {1}", prop.Type, prop.Name);
WriteStartBraceIndent(); WriteStartBraceIndent();
GeneratePropertyGetter(prop.GetMethod, @class); if (prop.Field != null)
{
if (prop.SetMethod != 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(); WriteCloseBraceIndent();

Loading…
Cancel
Save