/*
         * Constructs the wrapper for a known MethodBase instance
         */
        public LuaMethodWrapper(ObjectTranslator translator, object target, ProxyType targetType, MethodBase method)
        {
            InvokeFunction = Call;
            _translator    = translator;
            _target        = target;
            _extractTarget = translator.typeChecker.GetExtractor(targetType);

            _method     = method;
            _methodName = method.Name;
            _isStatic   = method.IsStatic;
        }
        /*
         * Constructs the wrapper for a known method name
         */
        public LuaMethodWrapper(ObjectTranslator translator, ProxyType targetType, string methodName, BindingFlags bindingType)
        {
            InvokeFunction = Call;

            _translator    = translator;
            _methodName    = methodName;
            _extractTarget = translator.typeChecker.GetExtractor(targetType);

            _isStatic = (bindingType & BindingFlags.Static) == BindingFlags.Static;
            _members  = GetMethodsRecursively(targetType.UnderlyingSystemType,
                                              methodName,
                                              bindingType | BindingFlags.Public);
        }
示例#3
0
        /*
         * Constructs the wrapper for a known MethodBase instance
         */
        public LuaMethodWrapper(ObjectTranslator translator, object target, ProxyType targetType, MethodBase method)
        {
            invokeFunction = Call;
            _Translator    = translator;
            _Target        = target;

            if (targetType != null)
            {
                _ExtractTarget = translator.typeChecker.GetExtractor(targetType);
            }

            _Method     = method;
            _MethodName = method.Name;
            _IsStatic   = method.IsStatic;
        }