예제 #1
0
 public void ExportPhpScriptCode(ActionBranch currentAction, ActionBranch nextAction, StringCollection jsCode, StringCollection methodToCompile, JsMethodCompiler data)
 {
     if (IsValid)
     {
         string ceCondition = null;
         if (_condition != null)
         {
             ceCondition = _condition.CreatePhpScriptCode(methodToCompile);
         }
         StringCollection sts = methodToCompile;
         if (!string.IsNullOrEmpty(ceCondition))
         {
             sts.Add("if(");
             sts.Add(ceCondition);
             sts.Add(")\r\n{\r\n");
         }
         string right;
         if (_valType.ValueType == EnumValueType.ConstantValue)
         {
             right = _val.CreatePhpScript(sts);
         }
         else
         {
             right = _val.CreatePhpScript(sts);
         }
         string left = _var.GetPhpScriptReferenceCode(sts);
         sts.Add(left);
         sts.Add("=");
         sts.Add(right);
         sts.Add(";\r\n");
         if (!string.IsNullOrEmpty(ceCondition))
         {
             sts.Add("\r\n}\r\n");
         }
     }
 }