1 //------------------------------------------------------------------------------
2 // <copyright file="QilBinary.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 using System.Collections.Generic;
9 using System.Diagnostics;
11 namespace System.Xml.Xsl.Qil {
14 /// View over a Qil operator having two children.
17 /// Don't construct QIL nodes directly; instead, use the <see cref="QilFactory">QilFactory</see>.
19 internal class QilBinary : QilNode {
20 private QilNode left, right;
23 //-----------------------------------------------
25 //-----------------------------------------------
28 /// Construct a new node
30 public QilBinary(QilNodeType nodeType, QilNode left, QilNode right) : base(nodeType) {
36 //-----------------------------------------------
37 // IList<QilNode> methods -- override
38 //-----------------------------------------------
40 public override int Count {
44 public override QilNode this[int index] {
47 case 0: return this.left;
48 case 1: return this.right;
49 default: throw new IndexOutOfRangeException();
54 case 0: this.left = value; break;
55 case 1: this.right = value; break;
56 default: throw new IndexOutOfRangeException();
62 //-----------------------------------------------
64 //-----------------------------------------------
67 get { return this.left; }
68 set { this.left = value; }
71 public QilNode Right {
72 get { return this.right; }
73 set { this.right = value; }