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
- AxisAngleRotation3D.cs
- EntityKey.cs
- TaskbarItemInfo.cs
- DataGridViewDataConnection.cs
- CompareValidator.cs
- HtmlAnchor.cs
- NavigatorInput.cs
- EntityChangedParams.cs
- SubclassTypeValidator.cs
- SiteMapPath.cs
- CustomValidator.cs
- CustomMenuItemCollection.cs
- StandardBindingCollectionElement.cs
- ExpressionEditor.cs
- PointCollectionValueSerializer.cs
- CompilerScopeManager.cs
- TagPrefixCollection.cs
- RoutedEventArgs.cs
- StringReader.cs
- HttpRuntimeSection.cs
- TypeConstant.cs
- PersonalizationProvider.cs
- BufferModesCollection.cs
- SubclassTypeValidatorAttribute.cs
- WebPartMovingEventArgs.cs
- XmlBaseWriter.cs
- EventHandlersStore.cs
- FactoryGenerator.cs
- DataGridLinkButton.cs
- MissingMemberException.cs
- _Win32.cs
- CellPartitioner.cs
- HttpHandlersSection.cs
- IndependentAnimationStorage.cs
- WebBrowserNavigatingEventHandler.cs
- StandardToolWindows.cs
- DocumentOrderQuery.cs
- DocumentXPathNavigator.cs
- CommentEmitter.cs
- KeyValuePair.cs
- MbpInfo.cs
- XmlSchemaAttribute.cs
- ProbeMatchesApril2005.cs
- WmpBitmapDecoder.cs
- XmlSchemaInferenceException.cs
- AttributeCollection.cs
- ManagementObject.cs
- CodeMemberField.cs
- PopupEventArgs.cs
- MasterPageBuildProvider.cs
- DependencyPropertyValueSerializer.cs
- MatrixTransform.cs
- storepermission.cs
- TaskFormBase.cs
- Wizard.cs
- formatter.cs
- TextBreakpoint.cs
- PeerNameRecordCollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- SqlCacheDependency.cs
- Style.cs
- SqlCommand.cs
- Point.cs
- WSDualHttpBindingElement.cs
- DataFieldEditor.cs
- WorkflowInstanceContextProvider.cs
- ToolStripContainer.cs
- panel.cs
- SiteOfOriginContainer.cs
- CachedCompositeFamily.cs
- DbModificationClause.cs
- designeractionbehavior.cs
- XmlCharType.cs
- RegistryPermission.cs
- FormViewDeletedEventArgs.cs
- FlowDocumentPageViewerAutomationPeer.cs
- remotingproxy.cs
- CheckedListBox.cs
- ArgumentValidation.cs
- EntityDataSourceContextCreatingEventArgs.cs
- ImageInfo.cs
- CodeTypeMemberCollection.cs
- StreamGeometry.cs
- DataContract.cs
- SettingsPropertyValueCollection.cs
- DataGridViewCheckBoxCell.cs
- GridViewPageEventArgs.cs
- UnsafeNativeMethods.cs
- SelectionWordBreaker.cs
- OracleEncoding.cs
- configsystem.cs
- StyleBamlRecordReader.cs
- EntitySetBase.cs
- SByteStorage.cs
- TrailingSpaceComparer.cs
- Command.cs
- DataRow.cs
- TextRangeEdit.cs
- CodeSnippetCompileUnit.cs
- diagnosticsswitches.cs