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
- ObjectStorage.cs
- ObjectAssociationEndMapping.cs
- FilteredAttributeCollection.cs
- WorkflowDispatchContext.cs
- VisualBrush.cs
- UpdatePanel.cs
- Deserializer.cs
- CreateRefExpr.cs
- InputLanguageEventArgs.cs
- Schedule.cs
- ViewBase.cs
- Dispatcher.cs
- DmlSqlGenerator.cs
- ExtensibleClassFactory.cs
- ResourceReferenceExpression.cs
- ElementNotAvailableException.cs
- DiscoveryClientDocuments.cs
- DesignerEditorPartChrome.cs
- DescendantOverDescendantQuery.cs
- DependsOnAttribute.cs
- ValidatingPropertiesEventArgs.cs
- XamlVector3DCollectionSerializer.cs
- CustomAttributeBuilder.cs
- TemplateControl.cs
- SystemInformation.cs
- TypeUsageBuilder.cs
- RuleSet.cs
- PointCollectionValueSerializer.cs
- XmlParserContext.cs
- figurelengthconverter.cs
- BasicExpressionVisitor.cs
- PropertyIDSet.cs
- CrossAppDomainChannel.cs
- GraphicsState.cs
- PointAnimationUsingKeyFrames.cs
- LateBoundBitmapDecoder.cs
- ValidatingReaderNodeData.cs
- UriTemplateClientFormatter.cs
- DomainUpDown.cs
- BitmapEffectState.cs
- _BaseOverlappedAsyncResult.cs
- UrlParameterReader.cs
- FtpWebRequest.cs
- XmlValidatingReader.cs
- AppSettingsReader.cs
- ProgramNode.cs
- AccessDataSourceWizardForm.cs
- CachedTypeface.cs
- SecurityIdentifierElementCollection.cs
- IsolatedStorageFile.cs
- MergeFilterQuery.cs
- DynamicDocumentPaginator.cs
- LayoutTable.cs
- InputReferenceExpression.cs
- HostedElements.cs
- Matrix3DStack.cs
- NonVisualControlAttribute.cs
- WebPartEditorCancelVerb.cs
- XdrBuilder.cs
- StringFreezingAttribute.cs
- StorageTypeMapping.cs
- SecurityKeyType.cs
- CopyOnWriteList.cs
- FontStretchConverter.cs
- ColorConverter.cs
- MetadataItemEmitter.cs
- MouseActionValueSerializer.cs
- MemoryMappedViewStream.cs
- AuthenticationModuleElementCollection.cs
- ProvideValueServiceProvider.cs
- StyleBamlTreeBuilder.cs
- ProcessThreadCollection.cs
- CodeGroup.cs
- XmlNodeList.cs
- WindowsTab.cs
- DBDataPermission.cs
- CombinedGeometry.cs
- WorkflowServiceHostFactory.cs
- SqlCacheDependency.cs
- CornerRadiusConverter.cs
- EntityClientCacheKey.cs
- PlanCompilerUtil.cs
- SizeValueSerializer.cs
- SqlNamer.cs
- SmtpSection.cs
- ToolStripItemEventArgs.cs
- ISAPIApplicationHost.cs
- _UncName.cs
- BatchServiceHost.cs
- CapiSafeHandles.cs
- ToolStripItemCollection.cs
- DataChangedEventManager.cs
- ReaderWriterLock.cs
- Unit.cs
- MemoryMappedFile.cs
- SerializerProvider.cs
- OpacityConverter.cs
- NullRuntimeConfig.cs
- ItemMap.cs
- Triangle.cs