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 / MergeFilterQuery.cs / 1 / 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
- ContentDisposition.cs
- HtmlTextArea.cs
- MatrixAnimationBase.cs
- XmlWriterSettings.cs
- ComboBox.cs
- DataColumnMappingCollection.cs
- XmlDataSourceNodeDescriptor.cs
- XmlAttributes.cs
- CustomTypeDescriptor.cs
- streamingZipPartStream.cs
- MenuItemAutomationPeer.cs
- DynamicDataRoute.cs
- TreeViewAutomationPeer.cs
- securestring.cs
- RankException.cs
- CreateUserWizard.cs
- TemplatingOptionsDialog.cs
- DiscoveryClientOutputChannel.cs
- NetworkInformationException.cs
- WebZone.cs
- DiffuseMaterial.cs
- ComplexPropertyEntry.cs
- FixedPageProcessor.cs
- ChannelServices.cs
- HttpDictionary.cs
- PrivilegedConfigurationManager.cs
- LoginCancelEventArgs.cs
- EmptyReadOnlyDictionaryInternal.cs
- HtmlTitle.cs
- PhonemeConverter.cs
- ParameterCollection.cs
- DrawListViewSubItemEventArgs.cs
- ResourceProviderFactory.cs
- SecurityManager.cs
- WebFaultException.cs
- PassportAuthenticationModule.cs
- querybuilder.cs
- DataGridViewElement.cs
- XmlCharType.cs
- CompilationUtil.cs
- XmlSecureResolver.cs
- SiteMapNodeItemEventArgs.cs
- NameObjectCollectionBase.cs
- oledbconnectionstring.cs
- OleDbConnectionFactory.cs
- Lease.cs
- PreProcessInputEventArgs.cs
- EventListener.cs
- RewritingValidator.cs
- JsonEncodingStreamWrapper.cs
- IChannel.cs
- RoleBoolean.cs
- AssociationSetEnd.cs
- ListItem.cs
- PreviewKeyDownEventArgs.cs
- TreePrinter.cs
- WebHeaderCollection.cs
- ListViewCommandEventArgs.cs
- CustomExpressionEventArgs.cs
- SmtpLoginAuthenticationModule.cs
- Page.cs
- AspNetHostingPermission.cs
- CacheAxisQuery.cs
- HwndTarget.cs
- CachedFontFamily.cs
- SettingsSavedEventArgs.cs
- ApplicationGesture.cs
- DetailsViewCommandEventArgs.cs
- DependencyPropertyValueSerializer.cs
- CodeBinaryOperatorExpression.cs
- CompilationUtil.cs
- LinqDataSourceInsertEventArgs.cs
- DelegateHelpers.Generated.cs
- ProfileGroupSettingsCollection.cs
- PagesChangedEventArgs.cs
- ObjectRef.cs
- AutomationIdentifierGuids.cs
- ModelFunctionTypeElement.cs
- CopyNodeSetAction.cs
- DataGridViewColumnCollection.cs
- ErrorRuntimeConfig.cs
- LifetimeServices.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- HtmlLink.cs
- EntryPointNotFoundException.cs
- ColorAnimationUsingKeyFrames.cs
- _HelperAsyncResults.cs
- ACL.cs
- WebPartZoneAutoFormat.cs
- Region.cs
- StopStoryboard.cs
- NonBatchDirectoryCompiler.cs
- ProviderSettingsCollection.cs
- DocumentViewerBaseAutomationPeer.cs
- BitmapEffectDrawing.cs
- FilterEventArgs.cs
- StyleHelper.cs
- NativeMethodsCLR.cs
- DataSourceHelper.cs
- DetailsViewUpdatedEventArgs.cs