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
- StrongNameKeyPair.cs
- RoutedUICommand.cs
- DataBindingCollection.cs
- AdapterDictionary.cs
- SqlBulkCopy.cs
- DbConnectionOptions.cs
- BrowserInteropHelper.cs
- WebAdminConfigurationHelper.cs
- WindowsFormsHostPropertyMap.cs
- IisTraceWebEventProvider.cs
- RoleManagerEventArgs.cs
- PrivilegedConfigurationManager.cs
- WebPartChrome.cs
- ControlBuilderAttribute.cs
- ExtendedPropertyCollection.cs
- HostingPreferredMapPath.cs
- FileDialogPermission.cs
- Vector3D.cs
- FlowchartDesigner.xaml.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- XmlSchemaProviderAttribute.cs
- PerformanceCounter.cs
- _ScatterGatherBuffers.cs
- __Error.cs
- IndexerNameAttribute.cs
- SortKey.cs
- _NTAuthentication.cs
- WebBrowserNavigatedEventHandler.cs
- FileDialogPermission.cs
- MarkerProperties.cs
- ContentElement.cs
- TracingConnectionListener.cs
- DataBoundControlAdapter.cs
- FileInfo.cs
- SymbolEqualComparer.cs
- SocketPermission.cs
- RoleGroup.cs
- CodeCommentStatementCollection.cs
- SqlPersonalizationProvider.cs
- EncryptedType.cs
- CodeTypeReferenceExpression.cs
- InternalRelationshipCollection.cs
- CapacityStreamGeometryContext.cs
- SafePointer.cs
- SiteMapDataSourceView.cs
- ResourceContainer.cs
- HttpProfileBase.cs
- RemoteWebConfigurationHost.cs
- CustomAttributeBuilder.cs
- ExponentialEase.cs
- SchemaNotation.cs
- AssociationSetMetadata.cs
- SQLBinaryStorage.cs
- CatalogZoneAutoFormat.cs
- WindowsIdentity.cs
- EditorPartChrome.cs
- BasicViewGenerator.cs
- Empty.cs
- SortAction.cs
- PenThreadPool.cs
- TextPenaltyModule.cs
- LocatorPartList.cs
- PasswordRecovery.cs
- StreamSecurityUpgradeAcceptorBase.cs
- loginstatus.cs
- HelpInfo.cs
- FileDialog.cs
- CanonicalXml.cs
- KnownAssembliesSet.cs
- MenuItemCollectionEditor.cs
- ReadOnlyDataSource.cs
- DataKey.cs
- Message.cs
- WebServiceTypeData.cs
- TextRunProperties.cs
- RegisteredExpandoAttribute.cs
- DirectoryObjectSecurity.cs
- HtmlInputRadioButton.cs
- PreviewKeyDownEventArgs.cs
- FlowLayoutSettings.cs
- Message.cs
- EventMappingSettingsCollection.cs
- lengthconverter.cs
- Vector.cs
- Geometry.cs
- PerformanceCounters.cs
- SerTrace.cs
- Ray3DHitTestResult.cs
- ModelUIElement3D.cs
- GlyphRun.cs
- CollectionBase.cs
- IntPtr.cs
- ToolStripItem.cs
- _KerberosClient.cs
- CultureInfoConverter.cs
- HttpProcessUtility.cs
- OracleFactory.cs
- SqlHelper.cs
- SafeCloseHandleCritical.cs
- precedingsibling.cs