//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // // [....] //------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.Diagnostics; namespace System.Xml.Xsl.Qil { /// /// View over a Qil operator having one child. /// /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// internal class QilUnary : QilNode { private QilNode child; //----------------------------------------------- // Constructor //----------------------------------------------- /// /// Construct a new node /// public QilUnary(QilNodeType nodeType, QilNode child) : base(nodeType) { this.child = child; } //----------------------------------------------- // IList methods -- override //----------------------------------------------- public override int Count { get { return 1; } } public override QilNode this[int index] { get { if (index != 0) throw new IndexOutOfRangeException(); return this.child; } set { if (index != 0) throw new IndexOutOfRangeException(); this.child = value; } } //----------------------------------------------- // QilUnary methods //----------------------------------------------- public QilNode Child { get { return this.child; } set { this.child = value; } } } }