Exemplo n.º 1
0
        /// <summary>
        /// Evaluates a query with static scope.
        /// </summary>
        public RSValue EvaluateQuery(IRSRuntimeEntity inEntity, string inQueryId, params object[] inArgs)
        {
            RSQueryInfo    queryInfo = Library.GetQuery(inQueryId);
            ExecutionScope scope     = CreateScope(inEntity, RSValue.Null, TableUtils.GetRuleFlags(queryInfo.Flags));

            using (new SharedRef <ExecutionScope>(scope))
            {
                return(EvaluateQuery(inEntity, queryInfo, InternalScriptUtils.Convert(inArgs), scope));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Performs an action with static scope.
        /// </summary>
        public object PerformAction(IRSRuntimeEntity inEntity, string inActionId, params object[] inArgs)
        {
            RSActionInfo   actionInfo = Library.GetAction(inActionId);
            ExecutionScope scope      = CreateScope(inEntity, RSValue.Null, TableUtils.GetRuleFlags(actionInfo.Flags));

            using (new SharedRef <ExecutionScope>(scope))
            {
                return(PerformAction(inEntity, actionInfo, InternalScriptUtils.Convert(inArgs), scope).Value);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Evaluates a query with static scope.
        /// </summary>
        public RSValue EvaluateQuery(string inQueryId, params object[] inArgs)
        {
            RSQueryInfo    queryInfo = Library.GetQuery(inQueryId);
            ExecutionScope scope     = m_StaticScope;

            CloneScopeIfNecessary(scope, TableUtils.GetRuleFlags(queryInfo.Flags), out scope);

            using (new SharedRef <ExecutionScope>(scope))
            {
                return(EvaluateQuery(null, queryInfo, InternalScriptUtils.Convert(inArgs), scope));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Performs an action with static scope.
        /// </summary>
        public object PerformAction(string inActionId, params object[] inArgs)
        {
            RSActionInfo   actionInfo = Library.GetAction(inActionId);
            ExecutionScope scope      = m_StaticScope;

            CloneScopeIfNecessary(scope, TableUtils.GetRuleFlags(actionInfo.Flags), out scope);

            using (new SharedRef <ExecutionScope>(scope))
            {
                return(PerformAction(null, actionInfo, InternalScriptUtils.Convert(inArgs), scope).Value);
            }
        }
Exemplo n.º 5
0
        public RSInfo(RSMemberAttribute inAttribute, MemberInfo inMember)
        {
            Id     = inAttribute.Id;
            IdHash = ScriptUtils.Hash(Id);

            Name        = inAttribute.Name ?? inMember.Name;
            Description = inAttribute.Description ?? string.Empty;
            Icon        = inAttribute.Icon ?? string.Empty;

            if (inMember is Type)
            {
                OwnerType = InternalScriptUtils.GetLikelyBindingType((Type)inMember);
            }
            else
            {
                OwnerType = InternalScriptUtils.GetLikelyBindingType(inMember.DeclaringType);
            }
        }