output("TO_HANDLE(gcnew ");
String accessor = method.getAccessor();
if (accessor.length() != 0) {
output(accessor);
} else {
JNIClass dc = method.getDeclaringClass();
if( dc.getFlag(ClassFlag.CPP) || dc.getFlag(ClassFlag.STRUCT) ) {
output(dc.getNativeName());
} else {
int index = -1;
if ((index = name.indexOf('_')) != -1) {
output(name.substring(index + 1));
} else {
output(name);
}
}
}
} else if (method.getFlag(MethodFlag.CPP_NEW)) {
if (method.getFlag(MethodFlag.CS_OBJECT)) {
output("TO_HANDLE(");
}
output("new ");
String accessor = method.getAccessor();
if (accessor.length() != 0) {
output(accessor);
} else {
JNIClass dc = method.getDeclaringClass();
if( dc.getFlag(ClassFlag.CPP) ) {
output(method.getDeclaringClass().getNativeName());
} else {
int index = -1;
if ((index = name.indexOf('_')) != -1) {
output(name.substring(index+1));