Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //[....] //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BaseValidator.cs
- EndpointDispatcherTable.cs
- RSAPKCS1KeyExchangeFormatter.cs
- MultiTouchSystemGestureLogic.cs
- AudioFormatConverter.cs
- EmbeddedMailObjectCollectionEditor.cs
- _NTAuthentication.cs
- printdlgexmarshaler.cs
- OleDbSchemaGuid.cs
- RemotingAttributes.cs
- TypeNameHelper.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- ToolbarAUtomationPeer.cs
- EventMap.cs
- PagerSettings.cs
- CodeConstructor.cs
- SessionState.cs
- PolyLineSegmentFigureLogic.cs
- _NTAuthentication.cs
- DataGridViewCellLinkedList.cs
- ContourSegment.cs
- TraceData.cs
- DrawListViewItemEventArgs.cs
- SqlCaseSimplifier.cs
- CodeDomSerializer.cs
- Types.cs
- ValidatorUtils.cs
- TreeNodeMouseHoverEvent.cs
- DesignerVerbCollection.cs
- InArgument.cs
- SoapSchemaMember.cs
- ListenerAdaptersInstallComponent.cs
- _DisconnectOverlappedAsyncResult.cs
- WebContentFormatHelper.cs
- ServicesUtilities.cs
- TextTreePropertyUndoUnit.cs
- SqlRemoveConstantOrderBy.cs
- validation.cs
- ClientApiGenerator.cs
- InputGestureCollection.cs
- RequestCacheManager.cs
- TypedElement.cs
- ProcessMonitor.cs
- RawUIStateInputReport.cs
- EntitySetDataBindingList.cs
- VirtualPathUtility.cs
- HostedElements.cs
- FlowSwitchLink.cs
- DrawToolTipEventArgs.cs
- SevenBitStream.cs
- ScrollProviderWrapper.cs
- _OSSOCK.cs
- ParameterCollection.cs
- SplayTreeNode.cs
- ApplicationSecurityManager.cs
- SapiRecoContext.cs
- _ListenerRequestStream.cs
- RequestCachePolicyConverter.cs
- ParseNumbers.cs
- ZipIOLocalFileDataDescriptor.cs
- OdbcConnectionOpen.cs
- GraphicsPath.cs
- DictionarySectionHandler.cs
- StringExpressionSet.cs
- OracleConnectionFactory.cs
- X509SecurityToken.cs
- SamlSecurityToken.cs
- ItemsControlAutomationPeer.cs
- LedgerEntryCollection.cs
- SoapObjectReader.cs
- SortFieldComparer.cs
- ActivityExecutorOperation.cs
- OperationAbortedException.cs
- Single.cs
- WpfMemberInvoker.cs
- CompModSwitches.cs
- Camera.cs
- PrimaryKeyTypeConverter.cs
- DbProviderManifest.cs
- SystemIcons.cs
- ThreadAttributes.cs
- SerializerProvider.cs
- ServiceNameElementCollection.cs
- ProtocolsSection.cs
- DockPattern.cs
- IndexedString.cs
- Vertex.cs
- SizeKeyFrameCollection.cs
- Form.cs
- AuthorizationPolicyTypeElementCollection.cs
- OleDbErrorCollection.cs
- PhoneCallDesigner.cs
- IItemProperties.cs
- GregorianCalendarHelper.cs
- ValueConversionAttribute.cs
- ItemDragEvent.cs
- CapabilitiesSection.cs
- XmlUtf8RawTextWriter.cs
- ZoneMembershipCondition.cs
- SymbolPair.cs