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
- XmlSchemaObject.cs
- BitmapEffectInput.cs
- LineSegment.cs
- XsdBuildProvider.cs
- SapiAttributeParser.cs
- DataBindingExpressionBuilder.cs
- FileRecordSequenceHelper.cs
- messageonlyhwndwrapper.cs
- VisualTransition.cs
- TriggerAction.cs
- ToolStripRenderEventArgs.cs
- Base64Encoding.cs
- InstanceDataCollection.cs
- SimpleNameService.cs
- ExpressionWriter.cs
- PtsPage.cs
- Attribute.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ScrollItemProviderWrapper.cs
- InvalidFilterCriteriaException.cs
- IntMinMaxAggregationOperator.cs
- Rfc2898DeriveBytes.cs
- Latin1Encoding.cs
- DataGridBoolColumn.cs
- StrongNameIdentityPermission.cs
- CodeDomDesignerLoader.cs
- Grant.cs
- SqlTriggerContext.cs
- SqlGatherConsumedAliases.cs
- IssuedTokenClientCredential.cs
- ScrollData.cs
- PropertyFilterAttribute.cs
- UriParserTemplates.cs
- RectAnimationUsingKeyFrames.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- SocketException.cs
- RightNameExpirationInfoPair.cs
- processwaithandle.cs
- FixedSOMTextRun.cs
- Buffer.cs
- CultureTableRecord.cs
- TypedDatasetGenerator.cs
- ParameterDataSourceExpression.cs
- TemplateNameScope.cs
- AndCondition.cs
- AssertFilter.cs
- ProbeDuplexAsyncResult.cs
- BindingValueChangedEventArgs.cs
- ObjectDataProvider.cs
- InternalsVisibleToAttribute.cs
- PeerResolverMode.cs
- ProcessModuleCollection.cs
- WaitHandle.cs
- EntityRecordInfo.cs
- ParallelEnumerableWrapper.cs
- WebPageTraceListener.cs
- DynamicValidatorEventArgs.cs
- AttributeInfo.cs
- AttributeTable.cs
- ConfigurationManagerInternalFactory.cs
- _NegoState.cs
- PerformanceCounterCategory.cs
- ProfilePropertySettingsCollection.cs
- CharAnimationBase.cs
- Base64Stream.cs
- EventKeyword.cs
- WFItemsToSpacerVisibility.cs
- RIPEMD160.cs
- DescendantBaseQuery.cs
- EdmRelationshipRoleAttribute.cs
- UrlPath.cs
- ChangeNode.cs
- InterleavedZipPartStream.cs
- columnmapkeybuilder.cs
- PasswordTextNavigator.cs
- XmlDataCollection.cs
- DetailsViewDeleteEventArgs.cs
- TimelineGroup.cs
- FontUnit.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- cryptoapiTransform.cs
- ProcessDesigner.cs
- DoubleCollectionConverter.cs
- LinqTreeNodeEvaluator.cs
- DemultiplexingClientMessageFormatter.cs
- UIElementParaClient.cs
- BackgroundFormatInfo.cs
- Frame.cs
- GAC.cs
- WinFormsSecurity.cs
- SqlFunctionAttribute.cs
- WebPermission.cs
- FromRequest.cs
- UriTemplateClientFormatter.cs
- AgileSafeNativeMemoryHandle.cs
- StackSpiller.Bindings.cs
- ViewBase.cs
- FormClosingEvent.cs
- MeshGeometry3D.cs
- SkewTransform.cs