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
- PresentationAppDomainManager.cs
- SelectingProviderEventArgs.cs
- Error.cs
- XmlSchemaComplexContent.cs
- Stream.cs
- MouseWheelEventArgs.cs
- OrderPreservingMergeHelper.cs
- DocumentXPathNavigator.cs
- Trigger.cs
- Publisher.cs
- BatchServiceHost.cs
- ConfigXmlSignificantWhitespace.cs
- EventPropertyMap.cs
- RegexCaptureCollection.cs
- Size.cs
- JsonUriDataContract.cs
- PerformanceCounterManager.cs
- OdbcError.cs
- WebPartPersonalization.cs
- RelationshipDetailsCollection.cs
- DataSourceDescriptorCollection.cs
- DbTypeMap.cs
- WebServiceErrorEvent.cs
- DiscardableAttribute.cs
- DriveInfo.cs
- GridViewColumnHeaderAutomationPeer.cs
- MultiSelectRootGridEntry.cs
- DirectoryLocalQuery.cs
- PTManager.cs
- GlyphManager.cs
- ValueOfAction.cs
- SqlDataSourceAdvancedOptionsForm.cs
- ProviderIncompatibleException.cs
- Visitors.cs
- DataRecordInfo.cs
- AutomationFocusChangedEventArgs.cs
- FrameworkElementFactoryMarkupObject.cs
- Timeline.cs
- RequestStatusBarUpdateEventArgs.cs
- WindowsGraphics2.cs
- LocatorPart.cs
- ColumnTypeConverter.cs
- SinglePageViewer.cs
- MdImport.cs
- BindableTemplateBuilder.cs
- WinEventHandler.cs
- ConfigurationValues.cs
- DSASignatureDeformatter.cs
- SchemaAttDef.cs
- GeneralTransform3DTo2D.cs
- SmtpNtlmAuthenticationModule.cs
- CleanUpVirtualizedItemEventArgs.cs
- XappLauncher.cs
- DictionaryContent.cs
- UserInitiatedNavigationPermission.cs
- SchemaElement.cs
- XPathBinder.cs
- MatcherBuilder.cs
- KnownIds.cs
- Trace.cs
- XpsFont.cs
- Single.cs
- RijndaelManaged.cs
- EtwTrace.cs
- FastPropertyAccessor.cs
- EntityCollectionChangedParams.cs
- TaiwanCalendar.cs
- NamedPipeConnectionPool.cs
- TabPageDesigner.cs
- FormViewModeEventArgs.cs
- AlternationConverter.cs
- SerialPinChanges.cs
- SqlConnectionHelper.cs
- TransformerTypeCollection.cs
- DiscoveryClientDuplexChannel.cs
- WebPartMenuStyle.cs
- InputLanguageCollection.cs
- WindowInteractionStateTracker.cs
- OdbcDataAdapter.cs
- PlatformNotSupportedException.cs
- Accessible.cs
- XmlSchemaAnnotation.cs
- WindowsSolidBrush.cs
- LocalClientSecuritySettingsElement.cs
- EventProviderWriter.cs
- GlyphInfoList.cs
- BaseCAMarshaler.cs
- CommonProperties.cs
- PatternMatchRules.cs
- URLBuilder.cs
- WindowsEditBoxRange.cs
- Encoder.cs
- SubpageParagraph.cs
- TagMapInfo.cs
- HttpRequestCacheValidator.cs
- RootBuilder.cs
- MsmqUri.cs
- PublishLicense.cs
- XmlAttributes.cs
- XmlTypeAttribute.cs