﻿// Decompiled with JetBrains decompiler
// Type: MS.Internal.Xml.XPath.GroupQuery
// Assembly: System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 50ABAB51-7DC3-4F0A-A797-0D0C2D124D60
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Xml.dll

using System.Runtime;
using System.Xml.XPath;

namespace MS.Internal.Xml.XPath
{
  internal sealed class GroupQuery : BaseAxisQuery
  {
    public override XPathResultType StaticType
    {
      get
      {
        return this.qyInput.StaticType;
      }
    }

    public override QueryProps Properties
    {
      get
      {
        return QueryProps.Position;
      }
    }

    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    public GroupQuery(Query qy)
      : base(qy)
    {
    }

    private GroupQuery(GroupQuery other)
      : base((BaseAxisQuery) other)
    {
    }

    public override XPathNavigator Advance()
    {
      this.currentNode = this.qyInput.Advance();
      if (this.currentNode != null)
        ++this.position;
      return this.currentNode;
    }

    public override object Evaluate(XPathNodeIterator nodeIterator)
    {
      return this.qyInput.Evaluate(nodeIterator);
    }

    public override XPathNodeIterator Clone()
    {
      return (XPathNodeIterator) new GroupQuery(this);
    }
  }
}
