Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

57 lines
1.8 KiB
C#

//------------------------------------------------------------------------------
// <copyright file="QilIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">[....]</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
namespace System.Xml.Xsl.Qil {
/// <summary>
/// View over a Qil iterator node (For or Let).
/// </summary>
internal class QilIterator : QilReference {
private QilNode binding;
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct an iterator
/// </summary>
public QilIterator(QilNodeType nodeType, QilNode binding) : base(nodeType) {
Binding = binding;
}
//-----------------------------------------------
// IList<QilNode> 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
//-----------------------------------------------
/// <summary>
/// Expression which is bound to the iterator.
/// </summary>
public QilNode Binding {
get { return this.binding; }
set { this.binding = value; }
}
}
}