Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathAncestorIterator.cs / 1 / XPathAncestorIterator.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 class XPathAncestorIterator: XPathAxisIterator {
public XPathAncestorIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {}
public XPathAncestorIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {}
public XPathAncestorIterator(XPathAncestorIterator other) : base(other) { }
public override bool MoveNext() {
if (first) {
first = false;
if(matchSelf && Matches) {
position = 1;
return true;
}
}
while (nav.MoveToParent()) {
if (Matches) {
position ++;
return true;
}
}
return false;
}
public override XPathNodeIterator Clone() { return new XPathAncestorIterator(this); }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Utils.cs
- DuplicateWaitObjectException.cs
- TableLayoutRowStyleCollection.cs
- StringAnimationBase.cs
- xmlfixedPageInfo.cs
- StyleBamlRecordReader.cs
- TextServicesCompartmentContext.cs
- HttpEncoderUtility.cs
- EventlogProvider.cs
- NavigationProgressEventArgs.cs
- XslTransform.cs
- ConnectionPointGlyph.cs
- TypedDataSourceCodeGenerator.cs
- Win32MouseDevice.cs
- XmlAttributeCollection.cs
- StorageModelBuildProvider.cs
- _TLSstream.cs
- FormViewUpdateEventArgs.cs
- XmlSchemaObjectCollection.cs
- AssemblyAttributesGoHere.cs
- HScrollProperties.cs
- CompositeTypefaceMetrics.cs
- PaginationProgressEventArgs.cs
- FeatureManager.cs
- LabelLiteral.cs
- WebScriptEnablingElement.cs
- XmlLinkedNode.cs
- DocumentPageTextView.cs
- safesecurityhelperavalon.cs
- designeractionlistschangedeventargs.cs
- BrowsableAttribute.cs
- ObjectStateManagerMetadata.cs
- CodeMemberEvent.cs
- ResourceExpression.cs
- LabelTarget.cs
- XmlIncludeAttribute.cs
- SystemResourceKey.cs
- LassoSelectionBehavior.cs
- PermissionListSet.cs
- SqlError.cs
- Authorization.cs
- EtwTrackingBehavior.cs
- AccessorTable.cs
- Matrix3DStack.cs
- FlowThrottle.cs
- RectangleHotSpot.cs
- GridErrorDlg.cs
- MeshGeometry3D.cs
- JournalNavigationScope.cs
- TransformerInfo.cs
- ContextActivityUtils.cs
- ListViewDeletedEventArgs.cs
- AllMembershipCondition.cs
- XhtmlBasicListAdapter.cs
- TextDecorationLocationValidation.cs
- SchemaComplexType.cs
- CustomAttributeSerializer.cs
- ObjectQueryState.cs
- DataListComponentEditor.cs
- TextBoxView.cs
- CodeTypeParameter.cs
- MatchingStyle.cs
- ScriptResourceAttribute.cs
- ServiceDurableInstance.cs
- RelatedCurrencyManager.cs
- FileRecordSequenceHelper.cs
- ObservableCollection.cs
- ValidationEventArgs.cs
- CellPartitioner.cs
- CellTreeNodeVisitors.cs
- SequenceQuery.cs
- ComplusEndpointConfigContainer.cs
- ArrayWithOffset.cs
- FontCacheUtil.cs
- BuildProviderAppliesToAttribute.cs
- SafeFileMappingHandle.cs
- UriSectionData.cs
- BulletChrome.cs
- TextRange.cs
- SchemaElementLookUpTableEnumerator.cs
- FactoryGenerator.cs
- TextSchema.cs
- AtomPub10ServiceDocumentFormatter.cs
- PlaceHolder.cs
- StreamGeometry.cs
- ClickablePoint.cs
- SecurityResources.cs
- MediaPlayerState.cs
- NoResizeHandleGlyph.cs
- ModuleConfigurationInfo.cs
- MemberInfoSerializationHolder.cs
- InvalidOperationException.cs
- ByteStorage.cs
- TableDetailsRow.cs
- MappedMetaModel.cs
- EncryptedXml.cs
- ToolboxComponentsCreatedEventArgs.cs
- ObjectDataSource.cs
- MobileControlsSectionHandler.cs
- DragEvent.cs