public static double Divide(double a, ExprBase nextExpr, EventParams envParams) { try { return(a / nextExpr.Execute(envParams)); } catch { Console.WriteLine("参与计算的数据类型不匹配"); return(0); } }
public static double NoEqual(double a, ExprBase nextExpr, EventParams envParams) { try { return((a != nextExpr.Execute(envParams)) ? 1 : 0); } catch { Console.WriteLine("参与计算的数据类型不匹配"); return(0); } }
public static double Or(double a, ExprBase nextExpr, EventParams envParams) { try { if (Convert.ToBoolean(a)) { return(1); } if (Convert.ToBoolean(nextExpr.Execute(envParams))) { return(1); } return(0); } catch { Console.WriteLine("参与计算的数据类型不匹配"); return(0); } }
protected override double CalcResult(EventParams runParams) { return(val.Execute(runParams)); }