示例#1
0
        /// <summary>
        /// Evaluates the function.
        /// </summary>
        /// <param name="Arguments">Function arguments.</param>
        /// <param name="Variables">Variables collection.</param>
        /// <returns>Function result.</returns>
        public override IElement Evaluate(IElement[] Arguments, Variables Variables)
        {
            int c = Arguments.Length;
            int d = c - 2;

            IElement[] A = new IElement[d];

            Array.Copy(Arguments, 0, A, 0, d);
            string[] TabIDs = GetTabIDs.GetTabs(A, this);

            if (TabIDs.Length > 0)
            {
                object Data = Arguments[c - 1].AssociatedObjectValue;

                if (Data is string s)
                {
                    ClientEvents.PushEvent(TabIDs, Arguments[c - 2].AssociatedObjectValue?.ToString(), s, false);
                }
                else
                {
                    ClientEvents.PushEvent(TabIDs, Arguments[c - 2].AssociatedObjectValue?.ToString(), JSON.Encode(Data, false), true);
                }
            }

            return(new ObjectVector(TabIDs));
        }
示例#2
0
        /// <summary>
        /// Evaluates the function.
        /// </summary>
        /// <param name="Arguments">Function arguments.</param>
        /// <param name="Variables">Variables collection.</param>
        /// <returns>Function result.</returns>
        public override IElement Evaluate(IElement[] Arguments, Variables Variables)
        {
            string[] TabIDs = GetTabIDs.GetTabs(Arguments, this);

            if (TabIDs.Length > 0)
            {
                ClientEvents.PushEvent(TabIDs, "Reload", "");
            }

            return(new ObjectVector(TabIDs));
        }