Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- OleDbEnumerator.cs
- TableLayoutStyle.cs
- TemplateBindingExpressionConverter.cs
- RSAProtectedConfigurationProvider.cs
- BamlLocalizableResource.cs
- NumericPagerField.cs
- Point3D.cs
- EntityDataSourceQueryBuilder.cs
- WorkflowClientDeliverMessageWrapper.cs
- TreeViewDesigner.cs
- SingleResultAttribute.cs
- ContractTypeNameCollection.cs
- HtmlTableRow.cs
- CodeDOMProvider.cs
- ActivityInstanceReference.cs
- ProfessionalColorTable.cs
- ConnectionInterfaceCollection.cs
- IgnoreSectionHandler.cs
- DataGridViewMethods.cs
- XmlNodeReader.cs
- RefreshPropertiesAttribute.cs
- DummyDataSource.cs
- InvokeWebServiceDesigner.cs
- FixedSOMTableCell.cs
- ReadOnlyObservableCollection.cs
- InfocardInteractiveChannelInitializer.cs
- EmissiveMaterial.cs
- BamlLocalizableResourceKey.cs
- WorkflowDesigner.cs
- UnicodeEncoding.cs
- ProfilePropertyNameValidator.cs
- ProjectionPathSegment.cs
- XmlSchemaChoice.cs
- ListDictionaryInternal.cs
- StackOverflowException.cs
- SQLGuidStorage.cs
- IISUnsafeMethods.cs
- RoleServiceManager.cs
- RenderOptions.cs
- HopperCache.cs
- FontSource.cs
- CryptoApi.cs
- BooleanKeyFrameCollection.cs
- RoutedEventArgs.cs
- DataSourceCacheDurationConverter.cs
- SecurityManager.cs
- Internal.cs
- Version.cs
- DuplexClientBase.cs
- ArrayEditor.cs
- BitmapImage.cs
- GraphicsPathIterator.cs
- ContainerActivationHelper.cs
- NonDualMessageSecurityOverHttp.cs
- SequenceQuery.cs
- AspCompat.cs
- BindableAttribute.cs
- ListViewAutomationPeer.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- OpenTypeLayout.cs
- StreamGeometry.cs
- ProtocolsConfiguration.cs
- MeasurementDCInfo.cs
- DatatypeImplementation.cs
- AsmxEndpointPickerExtension.cs
- XmlSchemaGroup.cs
- dbdatarecord.cs
- XmlEntityReference.cs
- DataGridViewBand.cs
- DataGridViewCheckBoxCell.cs
- XPathScanner.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- MetafileHeaderEmf.cs
- BinaryFormatter.cs
- BatchParser.cs
- UnsafeNativeMethodsMilCoreApi.cs
- PenCursorManager.cs
- Int16.cs
- DesignTimeTemplateParser.cs
- ListViewGroupItemCollection.cs
- LocalizationParserHooks.cs
- QueryOperatorEnumerator.cs
- InputElement.cs
- XmlSchemaSimpleTypeRestriction.cs
- SinglePageViewer.cs
- FilterableAttribute.cs
- UIElementParagraph.cs
- TableAdapterManagerNameHandler.cs
- HttpListenerPrefixCollection.cs
- TraversalRequest.cs
- EdmItemCollection.cs
- NavigatingCancelEventArgs.cs
- IsolationInterop.cs
- mil_sdk_version.cs
- XPathDocumentNavigator.cs
- JsonWriter.cs
- HtmlTableCell.cs
- SpotLight.cs
- CachedTypeface.cs
- DynamicRouteExpression.cs