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
- Track.cs
- AlignmentXValidation.cs
- UnsignedPublishLicense.cs
- ResourceManagerWrapper.cs
- EntitySqlQueryCacheKey.cs
- TagPrefixInfo.cs
- FormViewRow.cs
- DetailsViewCommandEventArgs.cs
- RijndaelCryptoServiceProvider.cs
- ValueHandle.cs
- DecoderExceptionFallback.cs
- ManagedWndProcTracker.cs
- TextRunCacheImp.cs
- WebPartsSection.cs
- SecurityUtils.cs
- VisualProxy.cs
- ConfigErrorGlyph.cs
- CustomError.cs
- Point3D.cs
- AccessText.cs
- ImageCodecInfo.cs
- CacheSection.cs
- LinearGradientBrush.cs
- PeerSecurityHelpers.cs
- TemplateControlCodeDomTreeGenerator.cs
- BrowsableAttribute.cs
- HttpRequestCacheValidator.cs
- XXXInfos.cs
- InputLangChangeEvent.cs
- HyperLinkColumn.cs
- DataPointer.cs
- FixedHyperLink.cs
- ObjectItemCollection.cs
- TextTreeInsertElementUndoUnit.cs
- XmlAnyAttributeAttribute.cs
- AssemblyBuilder.cs
- ExpandSegmentCollection.cs
- HtmlTableRowCollection.cs
- ClientBuildManager.cs
- TypeHelpers.cs
- RichTextBoxConstants.cs
- ReadOnlyObservableCollection.cs
- BitmapInitialize.cs
- DynamicRenderer.cs
- OpCodes.cs
- FocusWithinProperty.cs
- KoreanCalendar.cs
- CompressedStack.cs
- AstTree.cs
- IDictionary.cs
- MaxSessionCountExceededException.cs
- SynchronizationContext.cs
- DocumentOutline.cs
- WinCategoryAttribute.cs
- PathData.cs
- Deflater.cs
- Viewport3DAutomationPeer.cs
- HttpCookieCollection.cs
- MimeObjectFactory.cs
- HostTimeoutsElement.cs
- Win32Native.cs
- PrivateFontCollection.cs
- ObjectManager.cs
- UiaCoreApi.cs
- SQLInt64Storage.cs
- XamlReader.cs
- ArithmeticLiteral.cs
- StoreItemCollection.cs
- XmlRawWriter.cs
- ModuleElement.cs
- RuntimeConfigurationRecord.cs
- EnumValidator.cs
- GuidelineCollection.cs
- RepeatBehaviorConverter.cs
- SortAction.cs
- SecurityElement.cs
- StylusEventArgs.cs
- MDIClient.cs
- DataTableReader.cs
- AttributeCollection.cs
- ScalarOps.cs
- ListViewUpdatedEventArgs.cs
- ContentDefinition.cs
- FixedPageAutomationPeer.cs
- HttpClientCertificate.cs
- CacheSection.cs
- DataPagerCommandEventArgs.cs
- Effect.cs
- InputLangChangeRequestEvent.cs
- UniqueConstraint.cs
- TableRowCollection.cs
- ProtectedProviderSettings.cs
- QuotedStringFormatReader.cs
- CounterCreationData.cs
- TraceSwitch.cs
- TemplatedAdorner.cs
- PasswordBox.cs
- EntityContainer.cs
- ResourceDisplayNameAttribute.cs
- ExportOptions.cs