Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- StructuredProperty.cs
- FileLevelControlBuilderAttribute.cs
- TextFormatterHost.cs
- MemberInitExpression.cs
- Attachment.cs
- XmlSerializableWriter.cs
- KeyGestureConverter.cs
- SecurityException.cs
- ServiceModelExtensionCollectionElement.cs
- DataShape.cs
- Column.cs
- AtomEntry.cs
- HelpHtmlBuilder.cs
- NativeMethodsCLR.cs
- StaticSiteMapProvider.cs
- XmlBoundElement.cs
- CellConstantDomain.cs
- ForEachAction.cs
- CompModSwitches.cs
- DataContext.cs
- GiveFeedbackEventArgs.cs
- SequentialOutput.cs
- MetadataArtifactLoaderFile.cs
- MissingManifestResourceException.cs
- BuilderPropertyEntry.cs
- UICuesEvent.cs
- ScaleTransform3D.cs
- ItemCollectionEditor.cs
- BindingExpressionUncommonField.cs
- TextServicesDisplayAttributePropertyRanges.cs
- RoutedUICommand.cs
- ZipIOModeEnforcingStream.cs
- Int64Animation.cs
- IApplicationTrustManager.cs
- HttpsTransportBindingElement.cs
- ExpressionsCollectionEditor.cs
- GeometryGroup.cs
- MailMessage.cs
- BitmapCodecInfo.cs
- Type.cs
- PackageDigitalSignatureManager.cs
- SessionStateItemCollection.cs
- Span.cs
- SeparatorAutomationPeer.cs
- SerializeAbsoluteContext.cs
- AsymmetricSignatureFormatter.cs
- COAUTHINFO.cs
- PolicyStatement.cs
- EditingCommands.cs
- WriteFileContext.cs
- CategoryGridEntry.cs
- XamlHostingSectionGroup.cs
- HttpWrapper.cs
- SafeHandles.cs
- SqlGatherProducedAliases.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- SimpleApplicationHost.cs
- ToolboxItemCollection.cs
- SystemColors.cs
- MachineKeySection.cs
- validationstate.cs
- BrowserCapabilitiesFactory.cs
- InfoCardServiceInstallComponent.cs
- FastPropertyAccessor.cs
- ApplicationManager.cs
- Stack.cs
- ProxyWebPartManager.cs
- Win32KeyboardDevice.cs
- TabItemWrapperAutomationPeer.cs
- TextDecorations.cs
- SoapHeaderAttribute.cs
- SystemColorTracker.cs
- CollectionConverter.cs
- WeakRefEnumerator.cs
- ValidationError.cs
- RoutedEventValueSerializer.cs
- WebSysDisplayNameAttribute.cs
- FileChangesMonitor.cs
- WindowsContainer.cs
- DbProviderManifest.cs
- SafeNativeMethods.cs
- TagMapInfo.cs
- ContainerParaClient.cs
- HtmlCommandAdapter.cs
- Attributes.cs
- CharEnumerator.cs
- IndexOutOfRangeException.cs
- COM2PropertyDescriptor.cs
- MulticastIPAddressInformationCollection.cs
- HttpMethodAttribute.cs
- CheckBoxStandardAdapter.cs
- NetSectionGroup.cs
- ManagedFilter.cs
- EventHandlingScope.cs
- Converter.cs
- DataServiceConfiguration.cs
- HttpPostLocalhostServerProtocol.cs
- Image.cs
- PersonalizationStateInfoCollection.cs
- WmlCommandAdapter.cs