Browse Source

Cleaned up the constructor generation logic.

pull/1/head
triton 13 years ago
parent
commit
cc1eb14fcc
  1. 18
      src/Generator/Generators/CLI/CLISourcesTemplate.cs

18
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -141,18 +141,20 @@ namespace Cxxi.Generators.CLI @@ -141,18 +141,20 @@ namespace Cxxi.Generators.CLI
WriteStartBraceIndent();
var nativePtr = "native";
if (isIntPtr)
{
WriteLine("auto __native = (::{0}*)native.ToPointer();",
@class.QualifiedOriginalName);
nativePtr = "__native";
}
if (@class.IsRefType)
{
if (!hasBase)
{
Write("NativePtr = ");
if (isIntPtr)
Write("({0})", nativeType);
Write("native");
if (isIntPtr)
Write(".ToPointer()");
WriteLine(";");
WriteLine("NativePtr = {0};", nativePtr);
}
}
else

Loading…
Cancel
Save