コード例 #1
0
        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;");
        }
コード例 #2
0
 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());");
 }
コード例 #3
0
 void GenerateGetHashCode(Block block)
 {
     block.Write("return (int)NativePtr;");
 }