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 / DescendantQuery.cs / 1 / DescendantQuery.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; internal class DescendantQuery : DescendantBaseQuery { XPathNodeIterator nodeIterator; internal DescendantQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis) : base(qyParent, Name, Prefix, Type, matchSelf, abbrAxis) {} public DescendantQuery(DescendantQuery other) : base(other) { this.nodeIterator = Clone(other.nodeIterator); } public override void Reset() { nodeIterator = null; base.Reset(); } public override XPathNavigator Advance() { while (true) { if (nodeIterator == null) { position = 0; XPathNavigator nav = qyInput.Advance(); if (nav == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name); } else { nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf); } } else { nodeIterator = nav.SelectDescendants(TypeTest, matchSelf); } } if (nodeIterator.MoveNext()) { position++; currentNode = nodeIterator.Current; return currentNode; } else { nodeIterator = null; } } } public override XPathNodeIterator Clone() { return new DescendantQuery(this); } } } // 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; using System.Xml; using System.Xml.XPath; using System.Diagnostics; internal class DescendantQuery : DescendantBaseQuery { XPathNodeIterator nodeIterator; internal DescendantQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis) : base(qyParent, Name, Prefix, Type, matchSelf, abbrAxis) {} public DescendantQuery(DescendantQuery other) : base(other) { this.nodeIterator = Clone(other.nodeIterator); } public override void Reset() { nodeIterator = null; base.Reset(); } public override XPathNavigator Advance() { while (true) { if (nodeIterator == null) { position = 0; XPathNavigator nav = qyInput.Advance(); if (nav == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name); } else { nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf); } } else { nodeIterator = nav.SelectDescendants(TypeTest, matchSelf); } } if (nodeIterator.MoveNext()) { position++; currentNode = nodeIterator.Current; return currentNode; } else { nodeIterator = null; } } } public override XPathNodeIterator Clone() { return new DescendantQuery(this); } } } // 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
- RouteTable.cs
- DispatcherExceptionFilterEventArgs.cs
- CustomWebEventKey.cs
- RouteTable.cs
- HMACMD5.cs
- SimpleType.cs
- QueryGenerator.cs
- _ServiceNameStore.cs
- SystemKeyConverter.cs
- ValidationErrorEventArgs.cs
- JapaneseCalendar.cs
- FileChangesMonitor.cs
- Journal.cs
- SecurityPolicySection.cs
- OracleColumn.cs
- ThumbAutomationPeer.cs
- RadioButton.cs
- OracleTimeSpan.cs
- QilFactory.cs
- XpsFilter.cs
- Switch.cs
- TrackBarRenderer.cs
- SizeKeyFrameCollection.cs
- EntityDataSourceWizardForm.cs
- X509SecurityTokenProvider.cs
- SecurityContextKeyIdentifierClause.cs
- ICspAsymmetricAlgorithm.cs
- MSAAEventDispatcher.cs
- DataGridViewCellStyleConverter.cs
- StringComparer.cs
- NativeMethods.cs
- DesignerTransactionCloseEvent.cs
- DataGridViewComboBoxEditingControl.cs
- ProxyHelper.cs
- HuffModule.cs
- InkSerializer.cs
- TripleDES.cs
- XamlReaderHelper.cs
- InheritanceContextChangedEventManager.cs
- List.cs
- CodeMemberEvent.cs
- ConfigXmlSignificantWhitespace.cs
- FolderNameEditor.cs
- MimeTypeMapper.cs
- ChannelServices.cs
- MimeTypeMapper.cs
- HttpPostedFile.cs
- ReferenceEqualityComparer.cs
- VectorAnimationBase.cs
- DesignTable.cs
- SqlXml.cs
- SpeechDetectedEventArgs.cs
- CompilationLock.cs
- ParameterCollection.cs
- XXXInfos.cs
- Authorization.cs
- XPathNavigator.cs
- PolicyUnit.cs
- PartialTrustVisibleAssembliesSection.cs
- BaseAppDomainProtocolHandler.cs
- RegistrySecurity.cs
- SectionInformation.cs
- Axis.cs
- SoapIncludeAttribute.cs
- RegexParser.cs
- Operator.cs
- SelectingProviderEventArgs.cs
- QuaternionConverter.cs
- DataGridViewHitTestInfo.cs
- httpstaticobjectscollection.cs
- DispatcherExceptionFilterEventArgs.cs
- DataObject.cs
- ColorMatrix.cs
- QilInvoke.cs
- DataGridView.cs
- SiteMapNodeCollection.cs
- DependencyObject.cs
- GridViewColumnCollectionChangedEventArgs.cs
- EncodingStreamWrapper.cs
- CommandHelper.cs
- DispatcherExceptionFilterEventArgs.cs
- ServicesExceptionNotHandledEventArgs.cs
- MessageQueuePermission.cs
- ListViewSortEventArgs.cs
- Attributes.cs
- XmlIterators.cs
- RSAProtectedConfigurationProvider.cs
- ClientFormsAuthenticationCredentials.cs
- EDesignUtil.cs
- SelectionEditingBehavior.cs
- SqlClientWrapperSmiStream.cs
- ColorIndependentAnimationStorage.cs
- DesignerResources.cs
- querybuilder.cs
- SweepDirectionValidation.cs
- LocatorPart.cs
- ToolStripItemRenderEventArgs.cs
- TimelineGroup.cs
- NestedContainer.cs
- PartialCachingControl.cs