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
- StructuralType.cs
- QEncodedStream.cs
- DataTableNewRowEvent.cs
- DefaultEventAttribute.cs
- PrintPageEvent.cs
- ArraySet.cs
- OperandQuery.cs
- FrameworkContentElementAutomationPeer.cs
- CodeGenerator.cs
- LassoHelper.cs
- RenderData.cs
- Color.cs
- EditorBrowsableAttribute.cs
- XmlIgnoreAttribute.cs
- ConnectionInterfaceCollection.cs
- TemplateLookupAction.cs
- CompleteWizardStep.cs
- Message.cs
- Shape.cs
- WriteableBitmap.cs
- ComponentConverter.cs
- PeerApplicationLaunchInfo.cs
- AdornerPresentationContext.cs
- NotSupportedException.cs
- DetailsViewPageEventArgs.cs
- Point.cs
- ApplicationHost.cs
- GC.cs
- ImportContext.cs
- XmlSecureResolver.cs
- DuplicateWaitObjectException.cs
- MergeEnumerator.cs
- ArrayList.cs
- ConfigurationManagerHelper.cs
- MultiView.cs
- PageSettings.cs
- SafeNativeMethods.cs
- CompilationRelaxations.cs
- AccessDataSource.cs
- InvalidFilterCriteriaException.cs
- ReflectEventDescriptor.cs
- TextCompositionManager.cs
- AdornerPresentationContext.cs
- AttributeCollection.cs
- IdentityHolder.cs
- HttpRequest.cs
- UriExt.cs
- FlowPosition.cs
- NavigationExpr.cs
- DataGridViewImageColumn.cs
- AutoResetEvent.cs
- ExpressionNormalizer.cs
- EndpointBehaviorElement.cs
- ControlDesigner.cs
- SqlRecordBuffer.cs
- ResponseBodyWriter.cs
- AuthorizationSection.cs
- HebrewNumber.cs
- SynchronousChannelMergeEnumerator.cs
- processwaithandle.cs
- IncrementalCompileAnalyzer.cs
- UpdateEventArgs.cs
- Clock.cs
- HttpBrowserCapabilitiesWrapper.cs
- XmlSchemaDatatype.cs
- ThreadAbortException.cs
- ContentOnlyMessage.cs
- BitmapSourceSafeMILHandle.cs
- Int16Converter.cs
- DataViewSettingCollection.cs
- DataGridViewAccessibleObject.cs
- XsdBuildProvider.cs
- DataAccessor.cs
- basevalidator.cs
- EntityKey.cs
- ProxyWebPart.cs
- DataServiceHostFactory.cs
- SqlGenericUtil.cs
- BehaviorEditorPart.cs
- EdmProperty.cs
- StreamWriter.cs
- DESCryptoServiceProvider.cs
- LocalizeDesigner.cs
- DataSetUtil.cs
- DataGridPageChangedEventArgs.cs
- SplitterEvent.cs
- SymmetricAlgorithm.cs
- EntityConnection.cs
- DataGridComboBoxColumn.cs
- ACE.cs
- ServerIdentity.cs
- LinkButton.cs
- XamlTypeMapper.cs
- XmlSchemaCollection.cs
- HttpModuleCollection.cs
- MergeLocalizationDirectives.cs
- MediaSystem.cs
- RelationshipNavigation.cs
- DeleteHelper.cs
- UserControlParser.cs