Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathSelectionIterator.cs / 1305376 / XPathSelectionIterator.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;
// We need this wrapper object to:
// 1. Calculate position
// 2. Protect internal query.Current from user who may call MoveNext().
internal class XPathSelectionIterator : ResetableIterator {
private XPathNavigator nav;
private Query query;
private int position;
internal XPathSelectionIterator(XPathNavigator nav, Query query) {
this.nav = nav.Clone();
this.query = query;
}
protected XPathSelectionIterator(XPathSelectionIterator it) {
this.nav = it.nav.Clone();
this.query = (Query) it.query.Clone();
this.position = it.position;
}
public override void Reset() {
this.query.Reset();
}
public override bool MoveNext() {
XPathNavigator n = query.Advance();
if( n != null ) {
position++;
if (!nav.MoveTo(n)) {
nav = n.Clone();
}
return true;
}
return false;
}
public override int Count { get { return query.Count; } }
public override XPathNavigator Current { get { return nav; } }
public override int CurrentPosition { get { return position; } }
public override XPathNodeIterator Clone() { return new XPathSelectionIterator(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
- VisualBasicValue.cs
- ViewgenContext.cs
- XamlSerializer.cs
- AccessControlEntry.cs
- NetPipeSectionData.cs
- StackSpiller.Bindings.cs
- ChannelSinkStacks.cs
- DrawingContextDrawingContextWalker.cs
- Set.cs
- MethodCallConverter.cs
- InputLanguageEventArgs.cs
- XmlILConstructAnalyzer.cs
- EntityContainerEmitter.cs
- MetaTable.cs
- ResXBuildProvider.cs
- MouseEventArgs.cs
- Console.cs
- ArcSegment.cs
- RelationHandler.cs
- XmlComment.cs
- LoopExpression.cs
- DbDataAdapter.cs
- AnchorEditor.cs
- DiagnosticsConfigurationHandler.cs
- HttpCookiesSection.cs
- ConfigViewGenerator.cs
- ResizeGrip.cs
- GPStream.cs
- ServiceModelActivity.cs
- TransformerInfo.cs
- KeysConverter.cs
- ViewCellSlot.cs
- CanonicalXml.cs
- CompModSwitches.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- InternalCache.cs
- LookupNode.cs
- Matrix3DConverter.cs
- EntityDataSourceSelectedEventArgs.cs
- MetadataArtifactLoaderCompositeFile.cs
- Timer.cs
- TableLayoutSettings.cs
- FontWeights.cs
- HTMLTextWriter.cs
- KnownBoxes.cs
- RouteTable.cs
- TableLayoutCellPaintEventArgs.cs
- MemoryMappedFileSecurity.cs
- Pen.cs
- DoubleCollectionConverter.cs
- ToolStripCodeDomSerializer.cs
- Underline.cs
- XmlDocumentFragment.cs
- HttpResponseHeader.cs
- DelegatedStream.cs
- rsa.cs
- ListViewGroupConverter.cs
- XmlUtf8RawTextWriter.cs
- DataGrid.cs
- basecomparevalidator.cs
- _DisconnectOverlappedAsyncResult.cs
- BulletDecorator.cs
- SqlWriter.cs
- DocumentApplicationJournalEntry.cs
- StructuralCache.cs
- IPPacketInformation.cs
- DbgUtil.cs
- OracleLob.cs
- DataGridItemEventArgs.cs
- NamespaceEmitter.cs
- HttpDateParse.cs
- ImagingCache.cs
- LocalServiceSecuritySettingsElement.cs
- XmlKeywords.cs
- Facet.cs
- XmlDocument.cs
- FastEncoder.cs
- ReservationCollection.cs
- SslStream.cs
- PolyLineSegment.cs
- ExpressionVisitorHelpers.cs
- StdRegProviderWrapper.cs
- EdmType.cs
- InvalidComObjectException.cs
- TableLayoutCellPaintEventArgs.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- DocumentCollection.cs
- VerbConverter.cs
- ExpressionBindings.cs
- AspNetRouteServiceHttpHandler.cs
- BulletedList.cs
- RuleInfoComparer.cs
- columnmapfactory.cs
- MergeFilterQuery.cs
- XPathQueryGenerator.cs
- querybuilder.cs
- SecurityRuntime.cs
- ClientTargetCollection.cs
- ListArgumentProvider.cs
- FileNotFoundException.cs