Пример #1
0
        public override bool OnLinkedTextClick(string linkName)
        {
            int num;

            if (!int.TryParse(linkName, out num))
            {
                return(base.OnLinkedTextClick(linkName));
            }
            Type parameterType;

            if (this.SystemMethod != null)
            {
                parameterType = this.SystemMethod.GetParameters()[num].ParameterType;
            }
            else
            {
                parameterType = this.SystemProperty.GetIndexParameters()[num].ParameterType;
            }
            LogicAction logicAction = base.ParameterActions[num];

            if (!LogicEditorFunctionality.Instance.ShowActionDialog(this, parameterType, false, ref logicAction))
            {
                return(false);
            }
            if (base.ParameterActions[num] != null && base.ParameterActions[num] != logicAction)
            {
                base.ParameterActions[num].SetForDeletion(false);
                Entities.Instance.DeleteEntitiesQueuedForDeletion();
            }
            base.ParameterActions[num] = logicAction;
            return(true);
        }
Пример #2
0
        public override void GetAccessedLocalVariables(LogicAction downToChildAction, List <LogicLocalVariable> variables)
        {
            base.GetAccessedLocalVariables(downToChildAction, variables);
            int num;

            if (downToChildAction != null)
            {
                num = this.abG.IndexOf(downToChildAction);
            }
            else
            {
                num = this.abG.Count;
            }
            if (num != -1)
            {
                for (int i = 0; i < num; i++)
                {
                    LogicDeclareLocalVariableAction logicDeclareLocalVariableAction = this.abG[i] as LogicDeclareLocalVariableAction;
                    if (logicDeclareLocalVariableAction != null)
                    {
                        variables.Add(new LogicLocalVariable(logicDeclareLocalVariableAction));
                    }
                }
            }
        }
Пример #3
0
 protected internal override void OnRemoveChild(Entity entity)
 {
     base.OnRemoveChild(entity);
     if (this.abJ == entity)
     {
         this.abJ = null;
     }
 }
Пример #4
0
 public void InsertAction(int index, LogicAction action)
 {
     if (index < this.actions.Count)
     {
         this.actions.Insert(index, action);
         return;
     }
     this.actions.Add(action);
 }
Пример #5
0
 public override void InsertAction(int index, LogicAction action)
 {
     if (index < this.abG.Count)
     {
         this.abG.Insert(index, action);
         return;
     }
     this.abG.Add(action);
 }
Пример #6
0
        protected internal override void OnRemoveChild(Entity entity)
        {
            base.OnRemoveChild(entity);
            LogicAction logicAction = entity as LogicAction;

            if (logicAction != null)
            {
                this.actions.Remove(logicAction);
            }
        }
Пример #7
0
        protected override void OnClone(Entity source)
        {
            base.OnClone(source);
            LogicAssignPropertyAction logicAssignPropertyAction = (LogicAssignPropertyAction)source;

            if (logicAssignPropertyAction.ValueAction != null)
            {
                this.abJ = (LogicAction)logicAssignPropertyAction.ValueAction.CloneWithCopyBrowsableProperties(false, this);
            }
        }
Пример #8
0
        protected override void OnClone(Entity source)
        {
            base.OnClone(source);
            LogicDeclareLocalVariableAction logicDeclareLocalVariableAction = (LogicDeclareLocalVariableAction)source;

            this.abC = logicDeclareLocalVariableAction.VariableTypeName;
            this.abc = logicDeclareLocalVariableAction.VariableName;
            if (logicDeclareLocalVariableAction.ValueAction != null)
            {
                this.abD = (LogicAction)logicDeclareLocalVariableAction.ValueAction.CloneWithCopyBrowsableProperties(false, this);
            }
        }
Пример #9
0
 public void SetParameterAction(int index, LogicAction action)
 {
     if (this.abM[index] != null)
     {
         this.abM[index].SetForDeletion(false);
         Entities.Instance.DeleteEntitiesQueuedForDeletion();
     }
     this.abM[index] = action;
     if (this.abM[index] != null && this.abM[index].Parent != this)
     {
         Log.Fatal("LogicCallMethodAction: set parameter action: invalid action");
     }
 }
Пример #10
0
        public List <LogicLocalVariable> GetAccessedLocalVariables(LogicAction fromAction)
        {
            List <LogicLocalVariable> list = new List <LogicLocalVariable>();

            foreach (LogicParameter current in base.Parameters)
            {
                list.Add(new LogicLocalVariable(current));
            }
            foreach (LogicAction current2 in this.Actions)
            {
                this.A(current2, list);
            }
            return(list);
        }
Пример #11
0
        protected override void OnClone(Entity source)
        {
            base.OnClone(source);
            LogicWhileAction logicWhileAction = (LogicWhileAction)source;

            if (logicWhileAction.ConditionAction != null)
            {
                this.abf = (LogicAction)logicWhileAction.ConditionAction.CloneWithCopyBrowsableProperties(false, this);
            }
            foreach (LogicAction current in logicWhileAction.abG)
            {
                this.abG.Add((LogicAction)current.CloneWithCopyBrowsableProperties(false, this));
            }
        }
Пример #12
0
        public override bool OnLinkedTextClick(string linkName)
        {
            if (!(linkName == "action"))
            {
                return(base.OnLinkedTextClick(linkName));
            }
            LogicAction logicAction = this.abA;

            if (!LogicEditorFunctionality.Instance.ShowActionDialog(this, base.ParentMethod.ReturnType, false, ref logicAction))
            {
                return(false);
            }
            this.abA = logicAction;
            return(true);
        }
Пример #13
0
        public override bool OnLinkedTextClick(string linkName)
        {
            if (!(linkName == "valueAction"))
            {
                return(base.OnLinkedTextClick(linkName));
            }
            LogicAction logicAction = this.abJ;

            if (!LogicEditorFunctionality.Instance.ShowActionDialog(this, null, false, ref logicAction))
            {
                return(false);
            }
            this.abJ = logicAction;
            return(true);
        }
Пример #14
0
        protected internal override void OnRemoveChild(Entity entity)
        {
            base.OnRemoveChild(entity);
            LogicAction logicAction = entity as LogicAction;

            if (logicAction != null)
            {
                if (this.aba == logicAction)
                {
                    this.aba = null;
                }
                this.abB.Remove(logicAction);
                this.abb.Remove(logicAction);
            }
        }
Пример #15
0
        protected internal override void OnRemoveChild(Entity entity)
        {
            base.OnRemoveChild(entity);
            LogicAction logicAction = entity as LogicAction;

            if (logicAction != null && this.abM != null)
            {
                for (int i = 0; i < this.abM.Length; i++)
                {
                    if (this.abM[i] == logicAction)
                    {
                        this.abM[i] = null;
                        return;
                    }
                }
            }
        }
Пример #16
0
        public override bool OnLinkedTextClick(string linkName)
        {
            if (!(linkName == "dotPathAction"))
            {
                return(base.OnLinkedTextClick(linkName));
            }
            LogicAction logicAction = this.abg;

            if (!LogicEditorFunctionality.Instance.ShowActionDialog(this, null, true, ref logicAction))
            {
                return(false);
            }
            if (logicAction != this.abg)
            {
                this.abg = (LogicDotPathAction)logicAction;
            }
            return(true);
        }
Пример #17
0
 public override void InsertAction(int index, LogicAction action)
 {
     if (index < this.abB.Count)
     {
         this.abB.Insert(index, action);
         return;
     }
     if (index == this.abB.Count)
     {
         this.abB.Add(action);
         return;
     }
     if (index < this.abB.Count + 1 + this.abb.Count)
     {
         this.abb.Insert(index - 1 - this.abB.Count, action);
         return;
     }
     this.abb.Add(action);
 }
Пример #18
0
 public override bool OnLinkedTextClick(string linkName)
 {
     if (linkName == "variableType")
     {
         Type variableType = this.VariableType;
         if (!LogicEditorFunctionality.Instance.ShowTypeDialog(null, ref variableType))
         {
             return(false);
         }
         if (variableType != this.VariableType)
         {
             if (this.abD != null)
             {
                 this.abD.SetForDeletion(false);
                 Entities.Instance.DeleteEntitiesQueuedForDeletion();
             }
             this.abC = variableType.Name;
             this.abd = null;
             if (SimpleTypesUtils.IsSimpleType(this.VariableType))
             {
                 this.abD = (LogicAction)Entities.Instance.Create(EntityTypes.Instance.GetByName("LogicGetConstantValueAction"), this);
                 ((LogicGetConstantValueAction)this.abD).ValueType = this.VariableType;
                 this.abD.PostCreate();
             }
         }
         return(true);
     }
     else
     {
         if (!(linkName == "valueAction"))
         {
             return(base.OnLinkedTextClick(linkName));
         }
         LogicAction logicAction = this.abD;
         if (!LogicEditorFunctionality.Instance.ShowActionDialog(this, this.abd, false, ref logicAction))
         {
             return(false);
         }
         this.abD = logicAction;
         return(true);
     }
 }
Пример #19
0
 protected internal string[] ForGetLinkedTextParameterActions()
 {
     if (this.ParameterActions == null)
     {
         return(new string[0]);
     }
     string[] array = new string[this.ParameterActions.Length];
     for (int i = 0; i < this.ParameterActions.Length; i++)
     {
         LogicAction logicAction = this.ParameterActions[i];
         if (logicAction != null)
         {
             array[i] = string.Format("<!<!{0} v {1}!>!>", i.ToString(), logicAction.ToString());
         }
         else
         {
             array[i] = string.Format("<!<!{0} v null!>!>", i.ToString());
         }
     }
     return(array);
 }
Пример #20
0
        private void A(LogicAction logicAction, List <LogicLocalVariable> list)
        {
            LogicDeclareLocalVariableAction logicDeclareLocalVariableAction = logicAction as LogicDeclareLocalVariableAction;

            if (logicDeclareLocalVariableAction != null)
            {
                list.Add(new LogicLocalVariable(logicDeclareLocalVariableAction));
            }
            List <object> childBrowsableItems = logicAction.GetChildBrowsableItems();

            if (childBrowsableItems != null)
            {
                foreach (object current in childBrowsableItems)
                {
                    LogicAction logicAction2 = current as LogicAction;
                    if (logicAction2 != null)
                    {
                        this.A(logicAction2, list);
                    }
                }
            }
        }
Пример #21
0
 protected internal string[] ForToStringParameterActions()
 {
     if (this.ParameterActions == null)
     {
         return(new string[0]);
     }
     string[] array = new string[this.ParameterActions.Length];
     for (int i = 0; i < this.ParameterActions.Length; i++)
     {
         LogicAction logicAction = this.ParameterActions[i];
         if (logicAction != null)
         {
             string[] array2;
             IntPtr   intPtr;
             (array2 = array)[(int)(intPtr = (IntPtr)i)] = array2[(int)intPtr] + logicAction.ToString();
         }
         else
         {
             array[i] = "null";
         }
     }
     return(array);
 }
Пример #22
0
        internal object A(LogicExecuteMethodInformation logicExecuteMethodInformation)
        {
            LogicEntityObject logicEntityObject = logicExecuteMethodInformation.LogicEntityObject;
            bool flag = false;
            int  num  = 0;

            if (logicEntityObject != null)
            {
                LogicEntityObject expr_0F = logicEntityObject;
                expr_0F.SetCurrentExecutingMethodLevel(expr_0F.GetCurrentExecutingMethodLevel() + 1);
                if (logicEntityObject.GetCurrentExecutingMethodLevel() >= logicEntityObject.GetCurrentExecutingMethodInformations().Count)
                {
                    logicEntityObject.GetCurrentExecutingMethodInformations().Add(logicExecuteMethodInformation);
                }
                else
                {
                    if (logicEntityObject.GetCurrentExecutingMethodInformations()[logicEntityObject.GetCurrentExecutingMethodLevel()] != logicExecuteMethodInformation)
                    {
                        Log.Fatal("LogicDesignerMethod: Internal error: Execute: logicEntityObject.CurrentExecutingMethodInformations[logicEntityObject.CurrentExecutingMethodLevel] != executeMethodInformation");
                    }
                    flag = true;
                    num  = logicExecuteMethodInformation.CallActionsLevelIndexes[logicExecuteMethodInformation.CurrentClassActionsLevelIndex];
                }
            }
            object result = null;

            for (int i = num; i < this.actions.Count; i++)
            {
                LogicAction logicAction = this.actions[i];
                if (!flag)
                {
                    logicExecuteMethodInformation.PushCallActionsLevelIndex(i);
                }
                flag = false;
                logicExecuteMethodInformation.CurrentClassActionsLevelIndex++;
                object obj = logicAction.Execute(logicExecuteMethodInformation);
                logicExecuteMethodInformation.CurrentClassActionsLevelIndex--;
                if (logicExecuteMethodInformation.NeedReturnForWait)
                {
                    if (logicEntityObject != null)
                    {
                        LogicEntityObject expr_C7 = logicEntityObject;
                        expr_C7.SetCurrentExecutingMethodLevel(expr_C7.GetCurrentExecutingMethodLevel() - 1);
                    }
                    return(null);
                }
                logicExecuteMethodInformation.PopCallActionsLevelIndex();
                if (LogicUtils.A() != 0f)
                {
                    logicExecuteMethodInformation.PushCallActionsLevelIndex(i + 1);
                    if (logicExecuteMethodInformation.LogicEntityObject != null)
                    {
                        logicExecuteMethodInformation.LogicEntityObject.CreateWaitingThreadItem(LogicUtils.a(), LogicUtils.A());
                    }
                    LogicUtils.A(0f);
                    LogicUtils.A("");
                    if (logicEntityObject != null)
                    {
                        LogicEntityObject expr_128 = logicEntityObject;
                        expr_128.SetCurrentExecutingMethodLevel(expr_128.GetCurrentExecutingMethodLevel() - 1);
                    }
                    return(null);
                }
                if (logicExecuteMethodInformation.NeedReturn)
                {
                    result = obj;
                    break;
                }
            }
            if (logicExecuteMethodInformation.LogicEntityObject != null)
            {
                logicExecuteMethodInformation.LogicEntityObject.GetCurrentExecutingMethodInformations().RemoveAt(logicExecuteMethodInformation.LogicEntityObject.GetCurrentExecutingMethodInformations().Count - 1);
            }
            if (logicEntityObject != null)
            {
                LogicEntityObject expr_18A = logicEntityObject;
                expr_18A.SetCurrentExecutingMethodLevel(expr_18A.GetCurrentExecutingMethodLevel() - 1);
            }
            return(result);
        }
Пример #23
0
        public override object Execute(LogicExecuteMethodInformation executeMethodInformation)
        {
            if (this.abf == null)
            {
                Log.Error("LogicWhileAction: ConditionAction = null");
                return(null);
            }
            LogicEntityObject logicEntityObject = executeMethodInformation.LogicEntityObject;
            bool flag = false;
            int  num  = 0;
            bool flag2;

            if (logicEntityObject != null)
            {
                if (executeMethodInformation.CurrentClassActionsLevelIndex < executeMethodInformation.CallActionsLevelIndexes.Count)
                {
                    flag  = true;
                    num   = executeMethodInformation.CallActionsLevelIndexes[executeMethodInformation.CurrentClassActionsLevelIndex];
                    flag2 = true;
                }
                else
                {
                    flag2 = (bool)this.abf.Execute(executeMethodInformation);
                }
            }
            else
            {
                flag2 = (bool)this.abf.Execute(executeMethodInformation);
            }
            while (flag2)
            {
                for (int i = num; i < this.abG.Count; i++)
                {
                    LogicAction logicAction = this.abG[i];
                    if (!flag)
                    {
                        executeMethodInformation.PushCallActionsLevelIndex(i);
                    }
                    flag = false;
                    executeMethodInformation.CurrentClassActionsLevelIndex++;
                    object result = logicAction.Execute(executeMethodInformation);
                    executeMethodInformation.CurrentClassActionsLevelIndex--;
                    if (executeMethodInformation.NeedReturnForWait)
                    {
                        return(null);
                    }
                    executeMethodInformation.PopCallActionsLevelIndex();
                    if (LogicUtils.A() != 0f)
                    {
                        executeMethodInformation.PushCallActionsLevelIndex(i + 1);
                        if (executeMethodInformation.LogicEntityObject != null)
                        {
                            executeMethodInformation.LogicEntityObject.CreateWaitingThreadItem(LogicUtils.a(), LogicUtils.A());
                        }
                        LogicUtils.A(0f);
                        LogicUtils.A("");
                        return(null);
                    }
                    if (executeMethodInformation.NeedReturn)
                    {
                        return(result);
                    }
                }
                num   = 0;
                flag2 = (bool)this.abf.Execute(executeMethodInformation);
            }
            return(null);
        }
Пример #24
0
        public override object Execute(LogicExecuteMethodInformation executeMethodInformation)
        {
            if (this.aba == null)
            {
                Log.Error("LogicIfThenElseAction: ConditionAction = null");
                return(null);
            }
            LogicEntityObject logicEntityObject = executeMethodInformation.LogicEntityObject;
            bool flag = false;
            int  num  = 0;
            bool flag2;

            if (logicEntityObject != null)
            {
                if (executeMethodInformation.CurrentClassActionsLevelIndex < executeMethodInformation.CallActionsLevelIndexes.Count)
                {
                    flag  = true;
                    num   = executeMethodInformation.CallActionsLevelIndexes[executeMethodInformation.CurrentClassActionsLevelIndex];
                    flag2 = (num < 10000);
                    if (num >= 10000)
                    {
                        num -= 10000;
                    }
                }
                else
                {
                    flag2 = (bool)this.aba.Execute(executeMethodInformation);
                }
            }
            else
            {
                flag2 = (bool)this.aba.Execute(executeMethodInformation);
            }
            List <LogicAction> list = flag2 ? this.abB : this.abb;

            for (int i = num; i < list.Count; i++)
            {
                LogicAction logicAction = list[i];
                if (!flag)
                {
                    executeMethodInformation.PushCallActionsLevelIndex(flag2 ? i : (i + 10000));
                }
                flag = false;
                executeMethodInformation.CurrentClassActionsLevelIndex++;
                object result = logicAction.Execute(executeMethodInformation);
                executeMethodInformation.CurrentClassActionsLevelIndex--;
                if (executeMethodInformation.NeedReturnForWait)
                {
                    return(null);
                }
                executeMethodInformation.PopCallActionsLevelIndex();
                if (LogicUtils.A() != 0f)
                {
                    executeMethodInformation.PushCallActionsLevelIndex((flag2 ? i : (i + 10000)) + 1);
                    if (executeMethodInformation.LogicEntityObject != null)
                    {
                        executeMethodInformation.LogicEntityObject.CreateWaitingThreadItem(LogicUtils.a(), LogicUtils.A());
                    }
                    LogicUtils.A(0f);
                    LogicUtils.A("");
                    return(null);
                }
                if (executeMethodInformation.NeedReturn)
                {
                    return(result);
                }
            }
            return(null);
        }
Пример #25
0
 public abstract bool ShowActionDialog(LogicAction parentAction, Type needType, bool dotPathAction, ref LogicAction action);
Пример #26
0
 public virtual void GetAccessedLocalVariables(LogicAction downToChildAction, List <LogicLocalVariable> variables)
 {
 }
Пример #27
0
 public virtual void InsertAction(int index, LogicAction action)
 {
     Log.Fatal("LogicAction: InsertAction: internal error");
 }