Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.SqlXml / System / Xml / Xsl / QIL / QilBinary.cs
blobc1982324c232e1db935677cd5bcf895ce6f4984a
1 //------------------------------------------------------------------------------
2 // <copyright file="QilBinary.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
7 using System;
8 using System.Collections.Generic;
9 using System.Diagnostics;
11 namespace System.Xml.Xsl.Qil {
13 /// <summary>
14 /// View over a Qil operator having two children.
15 /// </summary>
16 /// <remarks>
17 /// Don't construct QIL nodes directly; instead, use the <see cref="QilFactory">QilFactory</see>.
18 /// </remarks>
19 internal class QilBinary : QilNode {
20 private QilNode left, right;
23 //-----------------------------------------------
24 // Constructor
25 //-----------------------------------------------
27 /// <summary>
28 /// Construct a new node
29 /// </summary>
30 public QilBinary(QilNodeType nodeType, QilNode left, QilNode right) : base(nodeType) {
31 this.left = left;
32 this.right = right;
36 //-----------------------------------------------
37 // IList<QilNode> methods -- override
38 //-----------------------------------------------
40 public override int Count {
41 get { return 2; }
44 public override QilNode this[int index] {
45 get {
46 switch (index) {
47 case 0: return this.left;
48 case 1: return this.right;
49 default: throw new IndexOutOfRangeException();
52 set {
53 switch (index) {
54 case 0: this.left = value; break;
55 case 1: this.right = value; break;
56 default: throw new IndexOutOfRangeException();
62 //-----------------------------------------------
63 // QilBinary methods
64 //-----------------------------------------------
66 public QilNode Left {
67 get { return this.left; }
68 set { this.left = value; }
71 public QilNode Right {
72 get { return this.right; }
73 set { this.right = value; }