示例#1
0
        public static bool SignatureEquals(this JavaArchiveReflectorConstructor a, JavaArchiveReflectorConstructor b)
        {
            if (a.ParameterTypes.Length != b.ParameterTypes.Length)
            {
                return(false);
            }

            var value = true;

            for (int i = 0; i < a.ParameterTypes.Length; i++)
            {
                if (a.ParameterTypes[i] != b.ParameterTypes[i])
                {
                    value = false;
                    break;
                }
            }

            return(value);
        }
        public JavaArchiveReflectorConstructor[] Type_GetConstructors(string TypeName)
        {
            var y = default(JavaArchiveReflectorConstructor[]);
            var f = default(System.Reflection.ConstructorInfo[]);

            var t = this.clazzLoader.GetType(TypeName);

            try
            {
                f = t.GetConstructors(); // what about protected members?
            }
            catch
            {
                System.Console.WriteLine("JavaArchiveReflector.Type_GetConstructors error, TypeName: " + TypeName);

                // we did not find a type. skip constructors..
                y = new JavaArchiveReflectorConstructor[0];
            }

            if (y == null)
            {
                y = new JavaArchiveReflectorConstructor[f.Length];

                for (int i = 0; i < f.Length; i++)
                {
                    var MethodThrows = GetExceptionTypes(f[i]);


                    y[i] = new JavaArchiveReflectorConstructor
                    {
                        ConstructorIndex = i,

                        ParameterTypes = f[i].GetParameterTypeFullNames(),

                        MethodThrows = MethodThrows
                    };
                }
            }

            return(y);
        }
        public JavaArchiveReflectorConstructor[] Type_GetConstructors(string TypeName)
        {
            var y = default(JavaArchiveReflectorConstructor[]);
            var f = default(System.Reflection.ConstructorInfo[]);

            var t = this.clazzLoader.GetType(TypeName);

            try
            {
                f = t.GetConstructors(); // what about protected members?
            }
            catch
            {
                System.Console.WriteLine("JavaArchiveReflector.Type_GetConstructors error, TypeName: " + TypeName);

                // we did not find a type. skip constructors..
                y = new JavaArchiveReflectorConstructor[0];
            }

            if (y == null)
            {
                y = new JavaArchiveReflectorConstructor[f.Length];

                for (int i = 0; i < f.Length; i++)
                {

                    var MethodThrows = GetExceptionTypes(f[i]);


                    y[i] = new JavaArchiveReflectorConstructor
                    {
                        ConstructorIndex = i,

                        ParameterTypes = f[i].GetParameterTypeFullNames(),

                        MethodThrows = MethodThrows
                    };
                }
            }

            return y;
        }
        public static bool SignatureEquals(this JavaArchiveReflectorConstructor a, JavaArchiveReflectorConstructor b)
        {

            if (a.ParameterTypes.Length != b.ParameterTypes.Length)
                return false;

            var value = true;
            for (int i = 0; i < a.ParameterTypes.Length; i++)
            {
                if (a.ParameterTypes[i] != b.ParameterTypes[i])
                {
                    value = false;
                    break;
                }
            }

            return value;
        }