Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / followingquery.cs / 1305376 / 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
- DefaultExpression.cs
- ListViewUpdatedEventArgs.cs
- CellQuery.cs
- AuthenticationService.cs
- AnchoredBlock.cs
- WebColorConverter.cs
- CustomSignedXml.cs
- ObsoleteAttribute.cs
- SafeSecurityHandles.cs
- KeyInstance.cs
- SettingsAttributes.cs
- IdentifierService.cs
- MatrixAnimationUsingPath.cs
- SettingsProperty.cs
- MemberInitExpression.cs
- EventPropertyMap.cs
- CodeAccessSecurityEngine.cs
- SymmetricKeyWrap.cs
- TargetPerspective.cs
- NavigationExpr.cs
- IListConverters.cs
- ParallelTimeline.cs
- templategroup.cs
- ListViewInsertionMark.cs
- AtomicFile.cs
- BrowserCapabilitiesCodeGenerator.cs
- ServiceChannel.cs
- Processor.cs
- BindingsCollection.cs
- GridViewDeletedEventArgs.cs
- HtmlAnchor.cs
- X509Chain.cs
- DbMetaDataColumnNames.cs
- HashMembershipCondition.cs
- SubtreeProcessor.cs
- TreeViewDesigner.cs
- ListBindingConverter.cs
- EntryPointNotFoundException.cs
- WebPartDisplayMode.cs
- GeneralTransform2DTo3D.cs
- DataControlFieldCell.cs
- ResourcesChangeInfo.cs
- DataControlFieldCollection.cs
- LinkClickEvent.cs
- ObjectAnimationBase.cs
- CompareInfo.cs
- SymmetricCryptoHandle.cs
- HandleTable.cs
- FlowPosition.cs
- safex509handles.cs
- SchemaReference.cs
- MarkupProperty.cs
- CatalogPartChrome.cs
- Symbol.cs
- ApplyTemplatesAction.cs
- ColorContext.cs
- Validator.cs
- HttpResponse.cs
- ThumbAutomationPeer.cs
- Cell.cs
- SchemaObjectWriter.cs
- UpdateEventArgs.cs
- BidOverLoads.cs
- CodeIndexerExpression.cs
- DnsPermission.cs
- HighlightComponent.cs
- FormatException.cs
- FacetChecker.cs
- TemplateNameScope.cs
- HitTestResult.cs
- FrameworkElement.cs
- CompressionTransform.cs
- CachedBitmap.cs
- QilGeneratorEnv.cs
- LinqDataView.cs
- MachineKeySection.cs
- ObjectDataSourceMethodEventArgs.cs
- CalendarDataBindingHandler.cs
- DbUpdateCommandTree.cs
- VSWCFServiceContractGenerator.cs
- VariableQuery.cs
- PackageProperties.cs
- PaperSize.cs
- StylusCaptureWithinProperty.cs
- EncodingInfo.cs
- BrowserTree.cs
- SqlConnectionStringBuilder.cs
- StreamGeometryContext.cs
- DefaultPropertiesToSend.cs
- RemotingAttributes.cs
- ListViewAutomationPeer.cs
- AppLevelCompilationSectionCache.cs
- DynamicRenderer.cs
- TypeConverterValueSerializer.cs
- SpellCheck.cs
- DataSourceCache.cs
- PropertyGridEditorPart.cs
- FieldDescriptor.cs
- XamlTypeMapperSchemaContext.cs
- ConstructorNeedsTagAttribute.cs