예제 #1
0
 public void ExportJavaScriptCode(ActionBranch currentAction, ActionBranch nextAction, StringCollection jsCode, StringCollection methodToCompile, JsMethodCompiler data)
 {
     if (IsValid)
     {
         string ceCondition = null;
         if (_condition != null)
         {
             ceCondition = _condition.CreateJavaScriptCode(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.CreateJavaScript(sts);
         }
         else
         {
             right = _val.CreateJavaScript(sts);
         }
         string left = _var.GetJavaScriptReferenceCode(sts);
         sts.Add(left);
         sts.Add("=");
         sts.Add(right);
         sts.Add(";\r\n");
         if (!string.IsNullOrEmpty(ceCondition))
         {
             sts.Add("}\r\n");
         }
     }
 }