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
- KeyNotFoundException.cs
- DesignerTextBoxAdapter.cs
- PropertyGridCommands.cs
- ProtocolsInstallComponent.cs
- HwndAppCommandInputProvider.cs
- PageAdapter.cs
- Registry.cs
- XmlQueryType.cs
- OverrideMode.cs
- CompiledRegexRunnerFactory.cs
- StylusDevice.cs
- RequestSecurityTokenResponse.cs
- StateItem.cs
- Timeline.cs
- HtmlGenericControl.cs
- BindingListCollectionView.cs
- Pen.cs
- XmlSchemaCompilationSettings.cs
- StyleModeStack.cs
- ClientTargetCollection.cs
- UInt16Converter.cs
- BackgroundWorker.cs
- HttpHandlersSection.cs
- FormViewPagerRow.cs
- MatrixConverter.cs
- Trace.cs
- IdentityModelDictionary.cs
- BindingsCollection.cs
- ValueProviderWrapper.cs
- DateTimeFormat.cs
- DataGridColumn.cs
- CodeGen.cs
- CacheHelper.cs
- TCPListener.cs
- CrossAppDomainChannel.cs
- QuaternionRotation3D.cs
- TransactionProxy.cs
- AspProxy.cs
- ZipIORawDataFileBlock.cs
- __FastResourceComparer.cs
- ErrorFormatterPage.cs
- StorageEndPropertyMapping.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- DataGridViewControlCollection.cs
- ContextTokenTypeConverter.cs
- EmptyControlCollection.cs
- SpellerHighlightLayer.cs
- InvariantComparer.cs
- SystemException.cs
- _ListenerResponseStream.cs
- InkCanvasAutomationPeer.cs
- ToolStripDropDownClosedEventArgs.cs
- ObjectPersistData.cs
- CodeSubDirectoriesCollection.cs
- InvokeMethodActivityDesigner.cs
- BatchWriter.cs
- JapaneseCalendar.cs
- ObjectKeyFrameCollection.cs
- MetadataArtifactLoaderCompositeFile.cs
- HttpListenerException.cs
- TimeStampChecker.cs
- CompModSwitches.cs
- StringBuilder.cs
- MappingSource.cs
- InfoCardKeyedHashAlgorithm.cs
- PeerCustomResolverElement.cs
- CompoundFileReference.cs
- HtmlInputReset.cs
- WorkflowExecutor.cs
- CoTaskMemUnicodeSafeHandle.cs
- Vector3DAnimationUsingKeyFrames.cs
- TransportSecurityProtocolFactory.cs
- TextBlockAutomationPeer.cs
- SoapEnumAttribute.cs
- TagNameToTypeMapper.cs
- Baml2006ReaderContext.cs
- RectKeyFrameCollection.cs
- DataGridViewButtonCell.cs
- JoinTreeSlot.cs
- BitmapEditor.cs
- UnsafeNativeMethodsCLR.cs
- RemoteArgument.cs
- XmlText.cs
- ObjectDataSourceView.cs
- ComPlusDiagnosticTraceRecords.cs
- Stacktrace.cs
- ColorMap.cs
- ScriptingProfileServiceSection.cs
- ToolTipService.cs
- InputScopeConverter.cs
- DataListCommandEventArgs.cs
- InkCanvasAutomationPeer.cs
- PropertyTab.cs
- StylusPointPropertyId.cs
- HttpListenerElement.cs
- XmlAttribute.cs
- TabRenderer.cs
- Label.cs
- SeekableReadStream.cs
- ComplexLine.cs