Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / followingquery.cs / 1305376 / 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
- RegisteredScript.cs
- StringTraceRecord.cs
- XmlCodeExporter.cs
- HTTPNotFoundHandler.cs
- XmlTypeAttribute.cs
- BreakSafeBase.cs
- BufferModeSettings.cs
- InternalsVisibleToAttribute.cs
- CalculatedColumn.cs
- Propagator.ExtentPlaceholderCreator.cs
- TreeNodeStyleCollection.cs
- Timer.cs
- ListView.cs
- AppModelKnownContentFactory.cs
- XmlDictionaryReader.cs
- X509ImageLogo.cs
- CodeIterationStatement.cs
- TabControlAutomationPeer.cs
- ConnectorSelectionGlyph.cs
- PageCache.cs
- CollaborationHelperFunctions.cs
- MemberPathMap.cs
- UnsafeNativeMethods.cs
- EventPrivateKey.cs
- PropertyInfo.cs
- FontStyle.cs
- FontFamilyConverter.cs
- SystemMulticastIPAddressInformation.cs
- ClientType.cs
- Axis.cs
- SignerInfo.cs
- RegisteredExpandoAttribute.cs
- XPathDocumentIterator.cs
- UIElement3D.cs
- XamlFxTrace.cs
- SchemaConstraints.cs
- ToolStripPanelDesigner.cs
- WindowsStatic.cs
- DataGridItemCollection.cs
- TypefaceCollection.cs
- SpeechSynthesizer.cs
- StringCollection.cs
- DesignBinding.cs
- SourceFileBuildProvider.cs
- BrushMappingModeValidation.cs
- AttachedAnnotationChangedEventArgs.cs
- ConfigurationElement.cs
- CodeExporter.cs
- MessageRpc.cs
- Context.cs
- NetworkInterface.cs
- BindingOperations.cs
- TypedTableHandler.cs
- EmptyStringExpandableObjectConverter.cs
- ServerIdentity.cs
- RolePrincipal.cs
- EmptyCollection.cs
- DateTimeFormatInfo.cs
- CodeAccessSecurityEngine.cs
- OleCmdHelper.cs
- SafeProcessHandle.cs
- ColumnWidthChangedEvent.cs
- CheckBoxPopupAdapter.cs
- PropertyMetadata.cs
- CalendarTable.cs
- TcpProcessProtocolHandler.cs
- StackSpiller.Temps.cs
- EditorResources.cs
- SettingsSavedEventArgs.cs
- CodeThrowExceptionStatement.cs
- WorkflowViewService.cs
- ReadonlyMessageFilter.cs
- TextTreeUndoUnit.cs
- FontSource.cs
- BaseProcessor.cs
- SessionStateUtil.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DetailsViewDeletedEventArgs.cs
- XDRSchema.cs
- SignatureDescription.cs
- WpfKnownType.cs
- PropertyGridCommands.cs
- ValidationHelper.cs
- CompositeKey.cs
- RelatedView.cs
- TreeNodeCollection.cs
- WebContext.cs
- DocumentViewerConstants.cs
- ThicknessKeyFrameCollection.cs
- InstanceDescriptor.cs
- HtmlInputImage.cs
- CodeTypeDeclaration.cs
- FloatSumAggregationOperator.cs
- ListItemCollection.cs
- HashCodeCombiner.cs
- Pen.cs
- LicenseManager.cs
- Condition.cs
- Themes.cs
- GridItemCollection.cs