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
- VirtualPath.cs
- MULTI_QI.cs
- HMACMD5.cs
- MessageHeaderInfoTraceRecord.cs
- CompensationTokenData.cs
- SchemaObjectWriter.cs
- ColorConvertedBitmap.cs
- DockPattern.cs
- PointLightBase.cs
- UIElement.cs
- UserControlBuildProvider.cs
- AtlasWeb.Designer.cs
- SystemIcmpV4Statistics.cs
- CheckPair.cs
- IProvider.cs
- EntityContainerEntitySet.cs
- ProxyGenerationError.cs
- NamespaceEmitter.cs
- ipaddressinformationcollection.cs
- ZipFileInfoCollection.cs
- FrugalMap.cs
- BitmapEffectrendercontext.cs
- RowsCopiedEventArgs.cs
- BindingNavigator.cs
- SafeRightsManagementHandle.cs
- ProfileSettings.cs
- COM2Enum.cs
- GridPattern.cs
- TransactionTable.cs
- GenericRootAutomationPeer.cs
- CompareInfo.cs
- DoubleKeyFrameCollection.cs
- FontFamilyValueSerializer.cs
- UserPersonalizationStateInfo.cs
- InkCanvasSelectionAdorner.cs
- RoutedEventConverter.cs
- EdmSchemaAttribute.cs
- LineUtil.cs
- TextDecoration.cs
- _SSPISessionCache.cs
- ProxyDataContractResolver.cs
- HttpApplicationFactory.cs
- GetPageCompletedEventArgs.cs
- MessageContractExporter.cs
- WebPartPersonalization.cs
- BinaryUtilClasses.cs
- DivideByZeroException.cs
- SchemaType.cs
- DeviceSpecificChoiceCollection.cs
- TakeQueryOptionExpression.cs
- ScrollEventArgs.cs
- SqlFileStream.cs
- CharAnimationBase.cs
- KeyValuePair.cs
- Token.cs
- UnionCqlBlock.cs
- GradientBrush.cs
- ComponentEditorForm.cs
- RoutedEventConverter.cs
- MetadataProperty.cs
- TransformProviderWrapper.cs
- XmlSchemaExternal.cs
- ThaiBuddhistCalendar.cs
- Binding.cs
- StyleBamlRecordReader.cs
- PerformanceCounter.cs
- PresentationAppDomainManager.cs
- LayoutEditorPart.cs
- EncryptedData.cs
- MailMessage.cs
- ProxyWebPartConnectionCollection.cs
- ToolboxItemWrapper.cs
- ProgressBar.cs
- StreamInfo.cs
- HttpCacheVaryByContentEncodings.cs
- CalendarDateRangeChangingEventArgs.cs
- GetKeyedHashRequest.cs
- HttpStreams.cs
- DataGridTableCollection.cs
- RelationshipConverter.cs
- StructuralCache.cs
- PanelStyle.cs
- BinaryObjectInfo.cs
- HebrewNumber.cs
- Oid.cs
- EntityClassGenerator.cs
- RecognitionResult.cs
- ImageIndexEditor.cs
- JsonReader.cs
- AliasedExpr.cs
- QilList.cs
- ContainsSearchOperator.cs
- Menu.cs
- TreeNodeCollectionEditor.cs
- BamlVersionHeader.cs
- BlockingCollection.cs
- SqlUserDefinedAggregateAttribute.cs
- SqlMethodCallConverter.cs
- dataobject.cs
- WebInvokeAttribute.cs