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
- ProviderException.cs
- DataColumnMappingCollection.cs
- RepeaterItem.cs
- PersonalizationEntry.cs
- UIElementParaClient.cs
- PropertyItem.cs
- UrlMapping.cs
- WebPartTransformer.cs
- OdbcUtils.cs
- SqlComparer.cs
- NullableBoolConverter.cs
- XomlCompiler.cs
- tabpagecollectioneditor.cs
- WrappedIUnknown.cs
- InputScopeAttribute.cs
- LocalizeDesigner.cs
- PersistChildrenAttribute.cs
- StateDesigner.CommentLayoutGlyph.cs
- DataObjectFieldAttribute.cs
- TcpTransportSecurity.cs
- ExitEventArgs.cs
- QualifiedCellIdBoolean.cs
- XmlElement.cs
- ExceptionRoutedEventArgs.cs
- GcSettings.cs
- Package.cs
- EntityWrapper.cs
- ManagementDateTime.cs
- GeneralTransform.cs
- FontStretch.cs
- ByteKeyFrameCollection.cs
- DynamicPropertyHolder.cs
- ListViewDeleteEventArgs.cs
- CFStream.cs
- SystemNetworkInterface.cs
- BitmapInitialize.cs
- RoamingStoreFile.cs
- DataGridViewButtonColumn.cs
- ColumnCollection.cs
- SortedSet.cs
- Rectangle.cs
- RegionInfo.cs
- SqlCacheDependencyDatabase.cs
- MenuCommand.cs
- Point4D.cs
- TryExpression.cs
- StylusPointPropertyUnit.cs
- IIS7UserPrincipal.cs
- ManagedIStream.cs
- PointLight.cs
- ThaiBuddhistCalendar.cs
- ListItemCollection.cs
- SecurityKeyType.cs
- EventLog.cs
- TreeViewItemAutomationPeer.cs
- HealthMonitoringSection.cs
- UpWmlPageAdapter.cs
- XmlSchemaObject.cs
- ColorAnimationBase.cs
- MessageTransmitTraceRecord.cs
- WebControlAdapter.cs
- initElementDictionary.cs
- X509ChainPolicy.cs
- EdmProviderManifest.cs
- RawMouseInputReport.cs
- SupportsEventValidationAttribute.cs
- TextServicesContext.cs
- MouseGestureConverter.cs
- TraceSection.cs
- UriPrefixTable.cs
- SqlBuffer.cs
- StateWorkerRequest.cs
- COM2FontConverter.cs
- WebScriptEnablingElement.cs
- IntMinMaxAggregationOperator.cs
- Validator.cs
- ControlPaint.cs
- DataGridViewRowCollection.cs
- DataRowCollection.cs
- CodeIterationStatement.cs
- Trace.cs
- DataExpression.cs
- XMLUtil.cs
- IdentityHolder.cs
- ProviderConnectionPoint.cs
- RadioButtonFlatAdapter.cs
- BinaryWriter.cs
- InputLanguageCollection.cs
- Psha1DerivedKeyGenerator.cs
- DataPagerFieldCommandEventArgs.cs
- CodeArrayIndexerExpression.cs
- HwndSubclass.cs
- CombinedTcpChannel.cs
- ColumnHeaderConverter.cs
- TextAutomationPeer.cs
- DictionaryContent.cs
- Stackframe.cs
- StateRuntime.cs
- DataGridGeneralPage.cs
- ProfileSettingsCollection.cs