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
- ErasingStroke.cs
- DataMisalignedException.cs
- SafeFindHandle.cs
- TemplateKeyConverter.cs
- Filter.cs
- AssociationType.cs
- PolyQuadraticBezierSegment.cs
- thaishape.cs
- ExpressionBuilder.cs
- ManagementOptions.cs
- LineBreak.cs
- ProxyWebPartConnectionCollection.cs
- MessagePropertyVariants.cs
- ErrorFormatterPage.cs
- SqlIdentifier.cs
- CornerRadius.cs
- GroupQuery.cs
- ListenerChannelContext.cs
- AssemblyHash.cs
- ListParaClient.cs
- SamlAttribute.cs
- EditingCoordinator.cs
- CompilerErrorCollection.cs
- MetadataItem_Static.cs
- MethodToken.cs
- Int64.cs
- RichTextBoxAutomationPeer.cs
- DrawingVisual.cs
- SqlDataSourceFilteringEventArgs.cs
- TraceSection.cs
- CodeIdentifiers.cs
- AsyncPostBackErrorEventArgs.cs
- EncoderParameters.cs
- PanelStyle.cs
- SafeEventHandle.cs
- WSFederationHttpBindingCollectionElement.cs
- DataGridViewTextBoxEditingControl.cs
- DSASignatureDeformatter.cs
- CompositeDataBoundControl.cs
- DoubleCollection.cs
- HashCoreRequest.cs
- PropertiesTab.cs
- WmlFormAdapter.cs
- BindingContext.cs
- IsolatedStorageFileStream.cs
- CodeNamespaceImport.cs
- TextServicesLoader.cs
- FlatButtonAppearance.cs
- SessionParameter.cs
- Error.cs
- FrameDimension.cs
- FlowDocumentReaderAutomationPeer.cs
- DataStreamFromComStream.cs
- RangeValueProviderWrapper.cs
- FilteredXmlReader.cs
- DesignerHierarchicalDataSourceView.cs
- _FixedSizeReader.cs
- Simplifier.cs
- DataSourceHelper.cs
- OptionUsage.cs
- XmlSchema.cs
- DayRenderEvent.cs
- DataGridPreparingCellForEditEventArgs.cs
- SelectedCellsChangedEventArgs.cs
- CatalogZone.cs
- IncrementalHitTester.cs
- CacheOutputQuery.cs
- NetworkInformationException.cs
- FlowDocumentReader.cs
- UInt32Storage.cs
- RtType.cs
- EditorBrowsableAttribute.cs
- TypeDelegator.cs
- AtomEntry.cs
- QuaternionValueSerializer.cs
- DataMemberFieldConverter.cs
- KnownTypesHelper.cs
- ChangeTracker.cs
- EditorZone.cs
- RuleSettingsCollection.cs
- NameValueCollection.cs
- ObjectDataSourceEventArgs.cs
- ParagraphVisual.cs
- RegisteredScript.cs
- ConfigurationLockCollection.cs
- SmiConnection.cs
- LocalizabilityAttribute.cs
- TrackBarRenderer.cs
- StrongNameUtility.cs
- ChannelManager.cs
- DataGridRow.cs
- CommandValueSerializer.cs
- TdsParser.cs
- CodeDirectionExpression.cs
- LiteralControl.cs
- SimpleLine.cs
- MLangCodePageEncoding.cs
- Line.cs
- EdmComplexPropertyAttribute.cs
- SqlTypeConverter.cs