Пример #1
0
        protected virtual Delegate CloneThis()
        {
            //In standart method pointers will be replaced
            //TODO: replace javaClass.forName with object.class
            javaClass thisClass = this.getClass();

            java.lang.reflect.Constructor ctor = thisClass.getConstructor(javaClass.forName("java.lang.Object"), GetPointerClass());

            return((Delegate)ctor.newInstance(target, method));
        }
Пример #2
0
        public static object Box(long v, java.lang.Class cls)
        {
            var constructor = cls.getConstructor(null);

            constructor.setAccessible(true);
            var obj = (system.Enum)constructor.newInstance(null);

            obj.SetLong(v);
            return(obj);
        }