|
|
@ -2513,7 +2513,12 @@ namespace CppSharp.Generators.CSharp |
|
|
|
private void GetVirtualCallDelegate(Method method, Class @class, |
|
|
|
private void GetVirtualCallDelegate(Method method, Class @class, |
|
|
|
out string delegateId) |
|
|
|
out string delegateId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var i = VTables.GetVTableIndex(method.OriginalFunction ?? method, @class); |
|
|
|
Function @virtual = method; |
|
|
|
|
|
|
|
if (method.OriginalFunction != null && |
|
|
|
|
|
|
|
!((Class) method.OriginalFunction.Namespace).IsInterface) |
|
|
|
|
|
|
|
@virtual = method.OriginalFunction; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var i = VTables.GetVTableIndex(@virtual, @class); |
|
|
|
int vtableIndex = 0; |
|
|
|
int vtableIndex = 0; |
|
|
|
if (Context.ParserOptions.IsMicrosoftAbi) |
|
|
|
if (Context.ParserOptions.IsMicrosoftAbi) |
|
|
|
vtableIndex = @class.Layout.VFTables.IndexOf(@class.Layout.VFTables.Where( |
|
|
|
vtableIndex = @class.Layout.VFTables.IndexOf(@class.Layout.VFTables.Where( |
|
|
@ -2526,7 +2531,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
WriteStartBraceIndent(); |
|
|
|
WriteStartBraceIndent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var @delegate = GetVTableMethodDelegateName(method.OriginalFunction ?? method); |
|
|
|
var @delegate = GetVTableMethodDelegateName(@virtual); |
|
|
|
delegateId = Generator.GeneratedIdentifier(@delegate); |
|
|
|
delegateId = Generator.GeneratedIdentifier(@delegate); |
|
|
|
|
|
|
|
|
|
|
|
WriteLine("var {0} = ({1}) Marshal.GetDelegateForFunctionPointer(new IntPtr({2}), typeof({1}));", |
|
|
|
WriteLine("var {0} = ({1}) Marshal.GetDelegateForFunctionPointer(new IntPtr({2}), typeof({1}));", |
|
|
|