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
- ProcessHostMapPath.cs
- EnumValidator.cs
- TimeZone.cs
- DataSourceHelper.cs
- StringFreezingAttribute.cs
- InstalledVoice.cs
- StylusDownEventArgs.cs
- LocatorGroup.cs
- HtmlTable.cs
- ProvideValueServiceProvider.cs
- XmlSignatureProperties.cs
- SchemaTypeEmitter.cs
- path.cs
- TypeUtil.cs
- NeutralResourcesLanguageAttribute.cs
- GridSplitter.cs
- DateTimeValueSerializerContext.cs
- OleServicesContext.cs
- MenuAdapter.cs
- AggregateNode.cs
- TrackBarDesigner.cs
- ProviderBase.cs
- Exceptions.cs
- _BufferOffsetSize.cs
- AddingNewEventArgs.cs
- UIElement3D.cs
- LabelEditEvent.cs
- DataGridViewLinkColumn.cs
- FixUp.cs
- SchemaTableOptionalColumn.cs
- TextLineBreak.cs
- ConstrainedDataObject.cs
- ConfigXmlCDataSection.cs
- VirtualizedCellInfoCollection.cs
- GroupItem.cs
- PartialTrustHelpers.cs
- DateTimeSerializationSection.cs
- CodeSubDirectory.cs
- WindowsNonControl.cs
- DataKeyArray.cs
- TableChangeProcessor.cs
- XPathBuilder.cs
- DecimalFormatter.cs
- Accessible.cs
- Configuration.cs
- IndividualDeviceConfig.cs
- FileUtil.cs
- CodeAttributeArgument.cs
- ExtendedPropertiesHandler.cs
- SchemaImporterExtensionElement.cs
- OptimizerPatterns.cs
- RenderDataDrawingContext.cs
- Int32RectConverter.cs
- DesignerWithHeader.cs
- Matrix.cs
- ProgramNode.cs
- ProfilePropertyNameValidator.cs
- BitmapCacheBrush.cs
- DataGridViewRowsAddedEventArgs.cs
- WorkflowMessageEventArgs.cs
- StringValidatorAttribute.cs
- AmbientLight.cs
- XmlSchemaChoice.cs
- ObjectToIdCache.cs
- BitmapEffectDrawingContent.cs
- ValueTypeFixupInfo.cs
- PerCallInstanceContextProvider.cs
- DataGridViewButtonColumn.cs
- BitmapMetadataEnumerator.cs
- SqlDataSourceCommandEventArgs.cs
- Vector3DAnimationBase.cs
- IssuedTokenClientBehaviorsElement.cs
- Repeater.cs
- TemplateColumn.cs
- SubclassTypeValidatorAttribute.cs
- AnimationStorage.cs
- ItemChangedEventArgs.cs
- Timer.cs
- TextProperties.cs
- QuotedPairReader.cs
- RoutedCommand.cs
- XmlSchemaFacet.cs
- ApplicationDirectory.cs
- TypeDescriptionProvider.cs
- _BaseOverlappedAsyncResult.cs
- TextWriterEngine.cs
- SendKeys.cs
- ExtendedTransformFactory.cs
- _LoggingObject.cs
- XmlSchemaParticle.cs
- CorrelationToken.cs
- SqlDelegatedTransaction.cs
- SocketElement.cs
- FixUp.cs
- CodeGen.cs
- BufferModesCollection.cs
- DataSourceProvider.cs
- RedirectionProxy.cs
- ImageAttributes.cs
- CDSsyncETWBCLProvider.cs