Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / MergeFilterQuery.cs / 1305376 / MergeFilterQuery.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.Xml.Xsl; using System.Collections.Generic; internal sealed class MergeFilterQuery : CacheOutputQuery { private Query child; public MergeFilterQuery(Query input, Query child) : base(input) { this.child = child; } private MergeFilterQuery(MergeFilterQuery other) : base(other) { this.child = Clone(other.child); } public override void SetXsltContext(XsltContext xsltContext) { base.SetXsltContext(xsltContext); child.SetXsltContext(xsltContext); } public override object Evaluate(XPathNodeIterator nodeIterator) { base.Evaluate(nodeIterator); while (input.Advance() != null) { child.Evaluate(input); XPathNavigator node; while ((node = child.Advance()) != null) { Insert(outputBuffer, node); } } return this; } public override XPathNavigator MatchNode(XPathNavigator current) { XPathNavigator context = child.MatchNode(current); if (context == null) { return null; } context = input.MatchNode(context); if (context == null) { return null; } Evaluate(new XPathSingletonIterator(context.Clone(), /*moved:*/true)); XPathNavigator result = Advance(); while (result != null) { if (result.IsSamePosition(current)) { return context; } result = Advance(); } return null; } public override XPathNodeIterator Clone() { return new MergeFilterQuery(this); } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); child.PrintQuery(w); w.WriteEndElement(); } } } // 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.Xml.Xsl; using System.Collections.Generic; internal sealed class MergeFilterQuery : CacheOutputQuery { private Query child; public MergeFilterQuery(Query input, Query child) : base(input) { this.child = child; } private MergeFilterQuery(MergeFilterQuery other) : base(other) { this.child = Clone(other.child); } public override void SetXsltContext(XsltContext xsltContext) { base.SetXsltContext(xsltContext); child.SetXsltContext(xsltContext); } public override object Evaluate(XPathNodeIterator nodeIterator) { base.Evaluate(nodeIterator); while (input.Advance() != null) { child.Evaluate(input); XPathNavigator node; while ((node = child.Advance()) != null) { Insert(outputBuffer, node); } } return this; } public override XPathNavigator MatchNode(XPathNavigator current) { XPathNavigator context = child.MatchNode(current); if (context == null) { return null; } context = input.MatchNode(context); if (context == null) { return null; } Evaluate(new XPathSingletonIterator(context.Clone(), /*moved:*/true)); XPathNavigator result = Advance(); while (result != null) { if (result.IsSamePosition(current)) { return context; } result = Advance(); } return null; } public override XPathNodeIterator Clone() { return new MergeFilterQuery(this); } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); child.PrintQuery(w); w.WriteEndElement(); } } } // 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
- RectangleF.cs
- FixedTextView.cs
- ControlIdConverter.cs
- ObjectComplexPropertyMapping.cs
- TrackingProvider.cs
- ManagementDateTime.cs
- TaskbarItemInfo.cs
- ObjectTag.cs
- AsymmetricSignatureDeformatter.cs
- SettingsPropertyValueCollection.cs
- HtmlControlPersistable.cs
- DbgCompiler.cs
- _UriSyntax.cs
- RegistrySecurity.cs
- ProxyHelper.cs
- ISFClipboardData.cs
- EntityDataSourceValidationException.cs
- SchemaEntity.cs
- AdapterUtil.cs
- _IPv4Address.cs
- XmlElementList.cs
- InstanceView.cs
- MetadataArtifactLoaderComposite.cs
- DictionaryChange.cs
- RegexCaptureCollection.cs
- IconConverter.cs
- TextTreeTextElementNode.cs
- SoapWriter.cs
- Message.cs
- CuspData.cs
- FrameworkElement.cs
- XsltInput.cs
- TransformPattern.cs
- DocumentReferenceCollection.cs
- EntryIndex.cs
- RefreshEventArgs.cs
- ZoneButton.cs
- ValidationError.cs
- DBConcurrencyException.cs
- BaseParser.cs
- GlyphElement.cs
- X509CertificateClaimSet.cs
- InstanceLockedException.cs
- GridViewColumnHeaderAutomationPeer.cs
- SqlTopReducer.cs
- CompModSwitches.cs
- Point4D.cs
- EventBuilder.cs
- DrawingState.cs
- FieldToken.cs
- DecoderNLS.cs
- ResourcesGenerator.cs
- SwitchLevelAttribute.cs
- TabControl.cs
- MetadataStore.cs
- FormattedText.cs
- FigureHelper.cs
- SafeHandles.cs
- CollectionViewProxy.cs
- XsltSettings.cs
- FormViewPageEventArgs.cs
- RelatedImageListAttribute.cs
- CssClassPropertyAttribute.cs
- Pts.cs
- ExpressionBinding.cs
- WmiEventSink.cs
- Regex.cs
- XmlSchemaSimpleTypeUnion.cs
- ItemDragEvent.cs
- DesignerProperties.cs
- RuntimeIdentifierPropertyAttribute.cs
- _CommandStream.cs
- QuaternionAnimation.cs
- DispatcherFrame.cs
- EmptyStringExpandableObjectConverter.cs
- GlobalItem.cs
- JsonReaderDelegator.cs
- StringUtil.cs
- TreeView.cs
- FrameworkElement.cs
- OracleColumn.cs
- CrossSiteScriptingValidation.cs
- SafeCertificateContext.cs
- HttpRequestWrapper.cs
- DBSchemaTable.cs
- UnknownMessageReceivedEventArgs.cs
- BamlTreeUpdater.cs
- OdbcInfoMessageEvent.cs
- ValuePattern.cs
- EventListenerClientSide.cs
- XmlIterators.cs
- TableStyle.cs
- NamespaceQuery.cs
- SqlPersonalizationProvider.cs
- ValueTable.cs
- Exceptions.cs
- PreviewPrintController.cs
- AlternationConverter.cs
- WebPartConnection.cs
- ToolStripHighContrastRenderer.cs