Example #1
0
 private ExecutionContext(Script script, Script callingScript, int rvcount, RandomAccessStack <StackItem> stack, RandomAccessStack <StackItem> alt)
 {
     this.RVCount         = rvcount;
     this.Script          = script;
     this.EvaluationStack = stack;
     this.AltStack        = alt;
     this.CallingScript   = callingScript;
 }
Example #2
0
 /// <summary>
 /// 将随机访问栈指定数量的元素复制到目标随机访问栈
 /// </summary>
 /// <param name="stack">目标随机访问栈</param>
 /// <param name="count">需要复制的元素数量,默认值为-1,表示复制全部元素</param>
 public void CopyTo(RandomAccessStack <T> stack, int count = -1)
 {
     if (count == 0)
     {
         return;
     }
     if (count == -1)
     {
         stack.list.AddRange(list);
     }
     else
     {
         stack.list.AddRange(list.Skip(list.Count - count));
     }
 }