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
- ControlParameter.cs
- ServiceModelExtensionElement.cs
- ColumnHeaderConverter.cs
- SqlCommandSet.cs
- OneOfScalarConst.cs
- MDIWindowDialog.cs
- DataGridDesigner.cs
- BitFlagsGenerator.cs
- CompilerGeneratedAttribute.cs
- GeneralTransformCollection.cs
- CompositionAdorner.cs
- UiaCoreApi.cs
- TypeLoadException.cs
- Vector.cs
- PKCS1MaskGenerationMethod.cs
- MessageAction.cs
- AutomationElementCollection.cs
- IdentityReference.cs
- FrameworkElement.cs
- PlatformNotSupportedException.cs
- SocketException.cs
- ProxyManager.cs
- DictionaryEntry.cs
- ListViewEditEventArgs.cs
- StringPropertyBuilder.cs
- AccessorTable.cs
- Encoding.cs
- DeploymentSection.cs
- StringUtil.cs
- Profiler.cs
- HierarchicalDataBoundControl.cs
- DataSourceUtil.cs
- TextAction.cs
- CompModSwitches.cs
- WebPartConnectionsConfigureVerb.cs
- DSACryptoServiceProvider.cs
- XmlSchemaSimpleContentRestriction.cs
- NamedPipeAppDomainProtocolHandler.cs
- PropertyGroupDescription.cs
- DbTransaction.cs
- ErrorTolerantObjectWriter.cs
- AmbientProperties.cs
- XmlDataSource.cs
- WebPartMenu.cs
- KeySpline.cs
- InvalidComObjectException.cs
- MetadataWorkspace.cs
- SafeMarshalContext.cs
- OptionUsage.cs
- TypeSystem.cs
- Focus.cs
- CacheSection.cs
- RemotingAttributes.cs
- StoreAnnotationsMap.cs
- DataGridViewColumnConverter.cs
- InvalidFilterCriteriaException.cs
- IndexedString.cs
- WindowsListViewGroupSubsetLink.cs
- ItemType.cs
- RowToParametersTransformer.cs
- Rfc2898DeriveBytes.cs
- LinkUtilities.cs
- PerformanceCounterCategory.cs
- CompositeKey.cs
- ValuePattern.cs
- ChannelManager.cs
- PropertyValue.cs
- BoundField.cs
- AppliesToBehaviorDecisionTable.cs
- WaveHeader.cs
- Restrictions.cs
- OneToOneMappingSerializer.cs
- ServiceOperationViewControl.cs
- DataGridViewRowCollection.cs
- _PooledStream.cs
- ComponentConverter.cs
- _Connection.cs
- DateTimeFormatInfo.cs
- Classification.cs
- DeflateStream.cs
- AdjustableArrowCap.cs
- TaiwanLunisolarCalendar.cs
- SHA256Managed.cs
- OleDbError.cs
- ChannelDispatcher.cs
- NamespaceInfo.cs
- LambdaCompiler.Binary.cs
- Aggregates.cs
- TreeNodeEventArgs.cs
- KeyGesture.cs
- Operator.cs
- FileStream.cs
- InputMethodStateChangeEventArgs.cs
- StylusPointCollection.cs
- PackageDigitalSignatureManager.cs
- WebFormDesignerActionService.cs
- ResourceCollectionInfo.cs
- HtmlEmptyTagControlBuilder.cs
- COM2EnumConverter.cs
- NonVisualControlAttribute.cs