Ejemplo n.º 1
0
        public MondValue Call(MondState state, MondValue instance, params MondValue[] args)
        {
            var types = InteropLibrary.GetTypeArray(args);

            var typeName = this._path + "`" + types.Length;
            var type     = InteropLibrary.LookupType(typeName);

            if (type == null)
            {
                throw new Exception("Could not find type: " + typeName);
            }

            var boundType = type.MakeGenericType(types);

            return(MondObjectBinder.Bind(boundType, state, MondBindingOptions.AutoLock));
        }
Ejemplo n.º 2
0
        public MondValue Call(MondState state, MondValue instance, params MondValue[] args)
        {
            if (this.TypeInfo.IsGenericType && !this.TypeInfo.ContainsGenericParameters)
            {
                throw new Exception("Generic type is already bound: " + this.Type.FullName);
            }

            var types = InteropLibrary.GetTypeArray(args);

            var typeName = this.Type.FullName + "`" + types.Length;
            var type     = InteropLibrary.LookupType(typeName);

            if (type == null)
            {
                throw new Exception("Could not find type: " + typeName);
            }

            var boundType = type.MakeGenericType(types);

            return(MondObjectBinder.Bind(boundType, state, MondBindingOptions.AutoLock));
        }