Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Error.cs
- MSAANativeProvider.cs
- CounterSampleCalculator.cs
- DataGridColumn.cs
- DbTypeMap.cs
- SettingsAttributes.cs
- Assembly.cs
- XmlSchemaSimpleTypeRestriction.cs
- XmlAnyElementAttributes.cs
- Triangle.cs
- TypeSystem.cs
- SelectionGlyph.cs
- SchemaLookupTable.cs
- DataGridViewCell.cs
- SmiEventStream.cs
- SqlClientFactory.cs
- DateTimeOffset.cs
- Parameter.cs
- ConfigPathUtility.cs
- LinkedDataMemberFieldEditor.cs
- FormViewPageEventArgs.cs
- TextServicesDisplayAttribute.cs
- CodeLabeledStatement.cs
- Utils.cs
- MetadataPropertyCollection.cs
- XsdValidatingReader.cs
- HwndProxyElementProvider.cs
- SecurityElement.cs
- CodeIdentifier.cs
- ProxyHwnd.cs
- EntityDataSourceWrapper.cs
- BaseDataListActionList.cs
- SHA512Managed.cs
- QilValidationVisitor.cs
- ClientApiGenerator.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- ToggleButtonAutomationPeer.cs
- PriorityRange.cs
- ExtensionSimplifierMarkupObject.cs
- ScrollData.cs
- assertwrapper.cs
- RestHandlerFactory.cs
- XslVisitor.cs
- Rijndael.cs
- HybridDictionary.cs
- XmlSubtreeReader.cs
- DataGridPageChangedEventArgs.cs
- Vector3DConverter.cs
- CodeStatementCollection.cs
- MaterialGroup.cs
- SchemaRegistration.cs
- LoadWorkflowCommand.cs
- DnsPermission.cs
- DrawingAttributesDefaultValueFactory.cs
- contentDescriptor.cs
- SqlDataSourceView.cs
- ToolStripContentPanel.cs
- FlowLayoutPanelDesigner.cs
- ResourceWriter.cs
- TextStore.cs
- WorkflowViewService.cs
- BrowserCapabilitiesFactory.cs
- OdbcConnectionHandle.cs
- ToolStripCollectionEditor.cs
- ConfigurationManagerHelper.cs
- ReachObjectContext.cs
- StylusButtonEventArgs.cs
- TypeConverterHelper.cs
- TableRowCollection.cs
- ActivityValidator.cs
- AuthorizationContext.cs
- FlowchartSizeFeature.cs
- XPathEmptyIterator.cs
- StorageEntityTypeMapping.cs
- LoginCancelEventArgs.cs
- VariableAction.cs
- CaseExpr.cs
- DataService.cs
- MethodImplAttribute.cs
- WebColorConverter.cs
- HtmlInputButton.cs
- CacheEntry.cs
- SupportsEventValidationAttribute.cs
- Storyboard.cs
- ResXFileRef.cs
- DropDownButton.cs
- GridLengthConverter.cs
- Transform3D.cs
- PenLineCapValidation.cs
- SerializationInfoEnumerator.cs
- MDIWindowDialog.cs
- Path.cs
- TextServicesLoader.cs
- Debug.cs
- OnOperation.cs
- WebPartEditorCancelVerb.cs
- ListControlConvertEventArgs.cs
- StylusShape.cs
- ConstraintConverter.cs
- WorkflowRuntimeEndpoint.cs