Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathDescendantIterator.cs / 1 / XPathDescendantIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System.Xml.XPath; internal class XPathDescendantIterator: XPathAxisIterator { private int level = 0; public XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {} public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {} public XPathDescendantIterator(XPathDescendantIterator it) : base(it) { this.level = it.level; } public override XPathNodeIterator Clone() { return new XPathDescendantIterator(this); } public override bool MoveNext() { if (first) { first = false; if (matchSelf && Matches) { position = 1; return true; } } while (true) { if (nav.MoveToFirstChild()) { level++; } else { while (true) { if (level == 0) { return false; } if (nav.MoveToNext()) { break; } nav.MoveToParent(); level--; } } if (Matches) { position++; return true; } } } } } // 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
- HttpModuleCollection.cs
- SmtpNetworkElement.cs
- MetafileHeaderWmf.cs
- XmlSchemaSimpleContentRestriction.cs
- RouteParser.cs
- TypefaceMap.cs
- ClientBuildManagerCallback.cs
- SamlAssertionKeyIdentifierClause.cs
- Vector3DAnimationUsingKeyFrames.cs
- SymLanguageType.cs
- GPPOINTF.cs
- OrderablePartitioner.cs
- Panel.cs
- TcpServerChannel.cs
- KeyTime.cs
- XPathNodeIterator.cs
- EventDescriptor.cs
- CommandField.cs
- UserControlBuildProvider.cs
- SeekStoryboard.cs
- DocumentViewerAutomationPeer.cs
- ColumnMapCopier.cs
- XPathNodeHelper.cs
- KeyEventArgs.cs
- ObjectStateEntry.cs
- SkinBuilder.cs
- SqlConnectionPoolProviderInfo.cs
- SoapFormatter.cs
- LogicalExpr.cs
- ObservableDictionary.cs
- DataPagerCommandEventArgs.cs
- IndexerNameAttribute.cs
- CheckBox.cs
- XmlIlGenerator.cs
- TraceHandlerErrorFormatter.cs
- DataGridViewCellValidatingEventArgs.cs
- CompilerCollection.cs
- PackWebRequestFactory.cs
- COM2ColorConverter.cs
- ContainerControlDesigner.cs
- PseudoWebRequest.cs
- TemplateBamlTreeBuilder.cs
- DataGridViewCellValueEventArgs.cs
- EntityDataSourceWrapper.cs
- XmlSerializationGeneratedCode.cs
- DataGridTextBox.cs
- FileNotFoundException.cs
- ParameterInfo.cs
- codemethodreferenceexpression.cs
- BitArray.cs
- ChtmlCalendarAdapter.cs
- TheQuery.cs
- FirewallWrapper.cs
- InputProcessorProfiles.cs
- CacheEntry.cs
- Int32AnimationBase.cs
- DiffuseMaterial.cs
- InputMethod.cs
- CookieHandler.cs
- View.cs
- Memoizer.cs
- MimeObjectFactory.cs
- MemoryFailPoint.cs
- EventEntry.cs
- SBCSCodePageEncoding.cs
- SecondaryIndexDefinition.cs
- OdbcStatementHandle.cs
- Panel.cs
- CodeMemberMethod.cs
- GradientBrush.cs
- XmlSerializationReader.cs
- COM2Properties.cs
- HttpErrorTraceRecord.cs
- LinqDataSourceHelper.cs
- LoadWorkflowCommand.cs
- HtmlInputSubmit.cs
- EditorServiceContext.cs
- ComponentResourceKey.cs
- SHA1CryptoServiceProvider.cs
- ActivityWithResultWrapper.cs
- RefreshPropertiesAttribute.cs
- InstanceStore.cs
- SizeConverter.cs
- ElementAction.cs
- ConfigXmlReader.cs
- PersonalizationDictionary.cs
- LinqDataSourceContextData.cs
- EncryptedReference.cs
- CollectionViewSource.cs
- PartManifestEntry.cs
- UpdatePanelTriggerCollection.cs
- DeclarativeCatalogPart.cs
- CheckBoxFlatAdapter.cs
- HtmlHistory.cs
- CheckBoxDesigner.cs
- PropertyStore.cs
- XmlImplementation.cs
- SchemaImporterExtension.cs
- ByteConverter.cs
- GridEntry.cs