示例#1
0
 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;
 }
示例#2
0
 public override object GetValue()
 {
     if (!this.IsImmutableExecute.Value)
     {
         this.Parameter.Value = this.Value.GetValue();
     }
     return((object)null);
 }
示例#3
0
文件: Form1.cs 项目: JDosX/Functal
        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;
        }
示例#4
0
 internal FnIf(FnObject<bool> condition, FnObject trueArg, FnObject falseArg)
 {
   this.Condition = condition;
   this.TrueArg = trueArg as FnObject<T>;
   this.FalseArg = falseArg as FnObject<T>;
 }