Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantQuery.cs / 1305376 / 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
- CommandID.cs
- XmlBinaryWriter.cs
- Keywords.cs
- _SSPIWrapper.cs
- SystemTcpConnection.cs
- SubpageParagraph.cs
- ThreadAttributes.cs
- BuildProviderAppliesToAttribute.cs
- DataGridViewComboBoxCell.cs
- KernelTypeValidation.cs
- CollectionConverter.cs
- DurationConverter.cs
- EventArgs.cs
- MemberPath.cs
- LogWriteRestartAreaState.cs
- SoapSchemaMember.cs
- StringFreezingAttribute.cs
- RangeValuePatternIdentifiers.cs
- ManagedWndProcTracker.cs
- COSERVERINFO.cs
- QilFunction.cs
- Attributes.cs
- BufferModeSettings.cs
- ResourceManager.cs
- FloaterParagraph.cs
- AmbientValueAttribute.cs
- EntityProviderServices.cs
- XmlSiteMapProvider.cs
- RawStylusActions.cs
- Propagator.Evaluator.cs
- SrgsItemList.cs
- TextEffectResolver.cs
- ReservationNotFoundException.cs
- ToggleButton.cs
- WindowsTitleBar.cs
- ControlBindingsConverter.cs
- WbmpConverter.cs
- Module.cs
- UrlPath.cs
- QueryOperationResponseOfT.cs
- DesignerListAdapter.cs
- MetadataSource.cs
- RequestCacheValidator.cs
- FloatUtil.cs
- QilReplaceVisitor.cs
- KernelTypeValidation.cs
- AxImporter.cs
- EventDescriptorCollection.cs
- AttachedAnnotation.cs
- DataServiceStreamProviderWrapper.cs
- RegularExpressionValidator.cs
- NTAccount.cs
- PersistencePipeline.cs
- StringStorage.cs
- CodeCompiler.cs
- DurableInstanceProvider.cs
- SiteMapNodeCollection.cs
- figurelengthconverter.cs
- MaskInputRejectedEventArgs.cs
- NameScope.cs
- ThreadStartException.cs
- PlanCompilerUtil.cs
- InsufficientMemoryException.cs
- TreeView.cs
- ThicknessConverter.cs
- ImmutableObjectAttribute.cs
- SymmetricKeyWrap.cs
- TablePatternIdentifiers.cs
- DoWorkEventArgs.cs
- AppearanceEditorPart.cs
- Add.cs
- ClientScriptManager.cs
- JsonByteArrayDataContract.cs
- XmlSerializableReader.cs
- InstanceOwnerQueryResult.cs
- Queue.cs
- XmlSerializationWriter.cs
- CodeCatchClauseCollection.cs
- ListViewContainer.cs
- ProxyWebPartManagerDesigner.cs
- ClockGroup.cs
- DecoderExceptionFallback.cs
- InputScopeAttribute.cs
- GroupBoxAutomationPeer.cs
- VarRemapper.cs
- WorkflowView.cs
- WebPartMovingEventArgs.cs
- ControlValuePropertyAttribute.cs
- MailAddressCollection.cs
- DrawingBrush.cs
- SessionEndingCancelEventArgs.cs
- DataGridViewMethods.cs
- HMACSHA384.cs
- HighContrastHelper.cs
- ActivationServices.cs
- DataGridViewSelectedCellCollection.cs
- GridViewRowCollection.cs
- TableCellCollection.cs
- DbProviderServices.cs
- VerticalAlignConverter.cs