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
- FixedTextSelectionProcessor.cs
- HttpException.cs
- XmlAttribute.cs
- PersonalizableAttribute.cs
- XmlMemberMapping.cs
- TreeIterator.cs
- MenuItemStyle.cs
- HandlerMappingMemo.cs
- StorageModelBuildProvider.cs
- DataGridViewButtonCell.cs
- CellNormalizer.cs
- UnsettableComboBox.cs
- SqlClientFactory.cs
- selecteditemcollection.cs
- IfAction.cs
- PocoEntityKeyStrategy.cs
- Nullable.cs
- HttpApplication.cs
- LedgerEntryCollection.cs
- EnumCodeDomSerializer.cs
- PeerEndPoint.cs
- _FtpDataStream.cs
- QilExpression.cs
- ConnectionManagementSection.cs
- OracleInfoMessageEventArgs.cs
- ExpressionBuilderContext.cs
- SynchronizedRandom.cs
- UInt32.cs
- InProcStateClientManager.cs
- XmlDataSourceDesigner.cs
- XmlEncodedRawTextWriter.cs
- FillErrorEventArgs.cs
- BeginEvent.cs
- XPathDocument.cs
- OracleConnection.cs
- CustomErrorCollection.cs
- CharacterBuffer.cs
- TransactedBatchingBehavior.cs
- SchemaImporterExtensionElement.cs
- SpecularMaterial.cs
- BindingOperations.cs
- DragCompletedEventArgs.cs
- LineSegment.cs
- DataGridViewCheckBoxCell.cs
- BlockUIContainer.cs
- XslAstAnalyzer.cs
- MimeReturn.cs
- _TLSstream.cs
- DnsPermission.cs
- SettingsSavedEventArgs.cs
- DeviceContext.cs
- DefaultExpressionVisitor.cs
- VisualCollection.cs
- DataObjectPastingEventArgs.cs
- SemanticBasicElement.cs
- DetailsViewInsertEventArgs.cs
- DataReceivedEventArgs.cs
- LifetimeServices.cs
- Point3D.cs
- KeyGesture.cs
- PageContentAsyncResult.cs
- TreeNodeConverter.cs
- XmlSchemaExternal.cs
- IListConverters.cs
- ResourceAssociationSet.cs
- RangeContentEnumerator.cs
- HtmlElement.cs
- CompilationLock.cs
- NativeActivityMetadata.cs
- BitmapMetadataEnumerator.cs
- DataGridViewTopRowAccessibleObject.cs
- ProgressBarAutomationPeer.cs
- SymbolEqualComparer.cs
- SimpleTextLine.cs
- PrivilegedConfigurationManager.cs
- NavigationPropertyAccessor.cs
- PageTheme.cs
- RoleServiceManager.cs
- DetailsViewUpdateEventArgs.cs
- XmlImplementation.cs
- FileIOPermission.cs
- GridViewCommandEventArgs.cs
- CompositionTarget.cs
- StringResourceManager.cs
- PanelStyle.cs
- FileRecordSequenceCompletedAsyncResult.cs
- EndpointConfigContainer.cs
- SqlVisitor.cs
- ConfigurationManager.cs
- PerformanceCounterPermissionEntryCollection.cs
- DecimalAnimationBase.cs
- BaseTemplateParser.cs
- _RequestCacheProtocol.cs
- UnsafeNativeMethods.cs
- WindowsGraphicsCacheManager.cs
- LoginName.cs
- BreakSafeBase.cs
- OdbcRowUpdatingEvent.cs
- InheritanceRules.cs
- WebPartHelpVerb.cs