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
- MetadataHelper.cs
- CriticalExceptions.cs
- BamlVersionHeader.cs
- MergeFilterQuery.cs
- ValueTable.cs
- KeyboardDevice.cs
- Inline.cs
- PointValueSerializer.cs
- RequestContextBase.cs
- EasingKeyFrames.cs
- ConnectionProviderAttribute.cs
- AxParameterData.cs
- CubicEase.cs
- SignatureResourcePool.cs
- SessionStateUtil.cs
- MaterialCollection.cs
- Receive.cs
- __TransparentProxy.cs
- WindowProviderWrapper.cs
- FormsAuthentication.cs
- GridPattern.cs
- StsCommunicationException.cs
- ColorDialog.cs
- WorkflowEnvironment.cs
- FontFamily.cs
- ReturnEventArgs.cs
- DataGridColumnFloatingHeader.cs
- ColorPalette.cs
- LinearKeyFrames.cs
- CodeIdentifiers.cs
- StateElementCollection.cs
- StateMachine.cs
- LogRestartAreaEnumerator.cs
- JavaScriptString.cs
- MatrixAnimationBase.cs
- Utils.cs
- WebRequestModuleElement.cs
- WindowsButton.cs
- CallSite.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ItemContainerProviderWrapper.cs
- _NestedSingleAsyncResult.cs
- ScrollChangedEventArgs.cs
- ContainerFilterService.cs
- CodeSnippetCompileUnit.cs
- CellParagraph.cs
- GroupItemAutomationPeer.cs
- XPathException.cs
- UpdateProgress.cs
- NamespaceList.cs
- XmlWrappingReader.cs
- TypeCollectionDesigner.xaml.cs
- Exceptions.cs
- UidManager.cs
- LinkDescriptor.cs
- OleDbPermission.cs
- LocatorGroup.cs
- TitleStyle.cs
- WebPartConnectionsDisconnectVerb.cs
- SafeFileHandle.cs
- StylusShape.cs
- XmlSchemaIdentityConstraint.cs
- COM2FontConverter.cs
- ReflectionServiceProvider.cs
- ScriptServiceAttribute.cs
- XsdValidatingReader.cs
- SqlErrorCollection.cs
- UrlPropertyAttribute.cs
- RegistryPermission.cs
- TemplatedWizardStep.cs
- BufferedGraphicsManager.cs
- DocumentPage.cs
- MaskedTextBox.cs
- RepeaterDataBoundAdapter.cs
- MouseDevice.cs
- SiteMapNodeCollection.cs
- SQLConvert.cs
- StrongNamePublicKeyBlob.cs
- QilIterator.cs
- UniqueIdentifierService.cs
- TextSegment.cs
- DataControlFieldHeaderCell.cs
- COM2ComponentEditor.cs
- ListMarkerSourceInfo.cs
- ListViewCommandEventArgs.cs
- RangeValidator.cs
- SingleConverter.cs
- PathFigureCollection.cs
- StorageEntityContainerMapping.cs
- QueueNameHelper.cs
- EmptyControlCollection.cs
- __ConsoleStream.cs
- RegexReplacement.cs
- DuplexChannelFactory.cs
- lengthconverter.cs
- InkCanvasAutomationPeer.cs
- BufferModeSettings.cs
- SqlProviderManifest.cs
- EventRecord.cs
- FontStretches.cs