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
- UndoUnit.cs
- WinEventTracker.cs
- _Events.cs
- IList.cs
- SqlTopReducer.cs
- ObjectTag.cs
- Model3DGroup.cs
- XmlNodeReader.cs
- CallContext.cs
- ContentElement.cs
- ToolStripContentPanelRenderEventArgs.cs
- SqlProfileProvider.cs
- FilteredReadOnlyMetadataCollection.cs
- SudsWriter.cs
- DataViewManager.cs
- ParagraphVisual.cs
- HtmlInputControl.cs
- ApplicationServicesHostFactory.cs
- Hashtable.cs
- InitializerFacet.cs
- ConstraintEnumerator.cs
- XmlWriterSettings.cs
- PagesSection.cs
- DynamicUpdateCommand.cs
- XmlEntity.cs
- SetStoryboardSpeedRatio.cs
- Byte.cs
- FormView.cs
- DbModificationClause.cs
- SerializationAttributes.cs
- AppLevelCompilationSectionCache.cs
- JavaScriptString.cs
- UpWmlPageAdapter.cs
- EventMemberCodeDomSerializer.cs
- FixedPageStructure.cs
- XpsPackagingPolicy.cs
- SimpleFieldTemplateFactory.cs
- StylusSystemGestureEventArgs.cs
- securitycriticaldataformultiplegetandset.cs
- ScriptMethodAttribute.cs
- XmlSchemaRedefine.cs
- ISessionStateStore.cs
- HtmlInputControl.cs
- ListViewContainer.cs
- DiscoveryClientChannelFactory.cs
- XmlCharType.cs
- HtmlToClrEventProxy.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- FormatSettings.cs
- MsmqBindingElementBase.cs
- XmlArrayItemAttribute.cs
- XmlChildNodes.cs
- DataContractJsonSerializerOperationBehavior.cs
- FormCollection.cs
- SoapFaultCodes.cs
- EventProviderWriter.cs
- SymbolEqualComparer.cs
- DataServiceQueryException.cs
- DataQuery.cs
- SocketElement.cs
- TypeForwardedFromAttribute.cs
- NotCondition.cs
- ThreadPool.cs
- FolderBrowserDialog.cs
- Pool.cs
- FlowDocumentPageViewerAutomationPeer.cs
- IsolatedStorageFile.cs
- InvokePattern.cs
- RuntimeResourceSet.cs
- PathSegment.cs
- ModifierKeysValueSerializer.cs
- EmptyEnumerable.cs
- CountAggregationOperator.cs
- ClrPerspective.cs
- DefaultValueAttribute.cs
- FlowDocumentFormatter.cs
- WebPartExportVerb.cs
- AndCondition.cs
- DomainLiteralReader.cs
- SqlProfileProvider.cs
- ListBindingConverter.cs
- DeviceContexts.cs
- MethodCallConverter.cs
- CodeCatchClause.cs
- TraceContextEventArgs.cs
- NullRuntimeConfig.cs
- ConnectivityStatus.cs
- DataChangedEventManager.cs
- SmtpCommands.cs
- FormsAuthenticationEventArgs.cs
- ProxyWebPart.cs
- ExclusiveCanonicalizationTransform.cs
- IpcServerChannel.cs
- ComboBoxDesigner.cs
- ExecutionScope.cs
- PaginationProgressEventArgs.cs
- FixUp.cs
- SecurityDescriptor.cs
- DataBoundControlAdapter.cs
- _TLSstream.cs