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
- ListBindingHelper.cs
- Privilege.cs
- NumericUpDownAcceleration.cs
- PageThemeBuildProvider.cs
- DayRenderEvent.cs
- RowSpanVector.cs
- RegexParser.cs
- BaseUriHelper.cs
- ConcatQueryOperator.cs
- HelloMessage11.cs
- InlineObject.cs
- TreeView.cs
- WebPartVerbsEventArgs.cs
- ToolStripGrip.cs
- AuthenticationManager.cs
- SortDescriptionCollection.cs
- SupportingTokenAuthenticatorSpecification.cs
- DocumentGridContextMenu.cs
- RuleProcessor.cs
- PointConverter.cs
- BamlBinaryWriter.cs
- BindMarkupExtensionSerializer.cs
- ColorConverter.cs
- Encoder.cs
- Column.cs
- XXXInfos.cs
- BmpBitmapDecoder.cs
- VisualStyleElement.cs
- FormViewPagerRow.cs
- SmtpMail.cs
- RequestDescription.cs
- SelectionProviderWrapper.cs
- GeneralTransform3DTo2DTo3D.cs
- KeyPressEvent.cs
- NumericUpDownAcceleration.cs
- ResXResourceReader.cs
- XsltException.cs
- SolidBrush.cs
- PropertyChangingEventArgs.cs
- IIS7WorkerRequest.cs
- StickyNoteHelper.cs
- ResourcesBuildProvider.cs
- MarshalDirectiveException.cs
- WSSecurityTokenSerializer.cs
- CompiledQueryCacheKey.cs
- FileLevelControlBuilderAttribute.cs
- GcHandle.cs
- NegatedCellConstant.cs
- HeaderCollection.cs
- ImageCodecInfo.cs
- LifetimeServices.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- HelpEvent.cs
- MetadataItemEmitter.cs
- DataGridViewMethods.cs
- SecurityContext.cs
- ViewCellSlot.cs
- FormsAuthenticationUserCollection.cs
- Facet.cs
- FileSystemInfo.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- DataServiceCollectionOfT.cs
- FlowDocumentReaderAutomationPeer.cs
- BitStack.cs
- PassportAuthentication.cs
- TemplateBindingExpressionConverter.cs
- WindowsScrollBarBits.cs
- VirtualPathData.cs
- ErrorStyle.cs
- XmlNodeReader.cs
- EmptyEnumerable.cs
- WrappedIUnknown.cs
- ClientUtils.cs
- UTF8Encoding.cs
- ConsoleEntryPoint.cs
- DESCryptoServiceProvider.cs
- CLRBindingWorker.cs
- Validator.cs
- CurrentChangingEventManager.cs
- ClaimTypes.cs
- PeerInvitationResponse.cs
- URL.cs
- DataGridCell.cs
- filewebrequest.cs
- StackSpiller.Bindings.cs
- DbConnectionFactory.cs
- TextElement.cs
- SystemException.cs
- PenThread.cs
- HealthMonitoringSection.cs
- TemplatingOptionsDialog.cs
- SqlXmlStorage.cs
- ToolStripScrollButton.cs
- DSASignatureDeformatter.cs
- DbCommandTree.cs
- UnaryExpression.cs
- xsdvalidator.cs
- ToolBarButtonClickEvent.cs
- CollectionsUtil.cs
- FlowLayoutSettings.cs