コード例 #1
0
        /// <summary>
        /// Performs an "index" "get" operation.
        /// </summary>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="index">The index.</param>
        /// <param name="isDirectIndexing">If set to true, it's indexed with a name, if false it's indexed through brackets.</param>
        /// <returns></returns>
        public DynValue Index(Script script, object obj, DynValue index, bool isDirectIndexing)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.Index(script, index, isDirectIndexing));
            }

            return(DynValue.Nil);
        }
コード例 #2
0
        /// <summary>
        /// Performs an "index" "set" operation.
        /// </summary>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="index">The index.</param>
        /// <param name="value">The value to be set</param>
        /// <param name="isDirectIndexing">If set to true, it's indexed with a name, if false it's indexed through brackets.</param>
        /// <returns></returns>
        public bool SetIndex(Script script, object obj, DynValue index, DynValue value, bool isDirectIndexing)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.SetIndex(script, index, value, isDirectIndexing));
            }

            return(false);
        }
コード例 #3
0
        /// <summary>
        /// Gets a "meta" operation on this userdata. If a descriptor does not support this functionality,
        /// it should return "null" (not a nil).
        /// These standard metamethods can be supported (the return value should be a function accepting the
        /// classic parameters of the corresponding metamethod):
        /// __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat,
        /// __pairs, __ipairs, __iterator, __call
        /// These standard metamethods are supported through other calls for efficiency:
        /// __index, __newindex, __tostring
        /// </summary>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="metaname">The name of the metamember.</param>
        /// <returns></returns>
        public DynValue MetaIndex(Script script, object obj, string metaname)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.MetaIndex(script, metaname));
            }

            return(DynValue.Nil);
        }
コード例 #4
0
        public DynValue Index(Script script, object obj, DynValue index)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.Index(script, index));
            }

            return(null);
        }
コード例 #5
0
        /// <summary>
        /// Performs an "index" "set" operation.
        /// </summary>
        /// <param name="ecToken">The execution control token of the script processing thread</param>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="index">The index.</param>
        /// <param name="value">The value to be set</param>
        /// <param name="isDirectIndexing">If set to true, it's indexed with a name, if false it's indexed through brackets.</param>
        /// <returns></returns>
        public bool SetIndex(ExecutionControlToken ecToken, Script script, object obj, DynValue index, DynValue value, bool isDirectIndexing)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.SetIndex(ecToken, script, index, value, isDirectIndexing));
            }

            return(false);
        }
コード例 #6
0
        /// <summary>
        /// Performs an "index" "get" operation.
        /// </summary>
        /// <param name="ecToken">The execution control token of the script processing thread</param>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="index">The index.</param>
        /// <param name="isDirectIndexing">If set to true, it's indexed with a name, if false it's indexed through brackets.</param>
        /// <returns></returns>
        public DynValue Index(ExecutionControlToken ecToken, Script script, object obj, DynValue index, bool isDirectIndexing)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.Index(ecToken, script, index, isDirectIndexing));
            }

            return(null);
        }
コード例 #7
0
        /// <summary>
        /// Gets a "meta" operation on this userdata. If a descriptor does not support this functionality,
        /// it should return "null" (not a nil).
        /// These standard metamethods can be supported (the return value should be a function accepting the
        /// classic parameters of the corresponding metamethod):
        /// __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat,
        /// __pairs, __ipairs, __iterator, __call
        /// These standard metamethods are supported through other calls for efficiency:
        /// __index, __newindex, __tostring
        /// </summary>
        /// <param name="ecToken">The execution control token of the script processing thread</param>
        /// <param name="script">The script originating the request</param>
        /// <param name="obj">The object (null if a static request is done)</param>
        /// <param name="metaname">The name of the metamember.</param>
        /// <returns></returns>
        public DynValue MetaIndex(ExecutionControlToken ecToken, Script script, object obj, string metaname)
        {
            IUserDataType u = obj as IUserDataType;

            if (u != null)
            {
                return(u.MetaIndex(ecToken, script, metaname));
            }

            return(null);
        }