Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / followingquery.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigurationPermission.cs
- ValuePattern.cs
- WindowsSysHeader.cs
- ArraySubsetEnumerator.cs
- Image.cs
- TypeLibConverter.cs
- FuncCompletionCallbackWrapper.cs
- OrderedDictionaryStateHelper.cs
- DoubleAnimationUsingPath.cs
- CacheSection.cs
- DataGridViewHitTestInfo.cs
- OutputCacheSettings.cs
- HttpBrowserCapabilitiesBase.cs
- SqlProcedureAttribute.cs
- XPathNavigatorKeyComparer.cs
- ControlParameter.cs
- RequestDescription.cs
- DataServicePagingProviderWrapper.cs
- ControlAdapter.cs
- QueryPageSettingsEventArgs.cs
- ColumnMap.cs
- KnownTypesHelper.cs
- ListView.cs
- ProfileService.cs
- DataControlImageButton.cs
- InputEventArgs.cs
- SqlInfoMessageEvent.cs
- ParseChildrenAsPropertiesAttribute.cs
- Typeface.cs
- AdornerLayer.cs
- DivideByZeroException.cs
- EditorBrowsableAttribute.cs
- ReferenceTypeElement.cs
- ClientConfigurationSystem.cs
- EntityContainerAssociationSetEnd.cs
- StreamGeometry.cs
- StrokeCollectionConverter.cs
- XmlSchema.cs
- KeyValueConfigurationCollection.cs
- Int32CollectionConverter.cs
- cryptoapiTransform.cs
- OleDbMetaDataFactory.cs
- XPathExpr.cs
- StorageAssociationTypeMapping.cs
- CompletionProxy.cs
- GenericWebPart.cs
- ViewManager.cs
- ZeroOpNode.cs
- GPRECTF.cs
- Identifier.cs
- PhysicalOps.cs
- HtmlInputReset.cs
- ObjectViewEntityCollectionData.cs
- FullTextBreakpoint.cs
- Int32Animation.cs
- SQLInt32Storage.cs
- TraceListener.cs
- ExpressionBindingsDialog.cs
- PortCache.cs
- DesignColumn.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- TextWriter.cs
- QueryStringHandler.cs
- HostingEnvironment.cs
- VSWCFServiceContractGenerator.cs
- SeverityFilter.cs
- Stacktrace.cs
- DataBoundControl.cs
- DtdParser.cs
- CodeCommentStatementCollection.cs
- ProcessManager.cs
- AffineTransform3D.cs
- PeerHopCountAttribute.cs
- StyleCollection.cs
- ListViewGroup.cs
- Site.cs
- XmlDocumentSerializer.cs
- ApplicationDirectoryMembershipCondition.cs
- OptimalBreakSession.cs
- DecimalAnimation.cs
- OutputCacheProfileCollection.cs
- Array.cs
- CodePageUtils.cs
- AsymmetricSignatureFormatter.cs
- SEHException.cs
- CompressedStack.cs
- ExpressionVisitor.cs
- ITextView.cs
- FixedDocument.cs
- HasCopySemanticsAttribute.cs
- MultiByteCodec.cs
- ItemsControlAutomationPeer.cs
- CollectionViewGroup.cs
- _TLSstream.cs
- RenderCapability.cs
- XmlNamespaceMapping.cs
- HttpConfigurationContext.cs
- PageAdapter.cs
- BooleanFunctions.cs
- Shared.cs