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
- RepeaterItemCollection.cs
- AttributeSetAction.cs
- SqlLiftWhereClauses.cs
- PenContexts.cs
- WebPartConnectionCollection.cs
- ADRole.cs
- BamlLocalizableResourceKey.cs
- OleDbStruct.cs
- LicFileLicenseProvider.cs
- ObservableCollection.cs
- SafeCryptoHandles.cs
- ObjectTypeMapping.cs
- WebServiceTypeData.cs
- FieldToken.cs
- JpegBitmapEncoder.cs
- Parameter.cs
- ParentQuery.cs
- ClickablePoint.cs
- ConfigurationSectionCollection.cs
- UntypedNullExpression.cs
- InputDevice.cs
- ImageAutomationPeer.cs
- CodeTypeMemberCollection.cs
- Visual3D.cs
- EventLogger.cs
- FullTextLine.cs
- HMAC.cs
- Exceptions.cs
- Point3DConverter.cs
- UnionCqlBlock.cs
- UpdateEventArgs.cs
- EntityProxyFactory.cs
- FatalException.cs
- SoapFault.cs
- ParallelQuery.cs
- EmptyEnumerator.cs
- PermissionListSet.cs
- DeferredRunTextReference.cs
- MetadataWorkspace.cs
- InputChannelAcceptor.cs
- SrgsToken.cs
- StyleSelector.cs
- Inline.cs
- VisualCollection.cs
- AppSecurityManager.cs
- ClientType.cs
- ListBase.cs
- ManipulationLogic.cs
- SymmetricAlgorithm.cs
- TextInfo.cs
- StaticSiteMapProvider.cs
- _ListenerAsyncResult.cs
- Transaction.cs
- ImportException.cs
- ScriptManager.cs
- PresentationUIStyleResources.cs
- ToggleButton.cs
- ContainerUtilities.cs
- EmptyEnumerator.cs
- FrameworkElementFactoryMarkupObject.cs
- AuthorizationRuleCollection.cs
- TemplateBuilder.cs
- LogFlushAsyncResult.cs
- TypefaceCollection.cs
- PieceNameHelper.cs
- HeaderLabel.cs
- SingleObjectCollection.cs
- PartialCachingControl.cs
- InheritedPropertyChangedEventArgs.cs
- ImpersonateTokenRef.cs
- RegistryPermission.cs
- TimerElapsedEvenArgs.cs
- SqlFlattener.cs
- PermissionSet.cs
- KnowledgeBase.cs
- MarkupProperty.cs
- RemoteWebConfigurationHostServer.cs
- CodeNamespaceCollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- SystemEvents.cs
- RSAPKCS1SignatureFormatter.cs
- HandledEventArgs.cs
- FontSourceCollection.cs
- Regex.cs
- GACIdentityPermission.cs
- WebBaseEventKeyComparer.cs
- UpDownBase.cs
- ResolveMatches11.cs
- documentsequencetextpointer.cs
- ReflectEventDescriptor.cs
- TextRenderer.cs
- RawKeyboardInputReport.cs
- Lazy.cs
- RawStylusInputCustomDataList.cs
- SctClaimDictionary.cs
- SystemIPInterfaceProperties.cs
- InputBuffer.cs
- MsmqPoisonMessageException.cs
- SqlGatherConsumedAliases.cs
- PrintController.cs