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
- PointCollection.cs
- Accessible.cs
- RawStylusInputReport.cs
- XmlSchemaImport.cs
- ToolStripRendererSwitcher.cs
- DBConcurrencyException.cs
- MenuRenderer.cs
- BitmapScalingModeValidation.cs
- GridViewUpdateEventArgs.cs
- ElementInit.cs
- EventlogProvider.cs
- StylusPointPropertyUnit.cs
- URLMembershipCondition.cs
- EventSinkActivity.cs
- CodeNamespaceImport.cs
- HistoryEventArgs.cs
- CallbackValidatorAttribute.cs
- GridViewColumn.cs
- DataGridViewColumnStateChangedEventArgs.cs
- SqlMetaData.cs
- StructuredProperty.cs
- WindowsContainer.cs
- _IPv4Address.cs
- CompilerTypeWithParams.cs
- ObjectAnimationBase.cs
- RuntimeCompatibilityAttribute.cs
- SqlDataRecord.cs
- WebZone.cs
- WSHttpTransportSecurityElement.cs
- MbpInfo.cs
- VScrollProperties.cs
- NumberSubstitution.cs
- AssertUtility.cs
- PageThemeBuildProvider.cs
- CheckBoxFlatAdapter.cs
- SponsorHelper.cs
- CTreeGenerator.cs
- InvokeHandlers.cs
- HtmlGenericControl.cs
- PageParser.cs
- StrokeNode.cs
- XamlToRtfWriter.cs
- InstalledFontCollection.cs
- LogManagementAsyncResult.cs
- StaticTextPointer.cs
- LocatorPart.cs
- Button.cs
- HTTPNotFoundHandler.cs
- TdsParserHelperClasses.cs
- TCPListener.cs
- Literal.cs
- dbdatarecord.cs
- SharedPersonalizationStateInfo.cs
- ToolStripDropDownClosedEventArgs.cs
- DataGridItemEventArgs.cs
- UDPClient.cs
- MatrixAnimationUsingPath.cs
- IgnoreFileBuildProvider.cs
- ConfigXmlReader.cs
- linebase.cs
- UriTemplateLiteralPathSegment.cs
- DateTimeValueSerializer.cs
- GlyphRun.cs
- DataGridViewTextBoxColumn.cs
- BitmapMetadataBlob.cs
- EventDescriptor.cs
- FrugalMap.cs
- oledbmetadatacolumnnames.cs
- DataGridViewImageCell.cs
- EntityDesignerDataSourceView.cs
- SchemaImporterExtensionsSection.cs
- AddressingProperty.cs
- InstanceCollisionException.cs
- TargetException.cs
- HandleRef.cs
- MarshalByValueComponent.cs
- ProcessModelSection.cs
- CancelEventArgs.cs
- GC.cs
- MILUtilities.cs
- Boolean.cs
- StackSpiller.cs
- XmlSchemaComplexContentExtension.cs
- DataFormats.cs
- BuildProvider.cs
- SafeRightsManagementQueryHandle.cs
- XamlLoadErrorInfo.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- ErrorFormatterPage.cs
- InfoCardProofToken.cs
- SkipQueryOptionExpression.cs
- StrokeNode.cs
- ChameleonKey.cs
- Effect.cs
- SiteMap.cs
- mactripleDES.cs
- Logging.cs
- ToolStripDropDown.cs
- FormViewDeleteEventArgs.cs
- FileDialogCustomPlace.cs