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
- TreeNode.cs
- LicenseException.cs
- UpdatePanelControlTrigger.cs
- SqlBinder.cs
- WebPartConnectionsEventArgs.cs
- IgnoreFlushAndCloseStream.cs
- SqlDataSource.cs
- ChannelTerminatedException.cs
- PropertyOverridesTypeEditor.cs
- ErrorFormatter.cs
- Properties.cs
- StringSorter.cs
- PathFigureCollectionConverter.cs
- prefixendpointaddressmessagefilter.cs
- StatusBarPanel.cs
- XPathBinder.cs
- OuterGlowBitmapEffect.cs
- ContentType.cs
- querybuilder.cs
- RequestQueryProcessor.cs
- PointAnimationClockResource.cs
- SqlRemoveConstantOrderBy.cs
- DataBoundLiteralControl.cs
- Application.cs
- MultipartContentParser.cs
- Qualifier.cs
- WeakRefEnumerator.cs
- EntityDataSourceEntitySetNameItem.cs
- OutputScopeManager.cs
- SourceLineInfo.cs
- TableLayoutSettingsTypeConverter.cs
- FieldBuilder.cs
- _ConnectStream.cs
- FontEditor.cs
- _ScatterGatherBuffers.cs
- TreePrinter.cs
- TextEditorSpelling.cs
- HttpSessionStateWrapper.cs
- TemplateBaseAction.cs
- UrlMappingsSection.cs
- GridItemCollection.cs
- securitycriticaldata.cs
- XmlPreloadedResolver.cs
- InputLanguageSource.cs
- Color.cs
- ValueSerializer.cs
- SerTrace.cs
- ClientSideQueueItem.cs
- XmlSerializationWriter.cs
- SqlConnectionPoolGroupProviderInfo.cs
- QuaternionAnimationUsingKeyFrames.cs
- URIFormatException.cs
- SafeNativeMethods.cs
- TrayIconDesigner.cs
- Identity.cs
- XmlArrayAttribute.cs
- HtmlFormWrapper.cs
- Duration.cs
- ParseHttpDate.cs
- NamespaceEmitter.cs
- AppSettingsSection.cs
- XmlAttributeCache.cs
- GlobalAclOperationRequirement.cs
- RuleRefElement.cs
- SubstitutionList.cs
- EventBindingService.cs
- DashStyle.cs
- ProgressBarRenderer.cs
- GiveFeedbackEvent.cs
- MTConfigUtil.cs
- AutomationElementCollection.cs
- MessageQuerySet.cs
- SchemaConstraints.cs
- DocumentationServerProtocol.cs
- WebPartConnectionsConfigureVerb.cs
- FlowDocumentPage.cs
- PrintPreviewControl.cs
- EntityModelBuildProvider.cs
- LayoutUtils.cs
- DragStartedEventArgs.cs
- LocalizedNameDescriptionPair.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ParallelLoopState.cs
- WorkflowDefinitionContext.cs
- ListBindableAttribute.cs
- SQLInt16.cs
- DesignTimeParseData.cs
- SigningCredentials.cs
- Hashtable.cs
- ReadOnlyMetadataCollection.cs
- DesignerVerb.cs
- SHA512Cng.cs
- StringConcat.cs
- ReadWriteSpinLock.cs
- CorePropertiesFilter.cs
- ConstructorBuilder.cs
- ExpressionConverter.cs
- RuleSettingsCollection.cs
- MembershipPasswordException.cs
- TextProviderWrapper.cs