Пример #1
0
 public string GetPhpScriptReferenceCode(StringCollection code)
 {
     if (_pointer != null)
     {
         return(_pointer.GetPhpScriptReferenceCode(code));
     }
     if (_memberPointer != null)
     {
         return(_memberPointer.GetPhpScriptReferenceCode(code));
     }
     return(null);
 }
 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.GetPhpScriptReferenceCode(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");
         }
     }
 }