Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathDescendantIterator.cs / 1305376 / 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
- ControlOperationBehavior.cs
- ToolStripSeparatorRenderEventArgs.cs
- ContentIterators.cs
- CodeMethodMap.cs
- SecurityResources.cs
- hresults.cs
- BasicViewGenerator.cs
- TrackingServices.cs
- SelfSignedCertificate.cs
- NTAccount.cs
- KerberosTicketHashIdentifierClause.cs
- ListViewDeletedEventArgs.cs
- WebSysDefaultValueAttribute.cs
- HttpCookiesSection.cs
- SchemaMapping.cs
- Mutex.cs
- Padding.cs
- AddInAdapter.cs
- EventHandlersStore.cs
- EventDescriptorCollection.cs
- GatewayDefinition.cs
- EmptyStringExpandableObjectConverter.cs
- HwndKeyboardInputProvider.cs
- HwndAppCommandInputProvider.cs
- FileUtil.cs
- SatelliteContractVersionAttribute.cs
- HtmlForm.cs
- MemberMaps.cs
- HttpResponseInternalWrapper.cs
- MouseBinding.cs
- DBCommand.cs
- OrderedDictionaryStateHelper.cs
- RandomNumberGenerator.cs
- HttpResponseHeader.cs
- SetStateEventArgs.cs
- DataViewSetting.cs
- DetailsViewInsertEventArgs.cs
- NullRuntimeConfig.cs
- Mappings.cs
- XmlSequenceWriter.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- UpdateManifestForBrowserApplication.cs
- ProxyWebPart.cs
- TypedElement.cs
- Transform.cs
- TextDecorationCollection.cs
- TextModifier.cs
- UshortList2.cs
- Frame.cs
- TransportContext.cs
- WorkflowDurableInstance.cs
- BoundColumn.cs
- CompositeActivityTypeDescriptor.cs
- RepeatEnumerable.cs
- TreeNodeBinding.cs
- InheritanceContextChangedEventManager.cs
- FamilyTypeface.cs
- SwitchElementsCollection.cs
- ScriptServiceAttribute.cs
- ProxyFragment.cs
- ToolStripSeparator.cs
- DoubleLinkListEnumerator.cs
- CodeMethodReturnStatement.cs
- Module.cs
- Clock.cs
- ConstraintStruct.cs
- Visitors.cs
- LayoutTable.cs
- PreviewKeyDownEventArgs.cs
- VirtualPath.cs
- AuthenticationService.cs
- BufferedGraphicsContext.cs
- XMLSchema.cs
- dsa.cs
- XmlCharCheckingWriter.cs
- XmlIgnoreAttribute.cs
- StyleCollection.cs
- LinqDataSourceInsertEventArgs.cs
- FormViewUpdateEventArgs.cs
- StoreContentChangedEventArgs.cs
- InputLanguageManager.cs
- ToolZone.cs
- ContextMenuStripGroupCollection.cs
- SecurityStateEncoder.cs
- _ProxyRegBlob.cs
- AssemblyCache.cs
- LinqDataSourceContextEventArgs.cs
- ButtonChrome.cs
- NeutralResourcesLanguageAttribute.cs
- EntitySetDataBindingList.cs
- XomlCompilerHelpers.cs
- EventRecord.cs
- Transform3DGroup.cs
- _CookieModule.cs
- PriorityQueue.cs
- AuthorizationRule.cs
- UdpSocketReceiveManager.cs
- HtmlControlPersistable.cs
- DesignerTextBoxAdapter.cs
- TextFragmentEngine.cs