Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / ChildrenQuery.cs / 1305376 / 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
- DetailsViewDeleteEventArgs.cs
- RecordManager.cs
- ListBoxItem.cs
- TypedAsyncResult.cs
- SpecularMaterial.cs
- LambdaCompiler.Expressions.cs
- OleDbWrapper.cs
- LexicalChunk.cs
- DataGridCommandEventArgs.cs
- SHA256.cs
- COM2ExtendedUITypeEditor.cs
- QilGeneratorEnv.cs
- EntityDataSourceContextCreatingEventArgs.cs
- X509SubjectKeyIdentifierClause.cs
- RowsCopiedEventArgs.cs
- TransactionsSectionGroup.cs
- ScrollProperties.cs
- DataRelationPropertyDescriptor.cs
- TransformerTypeCollection.cs
- ReadOnlyHierarchicalDataSource.cs
- TextBox.cs
- RuleEngine.cs
- SendSecurityHeader.cs
- ItemsChangedEventArgs.cs
- DBSchemaRow.cs
- TreeNodeCollection.cs
- TextContainerChangedEventArgs.cs
- NetCodeGroup.cs
- XmlSerializationGeneratedCode.cs
- Processor.cs
- InputLangChangeRequestEvent.cs
- TempEnvironment.cs
- BindingContext.cs
- Table.cs
- WebReferencesBuildProvider.cs
- CodeIndexerExpression.cs
- arabicshape.cs
- SystemThemeKey.cs
- DbProviderConfigurationHandler.cs
- ComplexTypeEmitter.cs
- Types.cs
- Clock.cs
- RawStylusInput.cs
- BitmapSizeOptions.cs
- WS2007HttpBindingCollectionElement.cs
- BinaryParser.cs
- NameValueConfigurationElement.cs
- DependencyPropertyChangedEventArgs.cs
- Pens.cs
- XamlNamespaceHelper.cs
- PropertyEntry.cs
- AxHost.cs
- ApplicationServiceHelper.cs
- UIElement3D.cs
- TripleDESCryptoServiceProvider.cs
- InvalidPrinterException.cs
- QueueProcessor.cs
- SubqueryRules.cs
- DBConnection.cs
- MessageBodyMemberAttribute.cs
- odbcmetadatacollectionnames.cs
- ProxyWebPart.cs
- Page.cs
- GridEntry.cs
- TargetPerspective.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- InfoCardSymmetricAlgorithm.cs
- CrossSiteScriptingValidation.cs
- DateTimeFormatInfo.cs
- Roles.cs
- LookupBindingPropertiesAttribute.cs
- MouseGesture.cs
- WindowsListBox.cs
- EventBuilder.cs
- InplaceBitmapMetadataWriter.cs
- StrongNameSignatureInformation.cs
- CqlGenerator.cs
- ZoneMembershipCondition.cs
- CultureInfoConverter.cs
- MessageFilter.cs
- VoiceChangeEventArgs.cs
- DataControlFieldCollection.cs
- MenuEventArgs.cs
- RemotingAttributes.cs
- FactoryGenerator.cs
- BitmapVisualManager.cs
- COAUTHIDENTITY.cs
- PersistNameAttribute.cs
- Context.cs
- SafeNativeMethods.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ScrollPattern.cs
- PhysicalAddress.cs
- AutomationPropertyInfo.cs
- BrushMappingModeValidation.cs
- HttpException.cs
- XmlEventCache.cs
- HandlerMappingMemo.cs
- IntSumAggregationOperator.cs
- XPathArrayIterator.cs