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
- ToolStripSeparatorRenderEventArgs.cs
- ActivityFunc.cs
- CacheRequest.cs
- DataGridViewRowPostPaintEventArgs.cs
- Token.cs
- QueryPageSettingsEventArgs.cs
- SharedConnectionWorkflowTransactionService.cs
- TryCatch.cs
- FrameworkContentElement.cs
- KeyNotFoundException.cs
- HtmlImageAdapter.cs
- ConfigurationStrings.cs
- DragAssistanceManager.cs
- XPathItem.cs
- TransformerInfo.cs
- HttpListener.cs
- TemplateControlParser.cs
- DoubleUtil.cs
- PixelFormatConverter.cs
- DefaultProxySection.cs
- QilParameter.cs
- ServiceAuthorizationElement.cs
- FixedTextView.cs
- WindowsGrip.cs
- Codec.cs
- _NativeSSPI.cs
- Win32Exception.cs
- HttpStreamMessage.cs
- FileUtil.cs
- BindingExpressionUncommonField.cs
- StringOutput.cs
- PathStreamGeometryContext.cs
- FaultReasonText.cs
- WebRequest.cs
- CacheMemory.cs
- SecurityHeaderElementInferenceEngine.cs
- DatatypeImplementation.cs
- QueryCacheEntry.cs
- BinaryReader.cs
- CurrentChangingEventManager.cs
- TryExpression.cs
- WebPartTracker.cs
- VectorCollectionConverter.cs
- Polyline.cs
- InvokeProviderWrapper.cs
- HttpHeaderCollection.cs
- TemplatePropertyEntry.cs
- StackSpiller.Generated.cs
- RadialGradientBrush.cs
- ProfileService.cs
- MemoryPressure.cs
- DeferredTextReference.cs
- ListBox.cs
- XmlException.cs
- XsltLoader.cs
- TextView.cs
- Imaging.cs
- ConfigurationPropertyAttribute.cs
- CodeTypeParameterCollection.cs
- ControlEvent.cs
- GridViewRowPresenterBase.cs
- ListenerConfig.cs
- OleDbConnection.cs
- System.Data.OracleClient_BID.cs
- unsafeIndexingFilterStream.cs
- FormViewUpdateEventArgs.cs
- DeviceOverridableAttribute.cs
- counter.cs
- TypedElement.cs
- AutoSizeToolBoxItem.cs
- ContentDisposition.cs
- IndentedWriter.cs
- BufferModeSettings.cs
- nulltextcontainer.cs
- ObjectParameterCollection.cs
- ManagementObjectCollection.cs
- log.cs
- ConsoleKeyInfo.cs
- HandleValueEditor.cs
- DebugInfoGenerator.cs
- TraceRecord.cs
- WebZone.cs
- EndpointAddress.cs
- FontNameConverter.cs
- XmlTextAttribute.cs
- EventHandlerList.cs
- List.cs
- ResizeGrip.cs
- EllipseGeometry.cs
- x509utils.cs
- TextBlock.cs
- FamilyCollection.cs
- TableLayout.cs
- BigInt.cs
- OutputCacheModule.cs
- RoleExceptions.cs
- Header.cs
- Expression.cs
- InternalConfigSettingsFactory.cs
- WebPartManagerDesigner.cs