Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- SplitContainerDesigner.cs
- EventManager.cs
- ParagraphResult.cs
- BinaryParser.cs
- MsmqTransportSecurity.cs
- EndOfStreamException.cs
- PathGeometry.cs
- ManagementNamedValueCollection.cs
- DownloadProgressEventArgs.cs
- Queue.cs
- ResourceManager.cs
- DefaultHttpHandler.cs
- Subordinate.cs
- SoapIgnoreAttribute.cs
- DummyDataSource.cs
- PluralizationService.cs
- ListViewGroupConverter.cs
- SqlDependency.cs
- SQLGuid.cs
- LiteralText.cs
- SerializationInfoEnumerator.cs
- TextEffectCollection.cs
- AdvancedBindingPropertyDescriptor.cs
- ListViewSortEventArgs.cs
- WSHttpBindingBase.cs
- NamedServiceModelExtensionCollectionElement.cs
- COM2TypeInfoProcessor.cs
- TextEditorThreadLocalStore.cs
- ImageSourceConverter.cs
- ComplexType.cs
- IteratorDescriptor.cs
- Lasso.cs
- BamlStream.cs
- CookieHandler.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- CryptoStream.cs
- FrameworkObject.cs
- DesignerTransaction.cs
- CodeDelegateCreateExpression.cs
- x509store.cs
- Comparer.cs
- CodeTypeReference.cs
- SelectedDatesCollection.cs
- Image.cs
- DesignerSerializationOptionsAttribute.cs
- XmlBinaryReader.cs
- DmlSqlGenerator.cs
- Function.cs
- DataSourceControl.cs
- PersonalizationProviderHelper.cs
- BitmapEffectInput.cs
- x509store.cs
- AuthenticatedStream.cs
- CodeExpressionStatement.cs
- DbException.cs
- Zone.cs
- MultilineStringConverter.cs
- KnownColorTable.cs
- MinimizableAttributeTypeConverter.cs
- QueryParameter.cs
- ProfileService.cs
- HtmlCommandAdapter.cs
- TypeConverterAttribute.cs
- InputLanguageProfileNotifySink.cs
- ToggleButtonAutomationPeer.cs
- InheritanceContextChangedEventManager.cs
- ChannelSinkStacks.cs
- JavaScriptObjectDeserializer.cs
- Stack.cs
- SelectionRange.cs
- FormsAuthenticationModule.cs
- PointCollection.cs
- CommunicationException.cs
- MULTI_QI.cs
- ParseHttpDate.cs
- WebServiceErrorEvent.cs
- DataGridBoolColumn.cs
- SqlInternalConnectionTds.cs
- FormView.cs
- UnknownBitmapEncoder.cs
- SelectionItemPattern.cs
- _NtlmClient.cs
- CollectionDataContract.cs
- HwndSubclass.cs
- RadioButton.cs
- DependencyObjectType.cs
- ComponentConverter.cs
- NullableDecimalMinMaxAggregationOperator.cs
- Hex.cs
- MemberHolder.cs
- VirtualizingStackPanel.cs
- SchemaTableColumn.cs
- IntegerValidator.cs
- Tokenizer.cs
- ScriptComponentDescriptor.cs
- CodeTypeParameterCollection.cs
- DiscoveryDocumentSearchPattern.cs
- TypeContext.cs
- ImageEditor.cs
- TrailingSpaceComparer.cs