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
- XmlDataSourceView.cs
- Literal.cs
- RunInstallerAttribute.cs
- SpoolingTask.cs
- ServiceNameCollection.cs
- ManipulationDevice.cs
- ConditionCollection.cs
- WebPartAddingEventArgs.cs
- ProviderConnectionPointCollection.cs
- precedingquery.cs
- FunctionMappingTranslator.cs
- XPathNodeHelper.cs
- FixedTextPointer.cs
- HtmlLink.cs
- HttpPostServerProtocol.cs
- CalloutQueueItem.cs
- SimpleTextLine.cs
- EpmSourcePathSegment.cs
- TableSectionStyle.cs
- DesignerMetadata.cs
- DocumentPageHost.cs
- SqlDataSourceConnectionPanel.cs
- XamlStream.cs
- ACL.cs
- DbUpdateCommandTree.cs
- CodeDomSerializationProvider.cs
- OdbcUtils.cs
- SamlDelegatingWriter.cs
- XmlObjectSerializerWriteContextComplex.cs
- XmlReaderSettings.cs
- TransformValueSerializer.cs
- TextProperties.cs
- KnownAssemblyEntry.cs
- TrustLevel.cs
- LocalFileSettingsProvider.cs
- Dump.cs
- UIElement3D.cs
- SerializerWriterEventHandlers.cs
- TextServicesCompartmentContext.cs
- BindingElement.cs
- SafeNativeMethods.cs
- TextTreeUndo.cs
- CounterCreationDataCollection.cs
- ZoneMembershipCondition.cs
- _ProxyChain.cs
- FileUpload.cs
- HandlerBase.cs
- RequiredAttributeAttribute.cs
- EntityDataReader.cs
- AnnotationMap.cs
- OrthographicCamera.cs
- Math.cs
- ReturnType.cs
- InvalidTimeZoneException.cs
- OdbcEnvironmentHandle.cs
- InstanceKey.cs
- DataReceivedEventArgs.cs
- TemplateKey.cs
- Handle.cs
- PeerObject.cs
- Win32.cs
- ContainerParaClient.cs
- StrokeNode.cs
- ColorDialog.cs
- DataListDesigner.cs
- PreviewKeyDownEventArgs.cs
- metadatamappinghashervisitor.cs
- ContainerFilterService.cs
- CodeCompiler.cs
- TreeViewImageGenerator.cs
- LoadMessageLogger.cs
- ReadContentAsBinaryHelper.cs
- Part.cs
- CheckPair.cs
- DesignerAttribute.cs
- CustomValidator.cs
- TcpClientSocketManager.cs
- ClipboardData.cs
- TopClause.cs
- LightweightCodeGenerator.cs
- MatrixTransform3D.cs
- ReliableMessagingVersionConverter.cs
- MatrixTransform3D.cs
- WebConfigurationHost.cs
- ResourcePermissionBase.cs
- ListView.cs
- ProfileSettingsCollection.cs
- Query.cs
- RijndaelManagedTransform.cs
- TextWriter.cs
- PropertyOverridesDialog.cs
- SecurityHelper.cs
- Errors.cs
- ChangePassword.cs
- IndexedString.cs
- Events.cs
- SHA1.cs
- PersonalizationAdministration.cs
- XmlSecureResolver.cs
- DateTimeFormatInfo.cs