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
- MailSettingsSection.cs
- PeerCollaborationPermission.cs
- DataGridTextBox.cs
- Exceptions.cs
- XmlElement.cs
- XmlSerializerNamespaces.cs
- AddInActivator.cs
- DataGridDesigner.cs
- BitmapEffect.cs
- ItemCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- Base64Decoder.cs
- ToolStripSettings.cs
- ArrayWithOffset.cs
- XmlUrlResolver.cs
- HtmlInputCheckBox.cs
- HeaderedItemsControl.cs
- CodeTypeDelegate.cs
- OuterGlowBitmapEffect.cs
- DeviceContext.cs
- IsolatedStorageException.cs
- DataSourceSelectArguments.cs
- VirtualPath.cs
- SiteMapPath.cs
- EnumUnknown.cs
- ReceiveActivityDesignerTheme.cs
- DirectoryObjectSecurity.cs
- DifferencingCollection.cs
- EntityViewGenerator.cs
- OpenFileDialog.cs
- TextDecorations.cs
- ItemList.cs
- CalloutQueueItem.cs
- QualificationDataItem.cs
- Control.cs
- NodeLabelEditEvent.cs
- FormsIdentity.cs
- XmlILOptimizerVisitor.cs
- SessionViewState.cs
- ObjectDesignerDataSourceView.cs
- SchemaInfo.cs
- Lock.cs
- httpapplicationstate.cs
- NavigationFailedEventArgs.cs
- ResourceAttributes.cs
- XmlSerializationWriter.cs
- TranslateTransform.cs
- UntypedNullExpression.cs
- shaperfactory.cs
- DataObjectPastingEventArgs.cs
- FieldMetadata.cs
- ConfigurationElementProperty.cs
- ParseChildrenAsPropertiesAttribute.cs
- LongTypeConverter.cs
- BasicKeyConstraint.cs
- PathTooLongException.cs
- PeerTransportBindingElement.cs
- GeometryGroup.cs
- ReadOnlyDataSourceView.cs
- TextProviderWrapper.cs
- FollowerQueueCreator.cs
- PropertyDescriptorCollection.cs
- SingleAnimationUsingKeyFrames.cs
- DataRecordInfo.cs
- TraceContext.cs
- DocumentOrderQuery.cs
- WsatAdminException.cs
- AsymmetricSignatureFormatter.cs
- TextServicesDisplayAttribute.cs
- KoreanCalendar.cs
- ExceptionUtil.cs
- TextWriterEngine.cs
- VisualCollection.cs
- Pkcs9Attribute.cs
- ImageListUtils.cs
- OneToOneMappingSerializer.cs
- ColumnWidthChangingEvent.cs
- DynamicDataRoute.cs
- IntellisenseTextBox.designer.cs
- XmlSchemas.cs
- TabControlCancelEvent.cs
- XmlSchemaCompilationSettings.cs
- UndirectedGraph.cs
- CalendarAutoFormat.cs
- ObjectHelper.cs
- OdbcRowUpdatingEvent.cs
- SecurityState.cs
- WpfWebRequestHelper.cs
- ExceptionRoutedEventArgs.cs
- WSFederationHttpBindingElement.cs
- DataGridViewCellStyleEditor.cs
- HwndMouseInputProvider.cs
- SmtpReplyReaderFactory.cs
- Gdiplus.cs
- AssemblyInfo.cs
- HtmlInputControl.cs
- HostingEnvironmentException.cs
- RecordConverter.cs
- CodeStatement.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs