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
- GridViewDeletedEventArgs.cs
- VisualCollection.cs
- XmlAutoDetectWriter.cs
- InvalidCommandTreeException.cs
- RoutedPropertyChangedEventArgs.cs
- ImmutableCollection.cs
- FindSimilarActivitiesVerb.cs
- AnnotationMap.cs
- XmlDocumentType.cs
- StdValidatorsAndConverters.cs
- IntegrationExceptionEventArgs.cs
- Track.cs
- ArcSegment.cs
- TraceContextEventArgs.cs
- TableRow.cs
- SecurityDocument.cs
- hwndwrapper.cs
- MessageEncoderFactory.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- QilInvoke.cs
- SmiMetaData.cs
- FontFamilyConverter.cs
- ValidationHelper.cs
- InternalResources.cs
- BindStream.cs
- SQLCharsStorage.cs
- DomainUpDown.cs
- Menu.cs
- NumberFunctions.cs
- EntityDataSourceWizardForm.cs
- LoginCancelEventArgs.cs
- ImageListUtils.cs
- TypeElement.cs
- SettingsBase.cs
- SplashScreen.cs
- EndpointFilterProvider.cs
- ReverseComparer.cs
- XsltSettings.cs
- ComponentRenameEvent.cs
- NoneExcludedImageIndexConverter.cs
- ItemCollection.cs
- mediaeventshelper.cs
- FactoryId.cs
- DataGridViewHitTestInfo.cs
- ReaderWriterLockWrapper.cs
- XmlLoader.cs
- LocationChangedEventArgs.cs
- TimeoutValidationAttribute.cs
- RTLAwareMessageBox.cs
- ProcessInfo.cs
- GAC.cs
- FtpRequestCacheValidator.cs
- View.cs
- sapiproxy.cs
- DecoderBestFitFallback.cs
- RadioButtonPopupAdapter.cs
- JsonServiceDocumentSerializer.cs
- LogReserveAndAppendState.cs
- XmlSchemaSimpleTypeRestriction.cs
- CalendarDataBindingHandler.cs
- PointF.cs
- _NestedSingleAsyncResult.cs
- RuntimeEnvironment.cs
- UriExt.cs
- PageAsyncTask.cs
- EntityContainerAssociationSetEnd.cs
- XmlResolver.cs
- ComAdminWrapper.cs
- ColumnTypeConverter.cs
- XmlSchemaImporter.cs
- ProtocolsConfiguration.cs
- IChannel.cs
- CryptoKeySecurity.cs
- Listbox.cs
- SemanticValue.cs
- BitmapEffectGroup.cs
- MetadataItem.cs
- PropertyNames.cs
- StructuralType.cs
- AppDomainProtocolHandler.cs
- WorkflowDesignerMessageFilter.cs
- XamlFigureLengthSerializer.cs
- JsonWriter.cs
- FilteredAttributeCollection.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- IisTraceListener.cs
- PassportPrincipal.cs
- RoleBoolean.cs
- TextHidden.cs
- HttpHandlersSection.cs
- HandlerWithFactory.cs
- ImmutableObjectAttribute.cs
- ObjectDataSourceMethodEventArgs.cs
- WebBrowser.cs
- ContentPosition.cs
- WebRequestModuleElement.cs
- ClientProtocol.cs
- FileAuthorizationModule.cs
- XmlSchemaComplexContentRestriction.cs
- SafeNativeMethods.cs