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
- _AutoWebProxyScriptHelper.cs
- FormViewModeEventArgs.cs
- MailDefinition.cs
- SmiGettersStream.cs
- ClientCultureInfo.cs
- CaseKeyBox.ViewModel.cs
- CatalogPartCollection.cs
- CipherData.cs
- CompositeCollectionView.cs
- SerialPinChanges.cs
- Fx.cs
- InputMethodStateTypeInfo.cs
- LassoHelper.cs
- PropertyEmitterBase.cs
- PersonalizationStateInfo.cs
- MobileListItem.cs
- HttpCookie.cs
- App.cs
- FolderBrowserDialog.cs
- XpsFixedPageReaderWriter.cs
- GeometryCollection.cs
- WindowsTreeView.cs
- XmlRootAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- ObfuscationAttribute.cs
- GenericRootAutomationPeer.cs
- SymDocumentType.cs
- WarningException.cs
- FixedSOMPage.cs
- SslStream.cs
- ConsoleCancelEventArgs.cs
- HyperLinkStyle.cs
- OperandQuery.cs
- ILGen.cs
- CacheEntry.cs
- PolyQuadraticBezierSegment.cs
- SiteMapNode.cs
- SendMailErrorEventArgs.cs
- ComponentEditorForm.cs
- TextBoxBase.cs
- CurrencyManager.cs
- VariableQuery.cs
- AuthenticodeSignatureInformation.cs
- NetworkInformationPermission.cs
- ClientConvert.cs
- Condition.cs
- CanonicalXml.cs
- NamedElement.cs
- LocationSectionRecord.cs
- AnimationLayer.cs
- ConfigXmlWhitespace.cs
- GenericAuthenticationEventArgs.cs
- DiscoveryExceptionDictionary.cs
- CommandField.cs
- XmlILStorageConverter.cs
- Keywords.cs
- ImageSource.cs
- PropertyGridCommands.cs
- LinkedList.cs
- VirtualDirectoryMapping.cs
- InputGestureCollection.cs
- StylusEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs
- DataGridItemAttachedStorage.cs
- ThreadStaticAttribute.cs
- DesignerVerb.cs
- EntityContainerRelationshipSetEnd.cs
- TextPointerBase.cs
- BooleanKeyFrameCollection.cs
- DeferredElementTreeState.cs
- SqlProcedureAttribute.cs
- UserPreferenceChangingEventArgs.cs
- DrawingBrush.cs
- TreeNodeBindingCollection.cs
- FlowPosition.cs
- ActivityExecutionContext.cs
- ToolStripActionList.cs
- ManifestSignatureInformation.cs
- ProjectedSlot.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- WindowsStartMenu.cs
- DictionaryContent.cs
- Paragraph.cs
- ScriptComponentDescriptor.cs
- ListViewCancelEventArgs.cs
- VectorKeyFrameCollection.cs
- CollectionBuilder.cs
- PolicyManager.cs
- RelationshipNavigation.cs
- InternalEnumValidatorAttribute.cs
- OletxResourceManager.cs
- MessageOperationFormatter.cs
- SchemaImporterExtensionElement.cs
- Predicate.cs
- SafeFileMapViewHandle.cs
- Pool.cs
- SmtpLoginAuthenticationModule.cs
- Grant.cs
- FontCacheLogic.cs
- ExtensionFile.cs