예제 #1
0
 internal VariableArrayBase(TItem itemPrototype, params Range[] ranges)
     : base(itemPrototype.Containers)
 {
     this.ranges        = ranges;
     this.itemPrototype = itemPrototype;
     // check that none of the ranges match an open container
     foreach (Range r in ranges)
     {
         if (r == null)
         {
             throw new ArgumentNullException("range");
         }
         foreach (IStatementBlock stBlock in containers)
         {
             if (stBlock is ForEachBlock)
             {
                 ForEachBlock fb = (ForEachBlock)stBlock;
                 if (r.Equals(fb.Range))
                 {
                     throw new InvalidOperationException("Range '" + r + "' is already open in a ForEach block.  Use a cloned range instead.");
                 }
             }
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Adds this block to a thread-specific list of open blocks.
 /// </summary>
 internal override void OpenBlock()
 {
     ForEachBlock.CheckRangeCanBeOpened(range);
     base.OpenBlock();
 }