Browse Source

When generating the setter method of a property, use the first method parameter type as the type for the setter.

pull/1/head
triton 12 years ago
parent
commit
0895429e65
  1. 6
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

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

@ -649,6 +649,12 @@ namespace CppSharp.Generators.CSharp @@ -649,6 +649,12 @@ namespace CppSharp.Generators.CSharp
if (decl is Function)
{
var function = decl as Function;
if (function.Parameters.Count == 0)
throw new NotSupportedException("Expected at least one parameter in setter");
param.QualifiedType = function.Parameters[0].QualifiedType;
var parameters = new List<Parameter> { param };
GenerateInternalFunctionCall(function, parameters);
}

Loading…
Cancel
Save