Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MimeBasePart.cs
- ScrollEvent.cs
- CompiledRegexRunnerFactory.cs
- VectorCollection.cs
- PerformanceCounterLib.cs
- _ChunkParse.cs
- SaveFileDialog.cs
- RenderContext.cs
- ResourcesBuildProvider.cs
- BamlReader.cs
- OleDbException.cs
- RoutedEventArgs.cs
- ApplicationId.cs
- WebPartTransformerCollection.cs
- ObjectView.cs
- Psha1DerivedKeyGeneratorHelper.cs
- DispatcherEventArgs.cs
- Vector3D.cs
- ButtonChrome.cs
- FontStretch.cs
- TreePrinter.cs
- CodeObject.cs
- ToolStripSplitButton.cs
- NavigationWindowAutomationPeer.cs
- EmptyControlCollection.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- EditingCoordinator.cs
- TemplateInstanceAttribute.cs
- MediaSystem.cs
- FormViewCommandEventArgs.cs
- CounterCreationData.cs
- X509UI.cs
- DataList.cs
- Stroke.cs
- RedBlackList.cs
- COM2EnumConverter.cs
- StackSpiller.Generated.cs
- ExpandSegmentCollection.cs
- WorkflowTraceTransfer.cs
- DnsPermission.cs
- XsdDateTime.cs
- PeerNodeTraceRecord.cs
- TracedNativeMethods.cs
- DiagnosticStrings.cs
- WpfGeneratedKnownTypes.cs
- StrokeIntersection.cs
- TextEncodedRawTextWriter.cs
- HtmlButton.cs
- OraclePermissionAttribute.cs
- Operator.cs
- BamlBinaryReader.cs
- ScriptServiceAttribute.cs
- Convert.cs
- XmlNamespaceMappingCollection.cs
- AppModelKnownContentFactory.cs
- PropertyCollection.cs
- GridViewAutoFormat.cs
- AdapterDictionary.cs
- MbpInfo.cs
- XhtmlBasicImageAdapter.cs
- DesignerSerializationManager.cs
- XmlSchemaFacet.cs
- ViewStateModeByIdAttribute.cs
- SiteMapHierarchicalDataSourceView.cs
- DataDocumentXPathNavigator.cs
- SecurityAlgorithmSuiteConverter.cs
- QilLoop.cs
- ConnectionConsumerAttribute.cs
- WebPartDeleteVerb.cs
- ToolStripOverflow.cs
- Brushes.cs
- StreamInfo.cs
- VBCodeProvider.cs
- RoutingUtilities.cs
- XPathNode.cs
- PointF.cs
- OrthographicCamera.cs
- DataColumn.cs
- GlyphRun.cs
- WebPartTransformer.cs
- ValidatingReaderNodeData.cs
- ApplicationTrust.cs
- HttpServerVarsCollection.cs
- SequenceNumber.cs
- ASCIIEncoding.cs
- PassportAuthenticationModule.cs
- SimpleMailWebEventProvider.cs
- ConfigurationPropertyAttribute.cs
- HTTPNotFoundHandler.cs
- EmbeddedObject.cs
- FilteredXmlReader.cs
- ControlBuilder.cs
- ReturnValue.cs
- ScrollBarRenderer.cs
- EventArgs.cs
- HtmlToClrEventProxy.cs
- WebFaultClientMessageInspector.cs
- BaseCodePageEncoding.cs
- StateRuntime.cs
- GeometryHitTestParameters.cs