//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
namespace System.Xml.Xsl.Qil {
///
/// View over a Qil iterator node (For or Let).
///
internal class QilIterator : QilReference {
private QilNode binding;
//-----------------------------------------------
// Constructor
//-----------------------------------------------
///
/// Construct an iterator
///
public QilIterator(QilNodeType nodeType, QilNode binding) : base(nodeType) {
Binding = binding;
}
//-----------------------------------------------
// IList methods -- override
//-----------------------------------------------
public override int Count {
get { return 1; }
}
public override QilNode this[int index] {
get { if (index != 0) throw new IndexOutOfRangeException(); return this.binding; }
set { if (index != 0) throw new IndexOutOfRangeException(); this.binding = value; }
}
//-----------------------------------------------
// QilIterator methods
//-----------------------------------------------
///
/// Expression which is bound to the iterator.
///
public QilNode Binding {
get { return this.binding; }
set { this.binding = value; }
}
}
}