Esempio n. 1
0
 public void Execute(LogicExecuteMethodInformation executeMethodInformation, LogicLocalVariable localVariable)
 {
     if (this.abj != null)
     {
         object value = this.abj.Execute(executeMethodInformation);
         localVariable.Value = value;
         return;
     }
     localVariable.Value = null;
 }
Esempio n. 2
0
        public LogicLocalVariable DeclareLocalVariable(LogicParameter methodParameter)
        {
            LogicLocalVariable logicLocalVariable = this.GetLocalVariable(methodParameter.ParameterName);

            if (logicLocalVariable != null)
            {
                Log.Error("Declare Local Variable: name already defined \"{0}\" by local variable.", methodParameter.ParameterName);
                return(null);
            }
            logicLocalVariable = new LogicLocalVariable(methodParameter);
            this.aAR.Add(methodParameter.parameterName, logicLocalVariable);
            return(logicLocalVariable);
        }
Esempio n. 3
0
        public override object Execute(LogicExecuteMethodInformation executeMethodInformation)
        {
            LogicLocalVariable logicLocalVariable = executeMethodInformation.DeclareLocalVariable(this);

            if (logicLocalVariable == null)
            {
                return(null);
            }
            if (this.abD != null)
            {
                logicLocalVariable.Value = this.abD.Execute(executeMethodInformation);
            }
            return(null);
        }
Esempio n. 4
0
        public override object Execute(LogicExecuteMethodInformation executeMethodInformation)
        {
            if (string.IsNullOrEmpty(this.abm))
            {
                Log.Error("Get Variable: variableName not defined");
                return(null);
            }
            object        obj            = null;
            LogicVariable variableByName = base.ParentMethod.ParentClass.GetVariableByName(this.abm);

            if (variableByName != null)
            {
                if (base.DotPathAction != null && base.DotPathAction is LogicAssignVariableAction)
                {
                    ((LogicAssignVariableAction)base.DotPathAction).Execute(executeMethodInformation, variableByName);
                    return(null);
                }
                FieldInfo field = executeMethodInformation.LogicClassType.GetField(variableByName.VariableName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                obj = field.GetValue(executeMethodInformation.LogicEntityObject);
            }
            LogicLocalVariable logicLocalVariable = null;

            if (variableByName == null)
            {
                logicLocalVariable = executeMethodInformation.GetLocalVariable(this.abm);
                if (logicLocalVariable != null)
                {
                    if (base.DotPathAction != null && base.DotPathAction is LogicAssignVariableAction)
                    {
                        ((LogicAssignVariableAction)base.DotPathAction).Execute(executeMethodInformation, logicLocalVariable);
                        return(null);
                    }
                    obj = logicLocalVariable.Value;
                }
            }
            if (variableByName == null && logicLocalVariable == null)
            {
                Log.Error("Get Variable: variable not exists \"{0}\"", this.abm);
                return(null);
            }
            if (base.DotPathAction != null)
            {
                obj = base.DotPathAction.Execute(executeMethodInformation, obj);
            }
            return(obj);
        }
Esempio n. 5
0
        public LogicLocalVariable DeclareLocalVariable(LogicDeclareLocalVariableAction declareVariableAction)
        {
            LogicLocalVariable logicLocalVariable = this.GetLocalVariable(declareVariableAction.VariableName);

            if (logicLocalVariable == null)
            {
                logicLocalVariable = new LogicLocalVariable(declareVariableAction);
                this.aAR.Add(declareVariableAction.VariableName, logicLocalVariable);
                return(logicLocalVariable);
            }
            if (logicLocalVariable.DeclareAction == declareVariableAction)
            {
                return(logicLocalVariable);
            }
            Log.Error("Declare Local Variable: name already defined \"{0}\" by local variable", declareVariableAction.VariableName);
            return(null);
        }
Esempio n. 6
0
 private bool A(LogicExecuteMethodInformation logicExecuteMethodInformation, object[] array)
 {
     for (int i = 0; i < base.Parameters.Count; i++)
     {
         LogicParameter logicParameter = base.Parameters[i];
         object         obj            = array[i];
         if (!logicParameter.parameterType.IsAssignableFrom((obj != null) ? obj.GetType() : null))
         {
             Log.Error("Method: invalid parameter value type \"{0}\"", logicParameter.ParameterName);
             return(false);
         }
         if (!string.IsNullOrEmpty(logicParameter.ParameterName))
         {
             LogicLocalVariable logicLocalVariable = logicExecuteMethodInformation.DeclareLocalVariable(logicParameter);
             logicLocalVariable.Value = obj;
         }
     }
     return(true);
 }
Esempio n. 7
0
        internal bool A(TextBlock textBlock)
        {
            if (textBlock.IsAttributeExist("method"))
            {
                this.aAO = (Entities.Instance.GetLoadingEntityBySerializedUIN(uint.Parse(textBlock.GetAttribute("method"))) as LogicMethod);
            }
            if (textBlock.IsAttributeExist("logicClassType"))
            {
                string     attribute  = textBlock.GetAttribute("logicClassType");
                Type       left       = null;
                Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
                for (int i = 0; i < assemblies.Length; i++)
                {
                    Assembly assembly = assemblies[i];
                    left = assembly.GetType(attribute);
                    if (left != null)
                    {
                        break;
                    }
                }
                if (left == null)
                {
                    Log.Warning("Entity System: Serialization error. The logic class type is not found \"{0}\".", attribute);
                    return(false);
                }
                this.aAo = left;
            }
            if (textBlock.IsAttributeExist("logicEntityObjectOwnerEntity"))
            {
                this.aAP = Entities.Instance.GetLoadingEntityBySerializedUIN(uint.Parse(textBlock.GetAttribute("logicEntityObjectOwnerEntity")));
            }
            if (textBlock.IsAttributeExist("needReturn"))
            {
                this.aAQ = bool.Parse(textBlock.GetAttribute("needReturn"));
            }
            if (textBlock.IsAttributeExist("needReturnForWait"))
            {
                this.aAq = bool.Parse(textBlock.GetAttribute("needReturnForWait"));
            }
            TextBlock textBlock2 = textBlock.FindChild("localVariablesBlock");

            if (textBlock2 != null)
            {
                foreach (TextBlock current in textBlock2.Children)
                {
                    LogicLocalVariable logicLocalVariable = new LogicLocalVariable();
                    if (!logicLocalVariable.A(current))
                    {
                        return(false);
                    }
                    this.aAR.Add(logicLocalVariable.Name, logicLocalVariable);
                }
            }
            if (textBlock.IsAttributeExist("currentClassActionsLevelIndex"))
            {
                this.aAr = int.Parse(textBlock.GetAttribute("currentClassActionsLevelIndex"));
            }
            if (textBlock.IsAttributeExist("callActionsLevelIndexes"))
            {
                string[] array = textBlock.GetAttribute("callActionsLevelIndexes").Split(new char[]
                {
                    ' '
                }, StringSplitOptions.RemoveEmptyEntries);
                string[] array2 = array;
                for (int j = 0; j < array2.Length; j++)
                {
                    string s = array2[j];
                    this.aAS.Add(int.Parse(s));
                }
            }
            return(true);
        }