Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathAxisIterator.cs / 1305376 / XPathAxisIterator.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 abstract class XPathAxisIterator: XPathNodeIterator {
internal XPathNavigator nav;
internal XPathNodeType type;
internal string name;
internal string uri;
internal int position;
internal bool matchSelf;
internal bool first = true;
public XPathAxisIterator(XPathNavigator nav, bool matchSelf) {
this.nav = nav;
this.matchSelf = matchSelf;
}
public XPathAxisIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : this(nav, matchSelf) {
this.type = type;
}
public XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : this(nav, matchSelf) {
if (name == null) throw new ArgumentNullException("name");
if (namespaceURI == null) throw new ArgumentNullException("namespaceURI");
this.name = name;
this.uri = namespaceURI;
}
public XPathAxisIterator(XPathAxisIterator it) {
this.nav = it.nav.Clone();
this.type = it.type;
this.name = it.name;
this.uri = it.uri;
this.position = it.position;
this.matchSelf = it.matchSelf;
this.first = it.first;
}
public override XPathNavigator Current {
get { return nav; }
}
public override int CurrentPosition {
get { return position; }
}
// Nodetype Matching - Given nodetype matches the navigator's nodetype
//Given nodetype is all . So it matches everything
//Given nodetype is text - Matches text, WS, Significant WS
protected virtual bool Matches {
get {
if (name == null) {
return (
type == nav.NodeType ||
type == XPathNodeType.All ||
type == XPathNodeType.Text && (
nav.NodeType == XPathNodeType.Whitespace ||
nav.NodeType == XPathNodeType.SignificantWhitespace
)
);
} else {
return(
nav.NodeType == XPathNodeType.Element &&
(name.Length == 0 || name == nav.LocalName) &&
(uri == nav.NamespaceURI)
);
}
}
}
}
}
// 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
- ArrayConverter.cs
- DBNull.cs
- XPathItem.cs
- PathFigureCollection.cs
- TabPageDesigner.cs
- ServiceDescriptionImporter.cs
- SplineKeyFrames.cs
- WinEventHandler.cs
- HttpCookie.cs
- UIPermission.cs
- DataGridViewLinkColumn.cs
- BitmapEffectDrawingContent.cs
- PeoplePickerWrapper.cs
- ReaderWriterLockWrapper.cs
- CompoundFileIOPermission.cs
- GradientBrush.cs
- DesignerActionService.cs
- ControlBuilderAttribute.cs
- SortedList.cs
- SuppressMessageAttribute.cs
- KeyProperty.cs
- XmlNullResolver.cs
- RequiredFieldValidator.cs
- SingleTagSectionHandler.cs
- DetailsViewModeEventArgs.cs
- MetadataCollection.cs
- PageContentAsyncResult.cs
- BindingExpressionBase.cs
- BooleanProjectedSlot.cs
- DataControlFieldCell.cs
- ActivityMarkupSerializer.cs
- TextFormatter.cs
- ISCIIEncoding.cs
- MenuCommand.cs
- ObjectDataSourceMethodEventArgs.cs
- IndexerReference.cs
- DistributedTransactionPermission.cs
- SelectorAutomationPeer.cs
- DataSourceView.cs
- BitmapEffectCollection.cs
- MaskedTextBoxTextEditor.cs
- EventLogPropertySelector.cs
- PtsContext.cs
- RSAOAEPKeyExchangeFormatter.cs
- MediaElementAutomationPeer.cs
- Message.cs
- TextBoxLine.cs
- BaseTemplatedMobileComponentEditor.cs
- SessionStateModule.cs
- AssociationSet.cs
- XmlBinaryReader.cs
- TypeLibConverter.cs
- TransformerConfigurationWizardBase.cs
- DbProviderFactoriesConfigurationHandler.cs
- Odbc32.cs
- AssociationProvider.cs
- ContextMarshalException.cs
- MsmqHostedTransportManager.cs
- DataReaderContainer.cs
- GridViewRowEventArgs.cs
- XmlSchemaInfo.cs
- XPathPatternBuilder.cs
- PathTooLongException.cs
- XamlStream.cs
- HttpModuleCollection.cs
- InvalidPropValue.cs
- ObjectDataSourceEventArgs.cs
- FlowLayoutPanel.cs
- ScriptMethodAttribute.cs
- MarshalByValueComponent.cs
- ColumnHeaderCollectionEditor.cs
- TrackingProfileSerializer.cs
- RoutedEventHandlerInfo.cs
- StartFileNameEditor.cs
- IPEndPoint.cs
- AppDomainEvidenceFactory.cs
- WebPartChrome.cs
- MdiWindowListItemConverter.cs
- glyphs.cs
- FontStyleConverter.cs
- Schema.cs
- JavascriptXmlWriterWrapper.cs
- CacheRequest.cs
- SapiAttributeParser.cs
- DesignerTextViewAdapter.cs
- ClientProxyGenerator.cs
- TrackBarRenderer.cs
- OracleParameterCollection.cs
- ConfigXmlComment.cs
- SoapAttributeAttribute.cs
- Schema.cs
- DesignerAdapterUtil.cs
- AutomationEventArgs.cs
- RegularExpressionValidator.cs
- Symbol.cs
- WindowsScrollBarBits.cs
- PaintValueEventArgs.cs
- ArrayWithOffset.cs
- SecureConversationServiceElement.cs
- RegexCaptureCollection.cs