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
- ConstraintStruct.cs
- GridToolTip.cs
- LinqDataView.cs
- SubMenuStyleCollection.cs
- EntityContainer.cs
- DataGridViewUtilities.cs
- BuilderElements.cs
- HttpCachePolicy.cs
- Canvas.cs
- MessageHeaderT.cs
- FlowDecisionDesigner.xaml.cs
- EncodingTable.cs
- ExpressionDumper.cs
- View.cs
- HtmlShim.cs
- WebPartTransformerCollection.cs
- Metafile.cs
- UnsafeNativeMethods.cs
- TextBounds.cs
- SqlTypeConverter.cs
- ExpressionPrinter.cs
- DesignerHost.cs
- VirtualizedItemProviderWrapper.cs
- BmpBitmapEncoder.cs
- Journaling.cs
- WebPartZoneCollection.cs
- MdiWindowListItemConverter.cs
- ModuleConfigurationInfo.cs
- XmlWriterTraceListener.cs
- HtmlTernaryTree.cs
- ProfilePropertySettingsCollection.cs
- CommandEventArgs.cs
- PrintDialogException.cs
- ContentPlaceHolder.cs
- ResXDataNode.cs
- FileChangeNotifier.cs
- DataGridViewSelectedRowCollection.cs
- ServiceDescription.cs
- FormParameter.cs
- ConstraintStruct.cs
- VisualCollection.cs
- BoolExpression.cs
- WebFaultException.cs
- UriSection.cs
- TransactionFlowElement.cs
- ChildrenQuery.cs
- RequestCacheManager.cs
- SQLUtility.cs
- IDQuery.cs
- LoadWorkflowAsyncResult.cs
- ipaddressinformationcollection.cs
- SmtpNtlmAuthenticationModule.cs
- _NestedSingleAsyncResult.cs
- NativeMethods.cs
- XmlToDatasetMap.cs
- BasicSecurityProfileVersion.cs
- SchemaImporterExtensionsSection.cs
- DataTableMapping.cs
- EventlogProvider.cs
- JapaneseLunisolarCalendar.cs
- TimeStampChecker.cs
- DataGridViewRow.cs
- FixedPageProcessor.cs
- NoClickablePointException.cs
- ArgumentElement.cs
- EdgeModeValidation.cs
- ProfileService.cs
- TypeSystemHelpers.cs
- TypeNameHelper.cs
- HitTestResult.cs
- XmlILModule.cs
- XmlSchemaComplexContent.cs
- DataGridViewComboBoxEditingControl.cs
- ImportContext.cs
- MenuItemStyleCollection.cs
- EmptyCollection.cs
- FlowNode.cs
- Run.cs
- SqlDataSourceCommandEventArgs.cs
- Automation.cs
- PermissionSetEnumerator.cs
- MaxMessageSizeStream.cs
- MailAddressCollection.cs
- SiteMapProvider.cs
- DataGridViewCellStyle.cs
- UnsafeNativeMethods.cs
- Error.cs
- IISUnsafeMethods.cs
- AsymmetricCryptoHandle.cs
- MetadataProperty.cs
- SiteMap.cs
- TimeoutStream.cs
- TableLayoutPanelResizeGlyph.cs
- CodePageEncoding.cs
- SecuritySessionFilter.cs
- ArglessEventHandlerProxy.cs
- InstanceDataCollection.cs
- HTMLTextWriter.cs
- ConnectionStringsSection.cs
- EntityDataSourceSelectingEventArgs.cs