Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
- ThemeInfoAttribute.cs
- ContainerFilterService.cs
- PassportPrincipal.cs
- HwndSourceKeyboardInputSite.cs
- ThaiBuddhistCalendar.cs
- FlatButtonAppearance.cs
- DigitShape.cs
- Trace.cs
- GridViewEditEventArgs.cs
- DataBoundControlAdapter.cs
- WorkflowOperationContext.cs
- SoapSchemaImporter.cs
- HttpHandlerAction.cs
- MetadataArtifactLoaderCompositeResource.cs
- EntityDataSourceSelectedEventArgs.cs
- _LazyAsyncResult.cs
- Int64Storage.cs
- UIPropertyMetadata.cs
- DoWorkEventArgs.cs
- Atom10FormatterFactory.cs
- Rfc4050KeyFormatter.cs
- ButtonFieldBase.cs
- DataGridViewAccessibleObject.cs
- Connector.cs
- GridViewCellAutomationPeer.cs
- AspNetSynchronizationContext.cs
- ReceiveActivity.cs
- CodeTypeOfExpression.cs
- BigIntegerStorage.cs
- MultiView.cs
- SystemIcmpV4Statistics.cs
- OdbcConnectionFactory.cs
- XPathBinder.cs
- XmlReflectionImporter.cs
- serverconfig.cs
- XmlSchemaValidator.cs
- DataGridViewRowPrePaintEventArgs.cs
- TcpHostedTransportConfiguration.cs
- PinnedBufferMemoryStream.cs
- RijndaelManaged.cs
- XPathNodeInfoAtom.cs
- TimeSpanSecondsConverter.cs
- DataKeyCollection.cs
- GetPageNumberCompletedEventArgs.cs
- PlainXmlWriter.cs
- SignerInfo.cs
- CheckBox.cs
- PointUtil.cs
- CodeTypeParameter.cs
- TypefaceCollection.cs
- LinearKeyFrames.cs
- PointCollection.cs
- LogStore.cs
- ProjectionQueryOptionExpression.cs
- TemplateEditingFrame.cs
- ServiceOperationListItem.cs
- EntityDataSourceViewSchema.cs
- MetafileHeader.cs
- PenThread.cs
- DynamicUpdateCommand.cs
- CustomLineCap.cs
- TimeSpanValidator.cs
- GridViewActionList.cs
- UnitControl.cs
- IsolatedStorageFilePermission.cs
- SizeFConverter.cs
- NTAccount.cs
- ToolStripArrowRenderEventArgs.cs
- ByteStack.cs
- DataSourceHelper.cs
- HttpProfileBase.cs
- BooleanExpr.cs
- EventsTab.cs
- UserControl.cs
- TextBounds.cs
- ToolStripSystemRenderer.cs
- FixedPage.cs
- EmptyQuery.cs
- CryptoSession.cs
- StringArrayEditor.cs
- Byte.cs
- PrimitiveType.cs
- XpsFont.cs
- LocatorPartList.cs
- LineBreakRecord.cs
- StreamingContext.cs
- ObjectToIdCache.cs
- Attribute.cs
- ConfigXmlWhitespace.cs
- WebPartMenu.cs
- SerTrace.cs
- SingleSelectRootGridEntry.cs
- Stream.cs
- EmissiveMaterial.cs
- SqlDataSourceView.cs
- PolicyStatement.cs
- VisualTarget.cs
- GridViewCommandEventArgs.cs
- PropertyInformation.cs
- SchemaTypeEmitter.cs