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
- EventToken.cs
- SchemaReference.cs
- ADConnectionHelper.cs
- WebPartZoneCollection.cs
- PointHitTestResult.cs
- MethodAccessException.cs
- WebConfigurationHost.cs
- SiteMapProvider.cs
- RootProfilePropertySettingsCollection.cs
- QilXmlWriter.cs
- BinaryObjectReader.cs
- Int32Rect.cs
- TaskFormBase.cs
- CallbackValidatorAttribute.cs
- FieldDescriptor.cs
- ResourcesChangeInfo.cs
- SecurityManager.cs
- MergePropertyDescriptor.cs
- InteropBitmapSource.cs
- SectionUpdates.cs
- InputElement.cs
- ClientConfigurationSystem.cs
- PeerNameRegistration.cs
- CompiledQueryCacheKey.cs
- CachedBitmap.cs
- TCPListener.cs
- Property.cs
- MsmqOutputMessage.cs
- RtfControlWordInfo.cs
- login.cs
- EditorBrowsableAttribute.cs
- TableCellCollection.cs
- CustomCategoryAttribute.cs
- ContractTypeNameCollection.cs
- OracleInfoMessageEventArgs.cs
- TextContainerChangeEventArgs.cs
- ThreadAttributes.cs
- BitmapCodecInfo.cs
- MenuBindingsEditor.cs
- FilteredReadOnlyMetadataCollection.cs
- XmlAtomicValue.cs
- CssStyleCollection.cs
- PKCS1MaskGenerationMethod.cs
- WebHeaderCollection.cs
- Double.cs
- CollectionChangedEventManager.cs
- bidPrivateBase.cs
- StylesEditorDialog.cs
- PackWebResponse.cs
- SelectedGridItemChangedEvent.cs
- CheckBox.cs
- CollectionViewGroupInternal.cs
- ViewUtilities.cs
- InheritablePropertyChangeInfo.cs
- GroupLabel.cs
- ChtmlMobileTextWriter.cs
- ConsumerConnectionPoint.cs
- GenericTypeParameterBuilder.cs
- ThreadAttributes.cs
- ACL.cs
- HttpPostProtocolReflector.cs
- XmlMemberMapping.cs
- Quad.cs
- LiteralControl.cs
- Point3DAnimation.cs
- CryptoConfig.cs
- TypefaceMap.cs
- ResourceDisplayNameAttribute.cs
- RootBuilder.cs
- Number.cs
- TextDocumentView.cs
- ResizeGrip.cs
- DocumentGridContextMenu.cs
- UpdatePanelControlTrigger.cs
- Stroke.cs
- Sql8ConformanceChecker.cs
- JavaScriptObjectDeserializer.cs
- Repeater.cs
- DialogWindow.cs
- PeerDuplexChannel.cs
- XmlSignatureManifest.cs
- PictureBox.cs
- ProjectionCamera.cs
- PasswordPropertyTextAttribute.cs
- ThicknessConverter.cs
- assertwrapper.cs
- DesignerEditorPartChrome.cs
- ToolStripLabel.cs
- RtfToken.cs
- RangeBase.cs
- XamlParser.cs
- DoubleStorage.cs
- TypeExtensions.cs
- DrawingServices.cs
- SchemaNotation.cs
- DesignerListAdapter.cs
- TextElementEnumerator.cs
- TreeNodeStyleCollection.cs
- CodeDirectoryCompiler.cs
- Boolean.cs