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
- TransformGroup.cs
- DaylightTime.cs
- TreeNodeBinding.cs
- TextLineResult.cs
- OdbcConnectionStringbuilder.cs
- TextSelectionHelper.cs
- TemplateField.cs
- QualifiedCellIdBoolean.cs
- SqlProcedureAttribute.cs
- SystemResourceHost.cs
- RequestStatusBarUpdateEventArgs.cs
- DesignerDataStoredProcedure.cs
- PrimitiveCodeDomSerializer.cs
- LinqDataSourceInsertEventArgs.cs
- SqlUdtInfo.cs
- ChannelManagerService.cs
- BitmapImage.cs
- MatrixConverter.cs
- WindowsTooltip.cs
- ItemChangedEventArgs.cs
- IndexedEnumerable.cs
- DataColumnPropertyDescriptor.cs
- IsolationInterop.cs
- SqlRecordBuffer.cs
- PrimitiveXmlSerializers.cs
- FormsAuthenticationUserCollection.cs
- TableStyle.cs
- TraceHandlerErrorFormatter.cs
- PaintValueEventArgs.cs
- BufferedConnection.cs
- __Error.cs
- TemplateBindingExpression.cs
- precedingquery.cs
- CompatibleComparer.cs
- ExpressionBuilderContext.cs
- HtmlShim.cs
- ScrollBarRenderer.cs
- NavigationFailedEventArgs.cs
- ProcessHostFactoryHelper.cs
- Int32CollectionConverter.cs
- MenuScrollingVisibilityConverter.cs
- AsymmetricSignatureFormatter.cs
- Application.cs
- LogWriteRestartAreaState.cs
- StatusBarAutomationPeer.cs
- ResourceWriter.cs
- FixedSOMTextRun.cs
- FormattedTextSymbols.cs
- ProcessHostConfigUtils.cs
- Vector3DAnimationBase.cs
- ConsumerConnectionPoint.cs
- CommonXSendMessage.cs
- StringArrayConverter.cs
- Trace.cs
- SQLBoolean.cs
- CorrelationManager.cs
- EncodingTable.cs
- EntityDescriptor.cs
- RuntimeEnvironment.cs
- TypeReference.cs
- ContextMarshalException.cs
- DataStreams.cs
- Point3DCollection.cs
- SystemColors.cs
- JavaScriptSerializer.cs
- CompilerCollection.cs
- PackagePartCollection.cs
- InvalidContentTypeException.cs
- LogEntrySerializationException.cs
- Parser.cs
- GetMemberBinder.cs
- ADRole.cs
- XmlDownloadManager.cs
- StringResourceManager.cs
- AssemblyBuilderData.cs
- ResXFileRef.cs
- DefaultHttpHandler.cs
- HtmlInputImage.cs
- PropertyChange.cs
- TypeSchema.cs
- Hex.cs
- XmlSchemaSubstitutionGroup.cs
- SocketException.cs
- CardSpacePolicyElement.cs
- DataGridCellsPanel.cs
- XmlSchemaFacet.cs
- Wizard.cs
- PointLight.cs
- MarkupExtensionReturnTypeAttribute.cs
- As.cs
- DefaultValueTypeConverter.cs
- HMACRIPEMD160.cs
- HttpRawResponse.cs
- CheckBoxField.cs
- MemoryFailPoint.cs
- FormatVersion.cs
- EdmScalarPropertyAttribute.cs
- MD5.cs
- WebControlAdapter.cs
- ElementHostAutomationPeer.cs