Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathSelectionIterator.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- PropertyEmitterBase.cs
- Condition.cs
- EntityDataSourceSelectingEventArgs.cs
- SchemaNames.cs
- ErrorHandler.cs
- UITypeEditor.cs
- ListViewGroup.cs
- PrivateFontCollection.cs
- _LocalDataStoreMgr.cs
- ComponentEditorForm.cs
- RadioButtonRenderer.cs
- BinaryWriter.cs
- MenuItem.cs
- DBBindings.cs
- BamlStream.cs
- OleDbConnectionInternal.cs
- CompiledAction.cs
- WorkflowOperationInvoker.cs
- DataContractAttribute.cs
- EnterpriseServicesHelper.cs
- WebBrowserNavigatingEventHandler.cs
- AttributeQuery.cs
- JpegBitmapDecoder.cs
- EntityTypeBase.cs
- HostingEnvironmentException.cs
- _NestedMultipleAsyncResult.cs
- QuerySelectOp.cs
- RawStylusInputReport.cs
- StubHelpers.cs
- AsyncCodeActivity.cs
- SystemIcmpV4Statistics.cs
- TypeSystem.cs
- WebPartChrome.cs
- mediapermission.cs
- StateWorkerRequest.cs
- VersionConverter.cs
- CqlIdentifiers.cs
- TemplateXamlParser.cs
- TextBoxLine.cs
- BaseServiceProvider.cs
- DtdParser.cs
- InputMethodStateTypeInfo.cs
- XPathScanner.cs
- XmlSchemaType.cs
- AuthenticationModuleElement.cs
- StatusCommandUI.cs
- DataMemberFieldEditor.cs
- Sentence.cs
- SortedList.cs
- ChangeToolStripParentVerb.cs
- SchemaLookupTable.cs
- MetadataPropertyCollection.cs
- Hyperlink.cs
- PathStreamGeometryContext.cs
- RemotingSurrogateSelector.cs
- MultiBindingExpression.cs
- XamlSerializationHelper.cs
- XsdBuildProvider.cs
- Deserializer.cs
- ListBoxItem.cs
- EndpointConfigContainer.cs
- TemplatedWizardStep.cs
- StoreContentChangedEventArgs.cs
- PageContent.cs
- DBSchemaRow.cs
- SchemaComplexType.cs
- MethodBuilderInstantiation.cs
- ObjectRef.cs
- ClientOptions.cs
- ThrowHelper.cs
- ToolStripRenderEventArgs.cs
- AssemblyAssociatedContentFileAttribute.cs
- ColumnWidthChangingEvent.cs
- DbReferenceCollection.cs
- Evaluator.cs
- MailWebEventProvider.cs
- ListItemsPage.cs
- Transform.cs
- IndexOutOfRangeException.cs
- SizeAnimationUsingKeyFrames.cs
- QueryCacheManager.cs
- WebPartsPersonalizationAuthorization.cs
- AnnotationObservableCollection.cs
- AssemblyUtil.cs
- _NTAuthentication.cs
- DataControlLinkButton.cs
- DataGridViewImageColumn.cs
- ApplicationDirectoryMembershipCondition.cs
- DataGridViewRowStateChangedEventArgs.cs
- UpdatePanelTriggerCollection.cs
- StringSource.cs
- HttpModuleCollection.cs
- RotateTransform3D.cs
- UnicastIPAddressInformationCollection.cs
- DesignColumnCollection.cs
- ProcessDesigner.cs
- ZipIOCentralDirectoryBlock.cs
- StringUtil.cs
- Effect.cs
- assemblycache.cs