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
- StylusPoint.cs
- SqlCaseSimplifier.cs
- hwndwrapper.cs
- RichTextBox.cs
- BaseConfigurationRecord.cs
- MenuItemBinding.cs
- PathData.cs
- RepeatInfo.cs
- CompositeActivityTypeDescriptorProvider.cs
- PageHandlerFactory.cs
- EntityDataSourceReferenceGroup.cs
- ValueQuery.cs
- NativeMethods.cs
- NumberFunctions.cs
- WebPartEventArgs.cs
- CommonDialog.cs
- UnsafeNativeMethodsTablet.cs
- TraceFilter.cs
- Padding.cs
- ElasticEase.cs
- SqlTypeConverter.cs
- InputReport.cs
- TrailingSpaceComparer.cs
- PointConverter.cs
- EntityClassGenerator.cs
- UnauthorizedAccessException.cs
- X509Certificate.cs
- WebServiceHostFactory.cs
- HelloMessageApril2005.cs
- DefaultExpressionVisitor.cs
- WebPartHeaderCloseVerb.cs
- IsolatedStoragePermission.cs
- ResourceManagerWrapper.cs
- log.cs
- TypefaceCollection.cs
- RequestCacheValidator.cs
- RC2.cs
- XmlDocumentType.cs
- ExtendedProtectionPolicyElement.cs
- EntityCommandDefinition.cs
- SchemaSetCompiler.cs
- ComponentSerializationService.cs
- FrameSecurityDescriptor.cs
- PreservationFileReader.cs
- Unit.cs
- Compiler.cs
- FilterException.cs
- PathSegment.cs
- XappLauncher.cs
- SecureUICommand.cs
- ColumnResizeUndoUnit.cs
- CapabilitiesPattern.cs
- BinHexEncoding.cs
- VisualStyleElement.cs
- VirtualDirectoryMapping.cs
- WebHttpSecurityElement.cs
- MsmqOutputMessage.cs
- HandledMouseEvent.cs
- TreeNodeCollection.cs
- EnterpriseServicesHelper.cs
- InstanceNameConverter.cs
- Intellisense.cs
- StringFreezingAttribute.cs
- DnsPermission.cs
- FormatterServices.cs
- SecurityManager.cs
- printdlgexmarshaler.cs
- TabControl.cs
- WebBrowserHelper.cs
- StorageFunctionMapping.cs
- NativeWindow.cs
- EditBehavior.cs
- CompositionTarget.cs
- FontConverter.cs
- SignalGate.cs
- SafeCertificateStore.cs
- FragmentQueryProcessor.cs
- PropertyItemInternal.cs
- DocumentXPathNavigator.cs
- Clock.cs
- SessionStateSection.cs
- XmlExtensionFunction.cs
- BindingCompleteEventArgs.cs
- AppDomainManager.cs
- DesignerObject.cs
- IOThreadScheduler.cs
- NamedPipeTransportSecurityElement.cs
- TextTreeTextNode.cs
- DefaultProxySection.cs
- ElementUtil.cs
- CodeObjectCreateExpression.cs
- ExpressionEditorAttribute.cs
- HttpResponse.cs
- StringAnimationUsingKeyFrames.cs
- HtmlInputSubmit.cs
- DataColumnPropertyDescriptor.cs
- HtmlEncodedRawTextWriter.cs
- ListViewGroup.cs
- RowUpdatingEventArgs.cs
- DiscardableAttribute.cs