internal override FnObject CheckAndCache() { this.Condition = this.Condition.CheckAndCache() as FnObject<bool>; this.TrueArg = this.TrueArg.CheckAndCache() as FnObject<T>; this.FalseArg = this.FalseArg.CheckAndCache() as FnObject<T>; return this.IsCachable() ? (FnObject) new FnConstant<T>(this.GetValue()) : (FnObject) this; }
public override object GetValue() { if (!this.IsImmutableExecute.Value) { this.Parameter.Value = this.Value.GetValue(); } return((object)null); }
private void btnExecute_Click(object sender, EventArgs e) { TimeSpan totalTime = System.DateTime.Now.TimeOfDay; Double result = 0; FnObject<Double> returnNode = Expression.ExecutionNode as FnObject<Double>; for (int i = 0; i < ITERATIONS; i++) { result = Expression.Execute(); //result = returnNode.GetValue(); } txtExecutionResult.Text = result.ToString(); totalTime = System.DateTime.Now.TimeOfDay - totalTime; String ticks = "For fnScript 2.5, " + ITERATIONS.ToString() + " operations timing: " + totalTime.ToString(); this.Text = ticks; }
internal FnIf(FnObject<bool> condition, FnObject trueArg, FnObject falseArg) { this.Condition = condition; this.TrueArg = trueArg as FnObject<T>; this.FalseArg = falseArg as FnObject<T>; }