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 / ChildrenQuery.cs / 1 / ChildrenQuery.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; using System.Globalization; using System.Xml.Xsl; using System.Collections; internal class ChildrenQuery : BaseAxisQuery { XPathNodeIterator iterator = XPathEmptyIterator.Instance; public ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type) : base (qyInput, name, prefix, type) {} protected ChildrenQuery(ChildrenQuery other) : base(other) { this.iterator = Clone(other.iterator); } public override void Reset() { iterator = XPathEmptyIterator.Instance; base.Reset(); } public override XPathNavigator Advance() { while (!iterator.MoveNext()) { XPathNavigator input = qyInput.Advance(); if (input == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { iterator = new IteratorFilter(input.SelectChildren(TypeTest), Name); } else { iterator = input.SelectChildren(Name, Namespace); } } else { iterator = input.SelectChildren(TypeTest); } position = 0; } position ++; currentNode = iterator.Current; return currentNode; } // Advance public sealed override XPathNavigator MatchNode(XPathNavigator context) { if (context != null) { if (matches(context)) { XPathNavigator temp = context.Clone(); if (temp.NodeType != XPathNodeType.Attribute && temp.MoveToParent()) { return qyInput.MatchNode(temp); } return null; } } return null; } public override XPathNodeIterator Clone() { return new ChildrenQuery(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; using System.Globalization; using System.Xml.Xsl; using System.Collections; internal class ChildrenQuery : BaseAxisQuery { XPathNodeIterator iterator = XPathEmptyIterator.Instance; public ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type) : base (qyInput, name, prefix, type) {} protected ChildrenQuery(ChildrenQuery other) : base(other) { this.iterator = Clone(other.iterator); } public override void Reset() { iterator = XPathEmptyIterator.Instance; base.Reset(); } public override XPathNavigator Advance() { while (!iterator.MoveNext()) { XPathNavigator input = qyInput.Advance(); if (input == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { iterator = new IteratorFilter(input.SelectChildren(TypeTest), Name); } else { iterator = input.SelectChildren(Name, Namespace); } } else { iterator = input.SelectChildren(TypeTest); } position = 0; } position ++; currentNode = iterator.Current; return currentNode; } // Advance public sealed override XPathNavigator MatchNode(XPathNavigator context) { if (context != null) { if (matches(context)) { XPathNavigator temp = context.Clone(); if (temp.NodeType != XPathNodeType.Attribute && temp.MoveToParent()) { return qyInput.MatchNode(temp); } return null; } } return null; } public override XPathNodeIterator Clone() { return new ChildrenQuery(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
- TaskForm.cs
- FormViewInsertEventArgs.cs
- HierarchicalDataBoundControl.cs
- _ShellExpression.cs
- XmlCodeExporter.cs
- WebPartActionVerb.cs
- ControlCollection.cs
- MemberPathMap.cs
- versioninfo.cs
- BypassElementCollection.cs
- DrawingAttributesDefaultValueFactory.cs
- SqlServer2KCompatibilityCheck.cs
- DataGridViewComboBoxEditingControl.cs
- VsPropertyGrid.cs
- WebPartMenu.cs
- VerificationException.cs
- SspiSecurityTokenParameters.cs
- FontFamily.cs
- KeyFrames.cs
- HttpHandlerActionCollection.cs
- TextPointer.cs
- XmlDictionaryReader.cs
- PieceDirectory.cs
- ToolStripSeparatorRenderEventArgs.cs
- Control.cs
- SnapshotChangeTrackingStrategy.cs
- TabControlEvent.cs
- Typeface.cs
- ProfilePropertySettings.cs
- BinHexDecoder.cs
- TableDetailsCollection.cs
- ViewKeyConstraint.cs
- TableCell.cs
- CheckPair.cs
- ComponentDispatcher.cs
- TriggerAction.cs
- MergablePropertyAttribute.cs
- WeakRefEnumerator.cs
- TextOutput.cs
- ReliabilityContractAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- RelOps.cs
- MultiAsyncResult.cs
- ScriptingWebServicesSectionGroup.cs
- TypeListConverter.cs
- NotifyParentPropertyAttribute.cs
- ProjectionPathSegment.cs
- BoundColumn.cs
- ContentType.cs
- GeneralTransform3DCollection.cs
- XmlQueryCardinality.cs
- HtmlSelect.cs
- TypeDescriptionProvider.cs
- TabControlEvent.cs
- CompilationUtil.cs
- DataGridRowsPresenter.cs
- FormsAuthenticationConfiguration.cs
- RunClient.cs
- COM2ICategorizePropertiesHandler.cs
- ScopelessEnumAttribute.cs
- _emptywebproxy.cs
- ApplicationException.cs
- OrderedDictionary.cs
- ObjectDataSourceStatusEventArgs.cs
- EventMemberCodeDomSerializer.cs
- ErrorReporting.cs
- PropertyManager.cs
- DrawingVisual.cs
- RestHandlerFactory.cs
- XamlGridLengthSerializer.cs
- ClientProtocol.cs
- XpsStructure.cs
- SessionMode.cs
- NativeMethods.cs
- ConstrainedDataObject.cs
- FontCollection.cs
- TagMapCollection.cs
- WebPartTransformerCollection.cs
- Matrix3DStack.cs
- FrameworkTextComposition.cs
- RepeaterItem.cs
- StorageEntityTypeMapping.cs
- CssStyleCollection.cs
- DataSourceHelper.cs
- BaseDataList.cs
- TextCharacters.cs
- ProgressBarBrushConverter.cs
- LookupBindingPropertiesAttribute.cs
- ViewCellSlot.cs
- LinqExpressionNormalizer.cs
- WindowsAuthenticationModule.cs
- EventProviderWriter.cs
- SqlParameterCollection.cs
- XmlTextWriter.cs
- WebPartEditVerb.cs
- EntityDataSourceDesigner.cs
- InvalidFilterCriteriaException.cs
- EntityViewContainer.cs
- WebReferencesBuildProvider.cs
- DefaultClaimSet.cs