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 / 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
- StringStorage.cs
- TableColumn.cs
- SpellerHighlightLayer.cs
- Privilege.cs
- ZoneIdentityPermission.cs
- PenCursorManager.cs
- DoubleConverter.cs
- BoundsDrawingContextWalker.cs
- TableRow.cs
- TextEditor.cs
- BufferModeSettings.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TextTrailingWordEllipsis.cs
- WsatServiceCertificate.cs
- Interop.cs
- ServerIdentity.cs
- OdbcDataAdapter.cs
- ClusterUtils.cs
- StylesEditorDialog.cs
- EventLogWatcher.cs
- TypeResolver.cs
- FunctionUpdateCommand.cs
- ItemCheckedEvent.cs
- ExportException.cs
- X509Certificate2Collection.cs
- ImageMap.cs
- MailWebEventProvider.cs
- Util.cs
- XmlElementAttributes.cs
- HuffModule.cs
- TranslateTransform3D.cs
- MDIControlStrip.cs
- Stack.cs
- StoreContentChangedEventArgs.cs
- DynamicPropertyReader.cs
- PatternMatcher.cs
- UserControl.cs
- ErrorFormatterPage.cs
- UserNameSecurityTokenAuthenticator.cs
- WindowsSecurityTokenAuthenticator.cs
- ConcurrentBag.cs
- DropSourceBehavior.cs
- EventMappingSettingsCollection.cs
- OleDbStruct.cs
- TextBox.cs
- ElementAtQueryOperator.cs
- SoapExtensionImporter.cs
- TypedDataSourceCodeGenerator.cs
- PropertySourceInfo.cs
- ProfileProvider.cs
- BitConverter.cs
- DataGridRelationshipRow.cs
- ListViewDeletedEventArgs.cs
- LogAppendAsyncResult.cs
- ItemAutomationPeer.cs
- ParseChildrenAsPropertiesAttribute.cs
- MiniModule.cs
- ListBoxItemAutomationPeer.cs
- PasswordPropertyTextAttribute.cs
- DefaultSerializationProviderAttribute.cs
- RequestQueue.cs
- DockPanel.cs
- ParserContext.cs
- GiveFeedbackEvent.cs
- SafeBitVector32.cs
- HybridDictionary.cs
- DispatchChannelSink.cs
- TemplateControlParser.cs
- DocumentPageView.cs
- DbConnectionFactory.cs
- XmlSchemaSimpleContentExtension.cs
- Form.cs
- AssociatedControlConverter.cs
- ImageFormat.cs
- ScriptManagerProxy.cs
- WindowAutomationPeer.cs
- VBCodeProvider.cs
- _LazyAsyncResult.cs
- WindowsToolbar.cs
- ExtenderProvidedPropertyAttribute.cs
- UntypedNullExpression.cs
- PassportAuthentication.cs
- DataGridViewCheckBoxColumn.cs
- AppDomainProtocolHandler.cs
- XmlElementAttribute.cs
- Helper.cs
- ProfessionalColors.cs
- HttpBufferlessInputStream.cs
- HtmlElementEventArgs.cs
- FrameworkContentElement.cs
- StrokeNodeOperations2.cs
- UnsafeNativeMethodsMilCoreApi.cs
- BindingRestrictions.cs
- IgnoreSectionHandler.cs
- Timer.cs
- TableSectionStyle.cs
- FrameworkTemplate.cs
- basevalidator.cs
- FormsAuthenticationTicket.cs
- WebConvert.cs