1 //------------------------------------------------------------------------------
2 // <copyright file="QilTernary.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 three children.
17 /// Don't construct QIL nodes directly; instead, use the <see cref="QilFactory">QilFactory</see>.
19 internal class QilTernary : QilNode {
20 private QilNode left, center, right;
23 //-----------------------------------------------
25 //-----------------------------------------------
28 /// Construct a new node
30 public QilTernary(QilNodeType nodeType, QilNode left, QilNode center, QilNode right) : base(nodeType) {
37 //-----------------------------------------------
38 // IList<QilNode> methods -- override
39 //-----------------------------------------------
41 public override int Count {
45 public override QilNode this[int index] {
48 case 0: return this.left;
49 case 1: return this.center;
50 case 2: return this.right;
51 default: throw new IndexOutOfRangeException();
56 case 0: this.left = value; break;
57 case 1: this.center = value; break;
58 case 2: this.right = value; break;
59 default: throw new IndexOutOfRangeException();
65 //-----------------------------------------------
67 //-----------------------------------------------
70 get { return this.left; }
71 set { this.left = value; }
74 public QilNode Center {
75 get { return this.center; }
76 set { this.center = value; }
79 public QilNode Right {
80 get { return this.right; }
81 set { this.right = value; }