Esempio n. 1
0
        private void OnGUI()
        {
            RegenContext();
            SyncAllowedListOperations();

            float width      = this.position.width;
            float thirdWidth = Mathf.Max(width / 3, 300) - EditorStyles.helpBox.padding.left;

            using (new EditorGUILayout.HorizontalScope())
            {
                using (new EditorGUILayout.VerticalScope(GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true)))
                {
                    GUILayout.Space(4);

                    using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                    {
                        RuleTableGUI();
                        GUILayout.FlexibleSpace();
                    }

                    using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                    {
                        ErrorGUI();
                    }

                    using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                    {
                        ConfigGUI();
                    }

                    GUILayout.Space(4);
                }

                EditorGUI.BeginChangeCheck();
                {
                    using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                    {
                        RuleInfoGUI();
                    }

                    using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(thirdWidth), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                    {
                        ConditionInfoGUI();
                        ActionInfoGUI();
                    }
                }
                if (EditorGUI.EndChangeCheck() && m_SelectionState.Rule != null && m_Context.Library != null)
                {
                    RuleFlags flags = TableUtils.GetRuleFlags(m_SelectionState.Rule, m_Context.Library);
                    if (flags != m_SelectionState.Rule.Flags)
                    {
                        m_TargetState.UndoTarget.MarkDirty("Modified rule flags");
                        m_SelectionState.Rule.Flags = flags;
                    }
                }
            }
        }
Esempio n. 2
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));
            }
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
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));
            }
        }
Esempio n. 5
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);
            }
        }