Example #1
0
        public MondValue Get(MondState state, MondValue instance, string name)
        {
            var newPath = this._path + "." + name;

            var type = InteropLibrary.LookupType(newPath);

            return(type != null
                ? MondObjectBinder.Bind(type, state, MondBindingOptions.AutoLock)
                : new NamespaceReference(newPath).ToMond(state));
        }
Example #2
0
        public MondValue Get(MondState state, MondValue instance, string name)
        {
            var typeName = this.Type.FullName + "+" + name;

            var type = InteropLibrary.LookupType(typeName);

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

            return(MondObjectBinder.Bind(type, state, MondBindingOptions.AutoLock));
        }
Example #3
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));
        }
Example #4
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));
        }