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
- SiteMapNode.cs
- DataKeyPropertyAttribute.cs
- FaultImportOptions.cs
- ConnectionPoint.cs
- NameValuePair.cs
- TreeNode.cs
- StrokeDescriptor.cs
- MissingMethodException.cs
- DataObjectMethodAttribute.cs
- OleDbDataReader.cs
- TextBlock.cs
- Identity.cs
- ProvidersHelper.cs
- OleStrCAMarshaler.cs
- bindurihelper.cs
- OleDbParameterCollection.cs
- HierarchicalDataSourceDesigner.cs
- ChameleonKey.cs
- UpdateRecord.cs
- Compilation.cs
- SizeChangedInfo.cs
- ExpandableObjectConverter.cs
- EventLogEntry.cs
- XmlToDatasetMap.cs
- ImportException.cs
- PointLight.cs
- JoinTreeSlot.cs
- CodePageUtils.cs
- Polygon.cs
- DataObjectSettingDataEventArgs.cs
- entitydatasourceentitysetnameconverter.cs
- AsymmetricKeyExchangeDeformatter.cs
- MasterPage.cs
- MaskDescriptor.cs
- RepeaterItemEventArgs.cs
- ItemContainerGenerator.cs
- DispatchChannelSink.cs
- LingerOption.cs
- EventSourceCreationData.cs
- StringResourceManager.cs
- ParallelDesigner.cs
- ColorMap.cs
- BoolLiteral.cs
- DetailsViewRow.cs
- _ScatterGatherBuffers.cs
- DataServiceStreamProviderWrapper.cs
- JavaScriptSerializer.cs
- ServicePointManagerElement.cs
- DataGridViewTextBoxColumn.cs
- KoreanLunisolarCalendar.cs
- TypeLoadException.cs
- DiagnosticTraceSource.cs
- DeviceFilterDictionary.cs
- MediaElementAutomationPeer.cs
- ISessionStateStore.cs
- BaseParser.cs
- Fonts.cs
- OutOfMemoryException.cs
- HtmlMeta.cs
- PagesChangedEventArgs.cs
- DataGridCell.cs
- ReadWriteObjectLock.cs
- PreservationFileReader.cs
- XmlElement.cs
- GridSplitter.cs
- SchemaAttDef.cs
- Image.cs
- DESCryptoServiceProvider.cs
- ApplicationTrust.cs
- SQLGuidStorage.cs
- RightsManagementEncryptionTransform.cs
- PeerCollaboration.cs
- TcpHostedTransportConfiguration.cs
- HierarchicalDataTemplate.cs
- OAVariantLib.cs
- control.ime.cs
- NamespaceQuery.cs
- ToolStripItemEventArgs.cs
- RangeBase.cs
- DataGridViewCheckBoxCell.cs
- TextEffect.cs
- WorkflowApplicationAbortedException.cs
- PeerCustomResolverSettings.cs
- ControlAdapter.cs
- ArrayConverter.cs
- ComponentChangingEvent.cs
- DbTransaction.cs
- sqlstateclientmanager.cs
- SQLSingle.cs
- Splitter.cs
- ParentQuery.cs
- CLSCompliantAttribute.cs
- UpdateProgress.cs
- AdornerHitTestResult.cs
- PolicyVersion.cs
- IdentityModelDictionary.cs
- DataViewSetting.cs
- WrapperSecurityCommunicationObject.cs
- IPipelineRuntime.cs
- SqlConnectionHelper.cs