Beispiel #1
0
 public Calc(FormContent fc, XmlElement e)
     : base(fc, e)
 {
     this.CalcId          = CIDGen.Next();
     this.Expression      = AsString("cexp");
     this.OnEvent         = AsString("on_event");
     this.Role            = AsInt("role");
     this.ExpTree         = FormulaParser.DoIt(this.Expression);
     this.depends         = new HashSet <string>();
     this.Resolved        = true;
     this.JSCalc          = ToJSCalcInner(ExpTree);
     this.DependentFields = new Datas();
     this.DependentFields.AddRange(depends.ToList().ConvertAll(v => fc.AllDataFields[v.Trim(new char[] { '"' })]));
 }
Beispiel #2
0
 public Var(FormContent fc, XmlElement e)
     : base(fc, e)
 {
     this.Name         = AsString("name");
     this.OriginalName = this.Name;
     if (this.Name.Length > 0 && char.IsDigit(this.Name[0]))
     {
         this.Name = "var_" + this.Name;
     }
     this.Expression      = AsString("value");
     this.Role            = AsInt("role");
     this.ExpTree         = FormulaParser.DoIt(this.Expression);
     this.depends         = new HashSet <string>();
     this.Resolved        = true;
     this.DependentFields = new Datas();
     this.DependentFields.AddRange(depends.ToList().ConvertAll(v => fc.AllDataFields[v.Trim(new char[] { '"' })]));
 }