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
- ToolStripDropTargetManager.cs
- ContentPlaceHolder.cs
- HttpInputStream.cs
- WebPartTransformerCollection.cs
- DeferredElementTreeState.cs
- DataSourceUtil.cs
- CodeGroup.cs
- StatusBarDrawItemEvent.cs
- SchemaType.cs
- PipelineModuleStepContainer.cs
- Bind.cs
- ObjectAnimationUsingKeyFrames.cs
- CustomErrorCollection.cs
- TraceHandlerErrorFormatter.cs
- X509SecurityTokenProvider.cs
- StrokeCollection.cs
- DefaultTextStore.cs
- TreeNode.cs
- DriveInfo.cs
- SQLBoolean.cs
- BridgeDataRecord.cs
- QilExpression.cs
- Int16Animation.cs
- HtmlInputPassword.cs
- TagPrefixCollection.cs
- GorillaCodec.cs
- HtmlElement.cs
- CodeAttributeArgumentCollection.cs
- LineProperties.cs
- XmlILAnnotation.cs
- FixedSOMTextRun.cs
- EraserBehavior.cs
- SmtpReplyReaderFactory.cs
- HttpRuntimeSection.cs
- _NetRes.cs
- MemberRestriction.cs
- TableSectionStyle.cs
- ColumnMapVisitor.cs
- FreezableDefaultValueFactory.cs
- TreeNodeCollectionEditor.cs
- ClassicBorderDecorator.cs
- ContentPlaceHolder.cs
- PropertyMetadata.cs
- SHA256Managed.cs
- SchemaCollectionCompiler.cs
- DrawingContextWalker.cs
- ContainerFilterService.cs
- StringExpressionSet.cs
- RubberbandSelector.cs
- SiteMap.cs
- Pair.cs
- DataRowComparer.cs
- RoleBoolean.cs
- RoutedEventHandlerInfo.cs
- HashAlgorithm.cs
- RijndaelManaged.cs
- SendContent.cs
- RuntimeConfig.cs
- XmlCollation.cs
- TextRenderer.cs
- MsmqMessageProperty.cs
- XPathMultyIterator.cs
- DeleteIndexBinder.cs
- DataGridClipboardHelper.cs
- MailDefinition.cs
- SchemaImporter.cs
- UInt16Storage.cs
- CompositeKey.cs
- TypeResolver.cs
- UnsafeNativeMethods.cs
- ListenerTraceUtility.cs
- WindowsGraphics2.cs
- DtrList.cs
- RetrieveVirtualItemEventArgs.cs
- ListenerElementsCollection.cs
- SqlComparer.cs
- SiteMapDataSource.cs
- SmtpReplyReader.cs
- TraceLog.cs
- WebBodyFormatMessageProperty.cs
- shaper.cs
- AssemblyCollection.cs
- AssociationSetMetadata.cs
- CachingHintValidation.cs
- PropertyMapper.cs
- MailMessage.cs
- Range.cs
- ConstrainedGroup.cs
- Binding.cs
- MultiDataTrigger.cs
- Evidence.cs
- _ConnectionGroup.cs
- ValidatorCollection.cs
- FileDialogPermission.cs
- odbcmetadatacollectionnames.cs
- DecoderReplacementFallback.cs
- XmlILStorageConverter.cs
- Int16Storage.cs
- Point4DValueSerializer.cs
- FileDataSourceCache.cs