Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / followingquery.cs / 1305376 / followingquery.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; internal sealed class FollowingQuery : BaseAxisQuery { private XPathNavigator input; private XPathNodeIterator iterator; public FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) {} private FollowingQuery(FollowingQuery other) : base(other) { this.input = Clone(other.input); this.iterator = Clone(other.iterator); } public override void Reset() { iterator = null; base.Reset(); } public override XPathNavigator Advance() { if (iterator == null) { input = qyInput.Advance(); if (input == null) { return null; } XPathNavigator prev; do { prev = input.Clone(); input = qyInput.Advance(); } while (prev.IsDescendant(input)); input = prev; iterator = XPathEmptyIterator.Instance; } while (! iterator.MoveNext()) { bool matchSelf; if (input.NodeType == XPathNodeType.Attribute || input.NodeType == XPathNodeType.Namespace) { input.MoveToParent(); matchSelf = false; } else { while (! input.MoveToNext()) { if (! input.MoveToParent()) { return null; } } matchSelf = true; } if (NameTest) { iterator = input.SelectDescendants(Name, Namespace, matchSelf); } else { iterator = input.SelectDescendants(TypeTest, matchSelf); } } position++; currentNode = iterator.Current; return currentNode; } public override XPathNodeIterator Clone() { return new FollowingQuery(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
- HttpListenerException.cs
- SqlUdtInfo.cs
- CompiledQueryCacheKey.cs
- TagMapInfo.cs
- MenuItemStyleCollection.cs
- ThreadPool.cs
- MemoryFailPoint.cs
- TextTreeInsertElementUndoUnit.cs
- DataSpaceManager.cs
- Figure.cs
- PropertyEmitterBase.cs
- LoginAutoFormat.cs
- CounterCreationData.cs
- ContainerControl.cs
- Page.cs
- GridViewEditEventArgs.cs
- EdmValidator.cs
- PartitionResolver.cs
- CodeFieldReferenceExpression.cs
- RtfToXamlLexer.cs
- _LocalDataStore.cs
- Nullable.cs
- DataKey.cs
- NextPreviousPagerField.cs
- Lease.cs
- ExceptionUtil.cs
- RuleSettingsCollection.cs
- UIPropertyMetadata.cs
- SecurityRequiresReviewAttribute.cs
- returneventsaver.cs
- ConsoleKeyInfo.cs
- DataObjectFieldAttribute.cs
- StreamUpdate.cs
- HttpPostedFile.cs
- ControlAdapter.cs
- DoubleAnimationBase.cs
- UnauthorizedWebPart.cs
- GeneralTransform2DTo3DTo2D.cs
- TreeNode.cs
- ObjectQueryState.cs
- FormViewPagerRow.cs
- RepeatBehaviorConverter.cs
- SourceSwitch.cs
- SelectionEditor.cs
- MailDefinition.cs
- PageParserFilter.cs
- ElementsClipboardData.cs
- DataServiceProviderWrapper.cs
- TextStore.cs
- HeaderUtility.cs
- TransactionChannel.cs
- NeutralResourcesLanguageAttribute.cs
- ITreeGenerator.cs
- InfoCardXmlSerializer.cs
- DataComponentNameHandler.cs
- Drawing.cs
- AliasGenerator.cs
- UIntPtr.cs
- RecognizerInfo.cs
- SessionSwitchEventArgs.cs
- DataExpression.cs
- ImageFormatConverter.cs
- Rect.cs
- KerberosRequestorSecurityToken.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- CustomAttributeSerializer.cs
- MethodCallExpression.cs
- EntitySqlQueryBuilder.cs
- FormatterConverter.cs
- DBSchemaTable.cs
- DocumentViewerBase.cs
- counter.cs
- QilFactory.cs
- IxmlLineInfo.cs
- SequenceFullException.cs
- PropertyDescriptor.cs
- BitmapFrameEncode.cs
- DataFormat.cs
- UrlMappingsSection.cs
- RemotingConfigParser.cs
- DBAsyncResult.cs
- StructuredTypeEmitter.cs
- SqlNodeAnnotation.cs
- AttributedMetaModel.cs
- ErasingStroke.cs
- SpeechSynthesizer.cs
- Message.cs
- CodeExpressionCollection.cs
- MediaElementAutomationPeer.cs
- ConnectionConsumerAttribute.cs
- mediaeventargs.cs
- Query.cs
- Codec.cs
- KeySpline.cs
- ObjectContextServiceProvider.cs
- ReadOnlyCollectionBase.cs
- HostingPreferredMapPath.cs
- GeneralTransform3D.cs
- MemberPathMap.cs
- StylusEventArgs.cs