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
- MenuItemStyleCollectionEditor.cs
- FormsAuthentication.cs
- SecuritySessionServerSettings.cs
- MetaTable.cs
- dbenumerator.cs
- DataBindingHandlerAttribute.cs
- Formatter.cs
- DiffuseMaterial.cs
- HttpFileCollection.cs
- XsltException.cs
- IgnoreDataMemberAttribute.cs
- RoleGroup.cs
- ButtonBaseAutomationPeer.cs
- SystemIPInterfaceStatistics.cs
- ToolboxItemAttribute.cs
- Decimal.cs
- SecurityHeader.cs
- WindowsListViewGroupSubsetLink.cs
- StringFormat.cs
- FunctionNode.cs
- XmlAttributes.cs
- FrameAutomationPeer.cs
- StreamAsIStream.cs
- PackageRelationship.cs
- MouseCaptureWithinProperty.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- DocumentGrid.cs
- QueryFunctions.cs
- SwitchDesigner.xaml.cs
- AbstractDataSvcMapFileLoader.cs
- InkSerializer.cs
- DocumentEventArgs.cs
- TableLayoutPanel.cs
- ControlPager.cs
- OpCopier.cs
- AtomicFile.cs
- EventLogInternal.cs
- ValidateNames.cs
- CodeNamespace.cs
- FreezableCollection.cs
- DbTransaction.cs
- RuleRefElement.cs
- DataGridViewCellValueEventArgs.cs
- WriteFileContext.cs
- diagnosticsswitches.cs
- SystemPens.cs
- ObjectSecurity.cs
- TraceContextRecord.cs
- SpeechRecognitionEngine.cs
- MenuItemStyleCollection.cs
- _NegotiateClient.cs
- RadialGradientBrush.cs
- ScriptResourceInfo.cs
- ConfigXmlDocument.cs
- RequiredAttributeAttribute.cs
- ListItemConverter.cs
- ProtocolsSection.cs
- HashHelper.cs
- StylusDownEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- ColumnWidthChangedEvent.cs
- DataGridColumnEventArgs.cs
- StateWorkerRequest.cs
- RuleProcessor.cs
- UpdatePanelControlTrigger.cs
- LinkUtilities.cs
- BindingCollection.cs
- DynamicMethod.cs
- Util.cs
- DragEvent.cs
- BoolExpr.cs
- WorkflowDesigner.cs
- WithParamAction.cs
- SiteMapPath.cs
- WindowsTitleBar.cs
- Light.cs
- Stack.cs
- OleDbRowUpdatingEvent.cs
- ToolTipAutomationPeer.cs
- UInt16Storage.cs
- ServiceObjectContainer.cs
- DurableInstanceProvider.cs
- Expression.cs
- RegistrySecurity.cs
- DropTarget.cs
- StreamReader.cs
- EventToken.cs
- DisplayNameAttribute.cs
- Task.cs
- Ray3DHitTestResult.cs
- SessionStateSection.cs
- LocatorBase.cs
- CompositeControl.cs
- PropertyReferenceExtension.cs
- SafeFileMappingHandle.cs
- ByteStreamMessageEncoder.cs
- XmlDocumentSurrogate.cs
- CollectionsUtil.cs
- GridToolTip.cs
- X509Certificate2Collection.cs