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 / followingquery.cs / 1 / followingquery.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 sealed class FollowingQuery : BaseAxisQuery { private XPathNavigator input; private XPathNodeIterator iterator; public FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) {} private FollowingQuery(FollowingQuery other) : base(other) { this.input = Clone(other.input); this.iterator = Clone(other.iterator); } public override void Reset() { iterator = null; base.Reset(); } public override XPathNavigator Advance() { if (iterator == null) { input = qyInput.Advance(); if (input == null) { return null; } XPathNavigator prev; do { prev = input.Clone(); input = qyInput.Advance(); } while (prev.IsDescendant(input)); input = prev; iterator = XPathEmptyIterator.Instance; } while (! iterator.MoveNext()) { bool matchSelf; if (input.NodeType == XPathNodeType.Attribute || input.NodeType == XPathNodeType.Namespace) { input.MoveToParent(); matchSelf = false; } else { while (! input.MoveToNext()) { if (! input.MoveToParent()) { return null; } } matchSelf = true; } if (NameTest) { iterator = input.SelectDescendants(Name, Namespace, matchSelf); } else { iterator = input.SelectDescendants(TypeTest, matchSelf); } } position++; currentNode = iterator.Current; return currentNode; } public override XPathNodeIterator Clone() { return new FollowingQuery(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 sealed class FollowingQuery : BaseAxisQuery { private XPathNavigator input; private XPathNodeIterator iterator; public FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) {} private FollowingQuery(FollowingQuery other) : base(other) { this.input = Clone(other.input); this.iterator = Clone(other.iterator); } public override void Reset() { iterator = null; base.Reset(); } public override XPathNavigator Advance() { if (iterator == null) { input = qyInput.Advance(); if (input == null) { return null; } XPathNavigator prev; do { prev = input.Clone(); input = qyInput.Advance(); } while (prev.IsDescendant(input)); input = prev; iterator = XPathEmptyIterator.Instance; } while (! iterator.MoveNext()) { bool matchSelf; if (input.NodeType == XPathNodeType.Attribute || input.NodeType == XPathNodeType.Namespace) { input.MoveToParent(); matchSelf = false; } else { while (! input.MoveToNext()) { if (! input.MoveToParent()) { return null; } } matchSelf = true; } if (NameTest) { iterator = input.SelectDescendants(Name, Namespace, matchSelf); } else { iterator = input.SelectDescendants(TypeTest, matchSelf); } } position++; currentNode = iterator.Current; return currentNode; } public override XPathNodeIterator Clone() { return new FollowingQuery(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
- AsymmetricKeyExchangeFormatter.cs
- SuppressMergeCheckAttribute.cs
- LockCookie.cs
- EmbeddedObject.cs
- DescriptionAttribute.cs
- WebUtil.cs
- ManipulationCompletedEventArgs.cs
- PathFigure.cs
- XmlChildNodes.cs
- SwitchAttribute.cs
- ConnectionManagementElementCollection.cs
- CollectionChangedEventManager.cs
- SwitchCase.cs
- InputProcessorProfilesLoader.cs
- ImmutableObjectAttribute.cs
- FormViewUpdateEventArgs.cs
- DoubleLinkListEnumerator.cs
- ReversePositionQuery.cs
- HandlerWithFactory.cs
- PropertyInformation.cs
- WinFormsSpinner.cs
- CategoryGridEntry.cs
- MethodBody.cs
- BuildProvider.cs
- EncodingInfo.cs
- SpellCheck.cs
- RepeatBehaviorConverter.cs
- SspiWrapper.cs
- ConstructorBuilder.cs
- Pair.cs
- SqlGenerator.cs
- ObjectDisposedException.cs
- Int64KeyFrameCollection.cs
- XmlSerializerImportOptions.cs
- QueueProcessor.cs
- GroupStyle.cs
- ResourceDisplayNameAttribute.cs
- FixedSchema.cs
- MetafileHeaderWmf.cs
- TableRowGroup.cs
- StreamWithDictionary.cs
- WebZone.cs
- Mouse.cs
- RawAppCommandInputReport.cs
- handlecollector.cs
- SystemIPAddressInformation.cs
- LayoutSettings.cs
- InvokeMethodActivity.cs
- PersonalizationStateInfo.cs
- SQLConvert.cs
- AnimationTimeline.cs
- HybridDictionary.cs
- _SSPIWrapper.cs
- SmtpFailedRecipientsException.cs
- Int64.cs
- ReadOnlyHierarchicalDataSource.cs
- SoapDocumentServiceAttribute.cs
- SelectionRange.cs
- RelatedCurrencyManager.cs
- KerberosSecurityTokenParameters.cs
- CmsInterop.cs
- TrustManagerPromptUI.cs
- BufferedResponseStream.cs
- SecurityKeyUsage.cs
- ColorConvertedBitmapExtension.cs
- DataReceivedEventArgs.cs
- DataGridViewBand.cs
- RSAOAEPKeyExchangeDeformatter.cs
- StylusCaptureWithinProperty.cs
- UserInitiatedNavigationPermission.cs
- GiveFeedbackEvent.cs
- SR.cs
- CustomAttribute.cs
- CheckPair.cs
- CompositionDesigner.cs
- ListenerElementsCollection.cs
- WithParamAction.cs
- MobileUserControlDesigner.cs
- mactripleDES.cs
- NodeFunctions.cs
- CharConverter.cs
- OleStrCAMarshaler.cs
- ProxyManager.cs
- SmtpNegotiateAuthenticationModule.cs
- DataControlFieldHeaderCell.cs
- BinarySecretKeyIdentifierClause.cs
- ContainerFilterService.cs
- PenLineCapValidation.cs
- OracleInfoMessageEventArgs.cs
- EntityDataSource.cs
- ComboBox.cs
- BadImageFormatException.cs
- DataObjectFieldAttribute.cs
- OptimalBreakSession.cs
- SqlDataSourceSelectingEventArgs.cs
- HttpWrapper.cs
- ServiceNotStartedException.cs
- ToolStripRenderEventArgs.cs
- DataGridCell.cs
- DateTimeStorage.cs