You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,54 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="ContextQuery.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MS.Internal.Xml.XPath {
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.Diagnostics;
|
||||
|
||||
internal class ContextQuery : Query {
|
||||
protected XPathNavigator contextNode;
|
||||
|
||||
public ContextQuery() {
|
||||
this.count = 0;
|
||||
}
|
||||
protected ContextQuery(ContextQuery other) : base(other) {
|
||||
this.contextNode = other.contextNode; // Don't need to clone here
|
||||
}
|
||||
public override void Reset() {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
public override XPathNavigator Current { get { return contextNode; } }
|
||||
|
||||
public override object Evaluate(XPathNodeIterator context) {
|
||||
contextNode = context.Current; // We don't clone here. Because we never move it.
|
||||
count = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override XPathNavigator Advance() {
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
return contextNode;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public override XPathNavigator MatchNode(XPathNavigator current) {
|
||||
return current;
|
||||
}
|
||||
|
||||
public override XPathNodeIterator Clone() { return new ContextQuery(this); }
|
||||
|
||||
public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } }
|
||||
public override int CurrentPosition { get { return count; } }
|
||||
public override int Count { get { return 1; } }
|
||||
public override QueryProps Properties { get { return QueryProps.Merge | QueryProps.Cached | QueryProps.Position | QueryProps.Count; } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user