|
|
|
@ -670,18 +670,21 @@ namespace CppSharp.Generators.CLI
@@ -670,18 +670,21 @@ namespace CppSharp.Generators.CLI
|
|
|
|
|
|
|
|
|
|
UnindentAndWriteCloseBrace(); |
|
|
|
|
|
|
|
|
|
if (!withOwnNativeInstanceParam) |
|
|
|
|
{ |
|
|
|
|
NewLine(); |
|
|
|
|
WriteLine("{0}^ {0}::{1}(::System::IntPtr native)", qualifiedIdentifier, Helpers.CreateInstanceIdentifier); |
|
|
|
|
string createInstanceParams = withOwnNativeInstanceParam ? $"::System::IntPtr native, bool {Helpers.OwnsNativeInstanceIdentifier}" : "::System::IntPtr native"; |
|
|
|
|
string createInstanceParamsValues = withOwnNativeInstanceParam ? $"({nativeType}) native.ToPointer(), {Helpers.OwnsNativeInstanceIdentifier}" : $"({nativeType}) native.ToPointer()"; |
|
|
|
|
|
|
|
|
|
WriteOpenBraceAndIndent(); |
|
|
|
|
NewLine(); |
|
|
|
|
WriteLine($"{qualifiedIdentifier}^ {qualifiedIdentifier}::{Helpers.CreateInstanceIdentifier}({createInstanceParams})"); |
|
|
|
|
|
|
|
|
|
WriteLine("return gcnew ::{0}(({1}) native.ToPointer());", qualifiedIdentifier, nativeType); |
|
|
|
|
WriteOpenBraceAndIndent(); |
|
|
|
|
|
|
|
|
|
UnindentAndWriteCloseBrace(); |
|
|
|
|
NewLine(); |
|
|
|
|
WriteLine($"return gcnew ::{qualifiedIdentifier}({createInstanceParamsValues});"); |
|
|
|
|
|
|
|
|
|
UnindentAndWriteCloseBrace(); |
|
|
|
|
NewLine(); |
|
|
|
|
|
|
|
|
|
if (!withOwnNativeInstanceParam) |
|
|
|
|
{ |
|
|
|
|
GenerateClassConstructor(@class, true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|