void GenerateEquals(Class @class, Block block, Method method) { var cliTypePrinter = new CLITypePrinter(Driver); var classCliType = @class.Visit(cliTypePrinter); block.WriteLine("if (!object) return false;"); block.WriteLine("auto obj = dynamic_cast<{0}>({1});", classCliType, method.Parameters[0].Name); block.NewLine(); block.WriteLine("if (!obj) return false;"); block.Write("return __Instance == obj->__Instance;"); }
void GenerateToString(Class @class, Block block, Method method) { needsStreamInclude = true; block.WriteLine("std::ostringstream os;"); block.WriteLine("os << *NativePtr;"); block.Write("return clix::marshalString<clix::E_UTF8>(os.str());"); }
void GenerateGetHashCode(Block block) { block.Write("return (int)NativePtr;"); }