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
- UTF8Encoding.cs
- StringExpressionSet.cs
- PreviewPrintController.cs
- CompoundFileDeflateTransform.cs
- StorageMappingFragment.cs
- HebrewCalendar.cs
- DbProviderFactory.cs
- XPathExpr.cs
- ReflectPropertyDescriptor.cs
- Inline.cs
- XmlHierarchicalDataSourceView.cs
- TimeSpan.cs
- Selection.cs
- PinnedBufferMemoryStream.cs
- ContentElementCollection.cs
- SchemaImporter.cs
- Rect.cs
- ParseHttpDate.cs
- cookiecontainer.cs
- XamlDesignerSerializationManager.cs
- TransactionScopeDesigner.cs
- InvalidOleVariantTypeException.cs
- XmlSchemaRedefine.cs
- XmlSchemaSimpleTypeRestriction.cs
- ObjectItemLoadingSessionData.cs
- Hashtable.cs
- ErrorRuntimeConfig.cs
- SqlXml.cs
- BindingValueChangedEventArgs.cs
- Timeline.cs
- DataServiceQueryOfT.cs
- TransformConverter.cs
- SmtpException.cs
- HttpCookieCollection.cs
- ClientScriptItem.cs
- DataContractSerializerSection.cs
- SafeCertificateStore.cs
- SortExpressionBuilder.cs
- XsltLibrary.cs
- M3DUtil.cs
- XmlUtil.cs
- SharedRuntimeState.cs
- AppSecurityManager.cs
- TextRunTypographyProperties.cs
- Executor.cs
- CmsUtils.cs
- RequestReplyCorrelator.cs
- AutoResetEvent.cs
- StorageBasedPackageProperties.cs
- OrderedDictionaryStateHelper.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- BufferedGraphics.cs
- RuleSettings.cs
- SqlUtils.cs
- WebServiceMethodData.cs
- InkCanvasAutomationPeer.cs
- TextRunCache.cs
- SimpleBitVector32.cs
- EnumerableRowCollectionExtensions.cs
- TextBox.cs
- MexHttpBindingElement.cs
- HWStack.cs
- TextBoxView.cs
- ShadowGlyph.cs
- Propagator.JoinPropagator.cs
- TreeNodeStyle.cs
- PointAnimationUsingKeyFrames.cs
- Internal.cs
- QilDataSource.cs
- SvcMapFile.cs
- ArrayTypeMismatchException.cs
- PerformanceCounterPermissionAttribute.cs
- DrawingContextWalker.cs
- NumericPagerField.cs
- NameScopePropertyAttribute.cs
- StateManager.cs
- ItemCheckEvent.cs
- DataListItemCollection.cs
- BitmapEffectState.cs
- ClientFormsAuthenticationCredentials.cs
- SimpleWorkerRequest.cs
- InstanceDataCollectionCollection.cs
- IRCollection.cs
- HttpCacheParams.cs
- BuildResultCache.cs
- EntityDesignerDataSourceView.cs
- CreateRefExpr.cs
- WebConfigurationHost.cs
- StringAttributeCollection.cs
- SafeNativeMethods.cs
- FunctionImportElement.cs
- TraceListeners.cs
- SwitchDesigner.xaml.cs
- ScriptComponentDescriptor.cs
- OutOfProcStateClientManager.cs
- TransformCollection.cs
- InnerItemCollectionView.cs
- TableLayoutRowStyleCollection.cs
- ListViewCancelEventArgs.cs
- CssStyleCollection.cs