Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //----------------------------------------------------------------------------- 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
- RegexWorker.cs
- CapabilitiesUse.cs
- AddInIpcChannel.cs
- SqlNodeAnnotations.cs
- StylusPointPropertyInfoDefaults.cs
- PrintPreviewGraphics.cs
- X509Certificate.cs
- DataServiceClientException.cs
- RequestCachePolicyConverter.cs
- XsltContext.cs
- Point4D.cs
- FontClient.cs
- MessageFault.cs
- KeyInterop.cs
- CmsUtils.cs
- GlyphRunDrawing.cs
- AssemblyInfo.cs
- ComponentManagerBroker.cs
- DesignerAdRotatorAdapter.cs
- HostedTcpTransportManager.cs
- AbsoluteQuery.cs
- PriorityBindingExpression.cs
- RuleSettings.cs
- ContextInformation.cs
- AbandonedMutexException.cs
- ProfileParameter.cs
- TextPointer.cs
- ExtenderHelpers.cs
- _DigestClient.cs
- DesignerOptionService.cs
- HttpCapabilitiesSectionHandler.cs
- RelativeSource.cs
- RegistrySecurity.cs
- SizeValueSerializer.cs
- ResourceDictionaryCollection.cs
- AxHost.cs
- ToolStripProgressBar.cs
- KeyedHashAlgorithm.cs
- ValidationErrorEventArgs.cs
- InvokePatternIdentifiers.cs
- TextCharacters.cs
- CodeTypeReferenceCollection.cs
- MeshGeometry3D.cs
- InputProcessorProfilesLoader.cs
- MetadataArtifactLoaderFile.cs
- BufferAllocator.cs
- SmtpMail.cs
- DrawingImage.cs
- ObjectAnimationBase.cs
- WebPartTransformerCollection.cs
- FileSystemEventArgs.cs
- XmlSchemaAnnotated.cs
- MultipleViewPattern.cs
- EntityContainerEmitter.cs
- ExpressionLink.cs
- ParameterReplacerVisitor.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- RoutedEvent.cs
- DataTableMapping.cs
- OneWayBindingElement.cs
- ComplexType.cs
- RuntimeIdentifierPropertyAttribute.cs
- TailCallAnalyzer.cs
- DataService.cs
- ListMarkerLine.cs
- PersonalizableTypeEntry.cs
- StrongNameMembershipCondition.cs
- SoapFaultCodes.cs
- DesignerMetadata.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- ClickablePoint.cs
- ModelItemDictionaryImpl.cs
- _TransmitFileOverlappedAsyncResult.cs
- FixedDocument.cs
- Object.cs
- VarInfo.cs
- AppDomainInstanceProvider.cs
- DebugHandleTracker.cs
- XamlReaderHelper.cs
- DataSourceXmlSerializationAttribute.cs
- SendMailErrorEventArgs.cs
- IssuedTokenClientElement.cs
- ArrayWithOffset.cs
- RegexTree.cs
- BuildProvider.cs
- HtmlUtf8RawTextWriter.cs
- BaseTemplatedMobileComponentEditor.cs
- FeatureSupport.cs
- DataRowCollection.cs
- SequenceFullException.cs
- StylusLogic.cs
- OutputCacheSettingsSection.cs
- EntryPointNotFoundException.cs
- Int32CollectionConverter.cs
- XmlWrappingReader.cs
- FixedFlowMap.cs
- GcSettings.cs
- ExtendedPropertyCollection.cs
- HitTestParameters.cs
- Symbol.cs