Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- CodeAttributeDeclaration.cs
- StatusBar.cs
- ConnectionStringsExpressionBuilder.cs
- BamlResourceSerializer.cs
- Internal.cs
- WindowsTokenRoleProvider.cs
- UserControlCodeDomTreeGenerator.cs
- TextEvent.cs
- PrincipalPermission.cs
- RenderTargetBitmap.cs
- QueryModel.cs
- QuaternionAnimationBase.cs
- SupportsEventValidationAttribute.cs
- FontEmbeddingManager.cs
- RadioButton.cs
- DataGridHelper.cs
- WebPartVerb.cs
- DataViewSettingCollection.cs
- ProxyGenerationError.cs
- EventLogSession.cs
- TraceEventCache.cs
- PersonalizationStateQuery.cs
- DrawItemEvent.cs
- MsmqDiagnostics.cs
- TimeStampChecker.cs
- SQLInt16.cs
- CodeTypeMember.cs
- Comparer.cs
- DbConnectionOptions.cs
- RegistryPermission.cs
- WebBrowser.cs
- WmlFormAdapter.cs
- TableSectionStyle.cs
- SwitchAttribute.cs
- AnimationStorage.cs
- CommandHelpers.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- PropertyGeneratedEventArgs.cs
- DataGridViewImageColumn.cs
- ProxyHwnd.cs
- entityreference_tresulttype.cs
- ScaleTransform3D.cs
- DataTableClearEvent.cs
- RTTrackingProfile.cs
- CodeStatementCollection.cs
- IsolatedStorageFileStream.cs
- ZipFileInfo.cs
- OperationDescriptionCollection.cs
- ReferentialConstraint.cs
- WebPartChrome.cs
- TemplateControl.cs
- PartialCachingAttribute.cs
- XmlSchemaDatatype.cs
- ToggleButton.cs
- XmlSchemaSimpleTypeList.cs
- LinearKeyFrames.cs
- RichTextBoxDesigner.cs
- XmlReaderSettings.cs
- SafeHandles.cs
- StreamUpdate.cs
- ClassicBorderDecorator.cs
- LinkGrep.cs
- ContentDefinition.cs
- ClientApiGenerator.cs
- FieldAccessException.cs
- ForEachAction.cs
- RtfControls.cs
- SortDescriptionCollection.cs
- SamlNameIdentifierClaimResource.cs
- CodePrimitiveExpression.cs
- SecondaryIndexList.cs
- regiisutil.cs
- HtmlTextArea.cs
- WebPartConnectionCollection.cs
- ThreadAbortException.cs
- PackageRelationshipSelector.cs
- ToolStripRendererSwitcher.cs
- CompModSwitches.cs
- XmlNodeList.cs
- WeakReferenceList.cs
- ThreadStartException.cs
- MenuItemBinding.cs
- DomNameTable.cs
- ManagementObjectSearcher.cs
- XsltContext.cs
- TaskForm.cs
- FormViewInsertedEventArgs.cs
- unsafeIndexingFilterStream.cs
- recordstatefactory.cs
- login.cs
- Latin1Encoding.cs
- LineUtil.cs
- BamlTreeUpdater.cs
- SizeAnimationBase.cs
- CacheVirtualItemsEvent.cs
- NamespaceTable.cs
- ManagementOptions.cs
- GridLength.cs
- DiscoveryServerProtocol.cs
- _NetRes.cs