Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SpellerInterop.cs
- AlignmentXValidation.cs
- SyndicationSerializer.cs
- DetailsViewInsertedEventArgs.cs
- XmlHierarchicalEnumerable.cs
- XmlEncodedRawTextWriter.cs
- SettingsBase.cs
- CodeTypeMember.cs
- ConfigurationValue.cs
- Translator.cs
- XmlSchemaAll.cs
- FlowNode.cs
- DataGridViewRowStateChangedEventArgs.cs
- OdbcStatementHandle.cs
- SqlCacheDependencyDatabase.cs
- EventRoute.cs
- CustomAttributeFormatException.cs
- UseAttributeSetsAction.cs
- Control.cs
- MatrixTransform.cs
- AnimationTimeline.cs
- ModifierKeysConverter.cs
- DbMetaDataColumnNames.cs
- RuntimeArgumentHandle.cs
- BackoffTimeoutHelper.cs
- ButtonBase.cs
- QueryOpcode.cs
- PointAnimationClockResource.cs
- ProcessHost.cs
- UIElement3DAutomationPeer.cs
- BasicDesignerLoader.cs
- HighContrastHelper.cs
- KeySplineConverter.cs
- BitmapEffectDrawing.cs
- GreenMethods.cs
- RoleGroupCollectionEditor.cs
- SpeechRecognitionEngine.cs
- SchemaAttDef.cs
- TextBlockAutomationPeer.cs
- DrawTreeNodeEventArgs.cs
- NativeRecognizer.cs
- DecimalConstantAttribute.cs
- SecurityException.cs
- HelloMessageApril2005.cs
- SerializationInfoEnumerator.cs
- XamlFigureLengthSerializer.cs
- XmlRawWriter.cs
- SeekableReadStream.cs
- BinaryObjectWriter.cs
- StatusBar.cs
- EntitySetRetriever.cs
- OrthographicCamera.cs
- ManagementException.cs
- FileDialogCustomPlacesCollection.cs
- AnnotationComponentChooser.cs
- QueryAsyncResult.cs
- AppModelKnownContentFactory.cs
- ErrorTolerantObjectWriter.cs
- CodeTypeDeclaration.cs
- ToolStripPanelSelectionBehavior.cs
- IntegerValidator.cs
- BindingMemberInfo.cs
- IndentedTextWriter.cs
- DrawingImage.cs
- OrderedDictionary.cs
- Dispatcher.cs
- TextEditorTyping.cs
- StringConverter.cs
- ImageCodecInfoPrivate.cs
- ListParaClient.cs
- DelegatingHeader.cs
- DataSourceComponent.cs
- TypeHelper.cs
- ServiceMoniker.cs
- TreeViewAutomationPeer.cs
- DataControlReference.cs
- RsaSecurityKey.cs
- HierarchicalDataSourceControl.cs
- RowsCopiedEventArgs.cs
- WebCategoryAttribute.cs
- RtType.cs
- EntityRecordInfo.cs
- LambdaCompiler.Unary.cs
- OleDbConnection.cs
- CurrentTimeZone.cs
- TabControl.cs
- XmlSchemaAll.cs
- isolationinterop.cs
- StrokeRenderer.cs
- DocobjHost.cs
- PEFileEvidenceFactory.cs
- DateTimeValueSerializer.cs
- DoubleConverter.cs
- XmlElementList.cs
- GeneralTransform3DCollection.cs
- XmlDictionaryReaderQuotas.cs
- TypeUsageBuilder.cs
- TdsParser.cs
- MetadataSource.cs
- mda.cs