Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / XPath / Internal / AttributeQuery.cs / 1 / AttributeQuery.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;
internal sealed class AttributeQuery : BaseAxisQuery {
private bool onAttribute = false;
public AttributeQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type) : base(qyParent, Name, Prefix, Type) {}
private AttributeQuery(AttributeQuery other) : base(other) {
this.onAttribute = other.onAttribute;
}
public override void Reset() {
onAttribute = false;
base.Reset();
}
public override XPathNavigator Advance() {
while (true) {
if (! onAttribute) {
currentNode = qyInput.Advance();
if (currentNode == null) {
return null;
}
position = 0;
currentNode = currentNode.Clone();
onAttribute = currentNode.MoveToFirstAttribute();
} else {
onAttribute = currentNode.MoveToNextAttribute();
}
if (onAttribute) {
Debug.Assert(! currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
if (matches(currentNode)) {
position++;
return currentNode;
}
}
} // while
}
public override XPathNavigator MatchNode(XPathNavigator context) {
if (context != null) {
if (context.NodeType == XPathNodeType.Attribute && matches(context)) {
XPathNavigator temp = context.Clone();
if (temp.MoveToParent()) {
return qyInput.MatchNode(temp);
}
}
}
return null;
}
public override XPathNodeIterator Clone() { return new AttributeQuery(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;
internal sealed class AttributeQuery : BaseAxisQuery {
private bool onAttribute = false;
public AttributeQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type) : base(qyParent, Name, Prefix, Type) {}
private AttributeQuery(AttributeQuery other) : base(other) {
this.onAttribute = other.onAttribute;
}
public override void Reset() {
onAttribute = false;
base.Reset();
}
public override XPathNavigator Advance() {
while (true) {
if (! onAttribute) {
currentNode = qyInput.Advance();
if (currentNode == null) {
return null;
}
position = 0;
currentNode = currentNode.Clone();
onAttribute = currentNode.MoveToFirstAttribute();
} else {
onAttribute = currentNode.MoveToNextAttribute();
}
if (onAttribute) {
Debug.Assert(! currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
if (matches(currentNode)) {
position++;
return currentNode;
}
}
} // while
}
public override XPathNavigator MatchNode(XPathNavigator context) {
if (context != null) {
if (context.NodeType == XPathNodeType.Attribute && matches(context)) {
XPathNavigator temp = context.Clone();
if (temp.MoveToParent()) {
return qyInput.MatchNode(temp);
}
}
}
return null;
}
public override XPathNodeIterator Clone() { return new AttributeQuery(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
- StylusButtonCollection.cs
- PrefixQName.cs
- HashAlgorithm.cs
- UserControlParser.cs
- InfiniteTimeSpanConverter.cs
- ObjectListComponentEditor.cs
- DomainLiteralReader.cs
- NativeMethods.cs
- QilIterator.cs
- PartialCachingAttribute.cs
- AssemblyAssociatedContentFileAttribute.cs
- EntityKey.cs
- SpeakCompletedEventArgs.cs
- ItemMap.cs
- WebAdminConfigurationHelper.cs
- controlskin.cs
- WeakEventManager.cs
- MaterialCollection.cs
- ViewManager.cs
- InternalConfigHost.cs
- FamilyTypefaceCollection.cs
- Camera.cs
- VectorCollectionValueSerializer.cs
- DLinqDataModelProvider.cs
- ObfuscationAttribute.cs
- SystemIPInterfaceStatistics.cs
- CurrencyManager.cs
- EndGetFileNameFromUserRequest.cs
- LoaderAllocator.cs
- EndEvent.cs
- PingOptions.cs
- RectIndependentAnimationStorage.cs
- ProxyManager.cs
- EventPropertyMap.cs
- XmlSchemaSubstitutionGroup.cs
- HMACSHA256.cs
- TableCell.cs
- StatusBar.cs
- PagedDataSource.cs
- SqlColumnizer.cs
- CodeThrowExceptionStatement.cs
- TableLayoutStyle.cs
- UniqueIdentifierService.cs
- DataColumnPropertyDescriptor.cs
- DefaultIfEmptyQueryOperator.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- _AutoWebProxyScriptWrapper.cs
- ToolStripSplitStackLayout.cs
- DataSourceControlBuilder.cs
- MaterialGroup.cs
- SystemResourceHost.cs
- DiagnosticsConfiguration.cs
- RandomNumberGenerator.cs
- ObjectListDataBindEventArgs.cs
- RoleGroup.cs
- TextViewElement.cs
- TreeNode.cs
- EntityDataSourceEntityTypeFilterItem.cs
- CheckPair.cs
- _OverlappedAsyncResult.cs
- MetaModel.cs
- HtmlCommandAdapter.cs
- BuildDependencySet.cs
- PolyLineSegment.cs
- StrongNameIdentityPermission.cs
- CatalogZoneBase.cs
- NavigationProgressEventArgs.cs
- IxmlLineInfo.cs
- ListViewTableRow.cs
- XmlDictionaryReaderQuotas.cs
- DBConcurrencyException.cs
- BinHexEncoder.cs
- XmlSchemaSimpleContentExtension.cs
- ConstrainedDataObject.cs
- XsltContext.cs
- WindowsTitleBar.cs
- AssemblyFilter.cs
- ExpressionCopier.cs
- FacetDescriptionElement.cs
- AppDomain.cs
- SrgsElementFactoryCompiler.cs
- IdentityHolder.cs
- BaseInfoTable.cs
- SoapConverter.cs
- RandomNumberGenerator.cs
- PseudoWebRequest.cs
- DataBindingCollectionEditor.cs
- EntityParameter.cs
- StylusTip.cs
- xdrvalidator.cs
- shaperfactoryquerycacheentry.cs
- SqlServices.cs
- CroppedBitmap.cs
- LabelDesigner.cs
- MembershipSection.cs
- StickyNoteHelper.cs
- RootNamespaceAttribute.cs
- PublisherIdentityPermission.cs
- PeerContact.cs
- XmlSchemaInclude.cs