Ejemplo n.º 1
0
        public JavaAssemblyContext()
        {
            JavaCoreAssembly = new JavaCoreAssembly();

            Context = new AssemblyContext
            {
                Assemblies    = { JavaCoreAssembly },
                ClassMappings = new Dictionary <string, string>
                {
                    //                    {"boolean", "bool"},
                },
            };
            WildcardClass = Context.GetClass("object");
            ObjectClass   = Context.GetClass("java.lang.Q");
            VoidClass     = Context.GetClass("void");

            EnumeratorIface = new Class
            {
                FullName         = "System.Collections.Generic.IEnumerator",
                GenericArguments = { new Class {
                                         Name = "T", IsGenericTypeArgument = true
                                     } },
            };
            EnumerableIface = new Class
            {
                FullName         = "System.Collections.Generic.IEnumerable",
                GenericArguments = { new Class {
                                         Name = "T", IsGenericTypeArgument = true
                                     } },
            };
            EnumerableIface.Members.Add(new Method {
                Name = "GetEnumerator", Type = Context.MakeGenericClass(EnumeratorIface, EnumerableIface.GenericArguments)
            });
            JavaCoreAssembly.Classes.Add(EnumerableIface);
            JavaCoreAssembly.Classes.Add(EnumeratorIface);
        }