Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / ChildrenQuery.cs / 1 / ChildrenQuery.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System;
using System.Xml;
using System.Xml.XPath;
using System.Diagnostics;
using System.Globalization;
using System.Xml.Xsl;
using System.Collections;
internal class ChildrenQuery : BaseAxisQuery {
XPathNodeIterator iterator = XPathEmptyIterator.Instance;
public ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type) : base (qyInput, name, prefix, type) {}
protected ChildrenQuery(ChildrenQuery other) : base(other) {
this.iterator = Clone(other.iterator);
}
public override void Reset() {
iterator = XPathEmptyIterator.Instance;
base.Reset();
}
public override XPathNavigator Advance() {
while (!iterator.MoveNext()) {
XPathNavigator input = qyInput.Advance();
if (input == null) {
return null;
}
if (NameTest) {
if (TypeTest == XPathNodeType.ProcessingInstruction) {
iterator = new IteratorFilter(input.SelectChildren(TypeTest), Name);
} else {
iterator = input.SelectChildren(Name, Namespace);
}
} else {
iterator = input.SelectChildren(TypeTest);
}
position = 0;
}
position ++;
currentNode = iterator.Current;
return currentNode;
} // Advance
public sealed override XPathNavigator MatchNode(XPathNavigator context) {
if (context != null) {
if (matches(context)) {
XPathNavigator temp = context.Clone();
if (temp.NodeType != XPathNodeType.Attribute && temp.MoveToParent()) {
return qyInput.MatchNode(temp);
}
return null;
}
}
return null;
}
public override XPathNodeIterator Clone() { return new ChildrenQuery(this); }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System;
using System.Xml;
using System.Xml.XPath;
using System.Diagnostics;
using System.Globalization;
using System.Xml.Xsl;
using System.Collections;
internal class ChildrenQuery : BaseAxisQuery {
XPathNodeIterator iterator = XPathEmptyIterator.Instance;
public ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type) : base (qyInput, name, prefix, type) {}
protected ChildrenQuery(ChildrenQuery other) : base(other) {
this.iterator = Clone(other.iterator);
}
public override void Reset() {
iterator = XPathEmptyIterator.Instance;
base.Reset();
}
public override XPathNavigator Advance() {
while (!iterator.MoveNext()) {
XPathNavigator input = qyInput.Advance();
if (input == null) {
return null;
}
if (NameTest) {
if (TypeTest == XPathNodeType.ProcessingInstruction) {
iterator = new IteratorFilter(input.SelectChildren(TypeTest), Name);
} else {
iterator = input.SelectChildren(Name, Namespace);
}
} else {
iterator = input.SelectChildren(TypeTest);
}
position = 0;
}
position ++;
currentNode = iterator.Current;
return currentNode;
} // Advance
public sealed override XPathNavigator MatchNode(XPathNavigator context) {
if (context != null) {
if (matches(context)) {
XPathNavigator temp = context.Clone();
if (temp.NodeType != XPathNodeType.Attribute && temp.MoveToParent()) {
return qyInput.MatchNode(temp);
}
return null;
}
}
return null;
}
public override XPathNodeIterator Clone() { return new ChildrenQuery(this); }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReachDocumentReferenceSerializerAsync.cs
- PathFigureCollectionValueSerializer.cs
- DataGridViewSelectedRowCollection.cs
- InlineObject.cs
- DataKeyCollection.cs
- oledbconnectionstring.cs
- ReferenceEqualityComparer.cs
- DefaultTextStoreTextComposition.cs
- PublisherIdentityPermission.cs
- EntityDataSourceUtil.cs
- WorkflowMarkupSerializationProvider.cs
- ByteArrayHelperWithString.cs
- SocketElement.cs
- Int16KeyFrameCollection.cs
- SqlEnums.cs
- RuntimeHandles.cs
- StyleModeStack.cs
- RegexRunner.cs
- URIFormatException.cs
- SizeChangedEventArgs.cs
- NativeMethods.cs
- EditBehavior.cs
- IdentityValidationException.cs
- ByteAnimation.cs
- SqlCommandBuilder.cs
- SmiEventStream.cs
- XmlDataImplementation.cs
- ApplicationId.cs
- TextElementEditingBehaviorAttribute.cs
- SqlEnums.cs
- KerberosSecurityTokenAuthenticator.cs
- X509UI.cs
- SendKeys.cs
- NodeCounter.cs
- TaskHelper.cs
- TrackingDataItem.cs
- MouseDevice.cs
- DataGridViewColumnConverter.cs
- InputLanguageSource.cs
- LoginAutoFormat.cs
- Point3DCollection.cs
- CombinedGeometry.cs
- SerialStream.cs
- OutputCacheSection.cs
- CookieProtection.cs
- DomNameTable.cs
- ReadOnlyDictionary.cs
- IndexerNameAttribute.cs
- EnumerableRowCollectionExtensions.cs
- QuaternionKeyFrameCollection.cs
- ParenthesizePropertyNameAttribute.cs
- RoutingConfiguration.cs
- LayoutInformation.cs
- ColorContext.cs
- SafeProcessHandle.cs
- SessionPageStateSection.cs
- MouseWheelEventArgs.cs
- XmlSchemaImporter.cs
- DependentList.cs
- DataGridHeaderBorder.cs
- CommonProperties.cs
- ViewEvent.cs
- SecurityRuntime.cs
- WebBrowserDocumentCompletedEventHandler.cs
- DataGridViewCellStyleEditor.cs
- DesignerImageAdapter.cs
- IconConverter.cs
- NaturalLanguageHyphenator.cs
- ColumnResizeUndoUnit.cs
- XmlReader.cs
- DoubleLink.cs
- PreloadHost.cs
- InkCanvasAutomationPeer.cs
- ObjectTypeMapping.cs
- InputScope.cs
- RelOps.cs
- CornerRadius.cs
- MatrixTransform.cs
- ToolZone.cs
- WebEvents.cs
- X509RecipientCertificateServiceElement.cs
- PrivacyNoticeElement.cs
- SmiEventStream.cs
- Configuration.cs
- GenericParameterDataContract.cs
- LocalIdCollection.cs
- SrgsToken.cs
- CategoryNameCollection.cs
- XmlElementCollection.cs
- objectresult_tresulttype.cs
- SymbolPair.cs
- GraphicsContext.cs
- CodeDOMProvider.cs
- DataGridToolTip.cs
- ObjectListCommandEventArgs.cs
- PointConverter.cs
- ImageBrush.cs
- XmlArrayItemAttributes.cs
- SqlDependencyUtils.cs
- LayoutSettings.cs