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 / 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
- DbConnectionStringBuilder.cs
- RadioButton.cs
- Events.cs
- RSAPKCS1SignatureFormatter.cs
- ContainerSelectorGlyph.cs
- ValueChangedEventManager.cs
- ProcessModelInfo.cs
- RecognizerStateChangedEventArgs.cs
- ExpanderAutomationPeer.cs
- StrongNameMembershipCondition.cs
- UniqueSet.cs
- BitmapFrameDecode.cs
- HighContrastHelper.cs
- SelectedCellsChangedEventArgs.cs
- StorageMappingItemLoader.cs
- WebPartManager.cs
- DynamicQueryableWrapper.cs
- AudioSignalProblemOccurredEventArgs.cs
- elementinformation.cs
- XPathNodeInfoAtom.cs
- ItemType.cs
- Row.cs
- TheQuery.cs
- WebPartConnectionsEventArgs.cs
- AutomationProperties.cs
- SafeTimerHandle.cs
- ComponentEditorForm.cs
- CodeCommentStatementCollection.cs
- PanelStyle.cs
- ArrayConverter.cs
- PKCS1MaskGenerationMethod.cs
- DetailsViewDeleteEventArgs.cs
- IndicShape.cs
- SiteMembershipCondition.cs
- DataBinder.cs
- UnionCodeGroup.cs
- FilterElement.cs
- UnsafeNativeMethods.cs
- DataGridTableCollection.cs
- DragStartedEventArgs.cs
- Buffer.cs
- HttpConfigurationContext.cs
- TreeWalker.cs
- AlphabeticalEnumConverter.cs
- UserControlCodeDomTreeGenerator.cs
- FileDialog.cs
- SqlFormatter.cs
- streamingZipPartStream.cs
- EventManager.cs
- XmlDocumentType.cs
- UnitySerializationHolder.cs
- DispatcherHookEventArgs.cs
- XmlSubtreeReader.cs
- Properties.cs
- SmtpFailedRecipientsException.cs
- EditCommandColumn.cs
- ComMethodElement.cs
- WorkflowOperationContext.cs
- IriParsingElement.cs
- activationcontext.cs
- WebPartVerbsEventArgs.cs
- DoWhileDesigner.xaml.cs
- WindowsStatusBar.cs
- SqlLiftIndependentRowExpressions.cs
- ThicknessAnimationUsingKeyFrames.cs
- unitconverter.cs
- DeferredElementTreeState.cs
- QuestionEventArgs.cs
- NamedElement.cs
- MembershipValidatePasswordEventArgs.cs
- ClientSettings.cs
- Codec.cs
- PersonalizationProviderCollection.cs
- PEFileReader.cs
- WindowsTooltip.cs
- SystemException.cs
- SqlRemoveConstantOrderBy.cs
- EndpointAddressMessageFilterTable.cs
- Transform3DGroup.cs
- SslStream.cs
- OrderByQueryOptionExpression.cs
- BidPrivateBase.cs
- MouseGestureConverter.cs
- entityreference_tresulttype.cs
- CardSpaceSelector.cs
- SecurityKeyIdentifier.cs
- mactripleDES.cs
- SvcMapFile.cs
- ADConnectionHelper.cs
- SqlDataSourceStatusEventArgs.cs
- WsatAdminException.cs
- HostingEnvironment.cs
- FtpRequestCacheValidator.cs
- Sequence.cs
- ContentValidator.cs
- TableCell.cs
- ObjectHelper.cs
- PageAsyncTask.cs
- GridView.cs
- FaultDescriptionCollection.cs