Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Stream.cs
- StrokeCollectionConverter.cs
- HashMembershipCondition.cs
- EdmTypeAttribute.cs
- SplitterEvent.cs
- ReferencedAssemblyResolver.cs
- ProxyHwnd.cs
- HtmlEmptyTagControlBuilder.cs
- ScrollBar.cs
- RepeatInfo.cs
- XPathMultyIterator.cs
- WindowsIPAddress.cs
- DataError.cs
- PnrpPermission.cs
- IndexingContentUnit.cs
- BevelBitmapEffect.cs
- Glyph.cs
- KerberosSecurityTokenAuthenticator.cs
- FileSystemWatcher.cs
- BCLDebug.cs
- ToolStripTextBox.cs
- OletxTransactionManager.cs
- TextSearch.cs
- MarkupExtensionReturnTypeAttribute.cs
- SqlCharStream.cs
- SchemaMerger.cs
- CellRelation.cs
- Int32CAMarshaler.cs
- MailMessage.cs
- ControlTemplate.cs
- SqlUDTStorage.cs
- SemanticKeyElement.cs
- SafeViewOfFileHandle.cs
- PropertyInfoSet.cs
- UriScheme.cs
- FontWeights.cs
- SortedList.cs
- DictationGrammar.cs
- NativeMethods.cs
- RelatedEnd.cs
- ConfigurationManagerInternal.cs
- XmlSchemaSimpleContentExtension.cs
- SqlCommandSet.cs
- ContextProperty.cs
- Propagator.cs
- SiteMapHierarchicalDataSourceView.cs
- WorkflowApplicationException.cs
- securitymgrsite.cs
- StrongTypingException.cs
- XmlException.cs
- FtpWebRequest.cs
- TimeSpanConverter.cs
- PartialCachingAttribute.cs
- DynamicPhysicalDiscoSearcher.cs
- RegistryConfigurationProvider.cs
- MimeFormReflector.cs
- GlobalizationSection.cs
- WindowsRebar.cs
- NetworkStream.cs
- TransactionManager.cs
- StylusButtonCollection.cs
- BitmapMetadata.cs
- Msec.cs
- PageStatePersister.cs
- Automation.cs
- ADRoleFactoryConfiguration.cs
- PeerCollaboration.cs
- __Error.cs
- Label.cs
- DecimalAnimation.cs
- RestHandlerFactory.cs
- SqlAliasesReferenced.cs
- UnknownBitmapEncoder.cs
- input.cs
- ChildrenQuery.cs
- ObservableCollectionDefaultValueFactory.cs
- RightsManagementPermission.cs
- SqlVisitor.cs
- Control.cs
- SchemaElementLookUpTable.cs
- SmtpReplyReaderFactory.cs
- SiteMapNodeItem.cs
- HttpBindingExtension.cs
- GcHandle.cs
- SQLBinary.cs
- TraceUtility.cs
- RequestUriProcessor.cs
- XPathAncestorIterator.cs
- PreservationFileReader.cs
- DynamicPropertyHolder.cs
- NegotiateStream.cs
- ProviderConnectionPoint.cs
- SQLBinaryStorage.cs
- ProjectionRewriter.cs
- XamlReaderHelper.cs
- EncodingFallbackAwareXmlTextWriter.cs
- UserMapPath.cs
- HttpModuleAction.cs
- HuffModule.cs
- RefreshPropertiesAttribute.cs