blob: 04e1cdb890f79db9f31ed50693a310d7fc71c2f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
//------------------------------------------------------------------------------
// <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; }
}
}
}
|