Пример #1
0
        internal ILForeach(ILCoder coding, ILVariable enumerable)
            : base(coding)
        {
            this._current     = coding.Null.ToLocal();
            this._enumerator  = enumerable.Invoke(ILForeach.getEnumerator, null, null).ToLocal();
            this._currentProp = this._enumerator.GetProperty("Current");
            this._moveNext    = this._enumerator.Invoke(ILForeach.moveNext, null, null);

            this._innerWhile = coding.While(this._moveNext);
            this.Item.AssignFrom(this._currentProp.Get());
        }
Пример #2
0
 internal ILFor(ILCoder coding, ILLocal i, ILLazy comparer, ILLazy operating)
     : base(coding, comparer)
 {
     if (comparer.ILType == typeof(bool))
     {
         this.I         = i;
         this.Comparer  = comparer;
         this._operator = operating;
     }
     else
     {
         throw new InvalidOperationException("Comparer type must be Boolean.");
     }
 }