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 / 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
- SafeThemeHandle.cs
- CSharpCodeProvider.cs
- PersistenceMetadataNamespace.cs
- ControlUtil.cs
- TypeConverterAttribute.cs
- ProxyWebPart.cs
- TableRowGroup.cs
- FixedSOMImage.cs
- TreeNodeBindingDepthConverter.cs
- IndexerNameAttribute.cs
- CheckableControlBaseAdapter.cs
- BitFlagsGenerator.cs
- COAUTHINFO.cs
- Subset.cs
- HeaderCollection.cs
- SoapConverter.cs
- KeyBinding.cs
- TextElement.cs
- ChannelListenerBase.cs
- ImpersonateTokenRef.cs
- PathData.cs
- TableColumn.cs
- FileDialog.cs
- PropertyGridView.cs
- TextBounds.cs
- SQLGuidStorage.cs
- DesignerSerializerAttribute.cs
- grammarelement.cs
- X509CertificateValidator.cs
- DefaultObjectMappingItemCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- FixedSOMElement.cs
- StackOverflowException.cs
- FormsAuthentication.cs
- HtmlHead.cs
- QueryConverter.cs
- KeyedHashAlgorithm.cs
- SoapObjectWriter.cs
- SynchronizedInputHelper.cs
- ToolStripItemDesigner.cs
- _SingleItemRequestCache.cs
- Monitor.cs
- BulletChrome.cs
- ExitEventArgs.cs
- MenuEventArgs.cs
- _NestedSingleAsyncResult.cs
- SurrogateChar.cs
- InternalControlCollection.cs
- Utility.cs
- FixedSOMTableCell.cs
- SchemaImporter.cs
- HtmlInputPassword.cs
- Lookup.cs
- DiagnosticStrings.cs
- BlurBitmapEffect.cs
- Parsers.cs
- Utils.cs
- Vector3D.cs
- PathFigure.cs
- BindingMemberInfo.cs
- MsdtcClusterUtils.cs
- ImageBrush.cs
- OrderedDictionaryStateHelper.cs
- RuleProcessor.cs
- GCHandleCookieTable.cs
- HostingPreferredMapPath.cs
- XmlSchemaInferenceException.cs
- ObjectListField.cs
- WebBrowser.cs
- ListenerElementsCollection.cs
- PresentationAppDomainManager.cs
- TdsParserSessionPool.cs
- HttpUnhandledOperationInvoker.cs
- InfoCardArgumentException.cs
- RemoteWebConfigurationHostStream.cs
- DataGridItem.cs
- DataKey.cs
- RepeatBehaviorConverter.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- HttpModuleCollection.cs
- Brush.cs
- MessagePartProtectionMode.cs
- PersonalizationProviderHelper.cs
- ApplicationProxyInternal.cs
- SQLInt64Storage.cs
- FragmentQueryProcessor.cs
- PropertyInfoSet.cs
- LayoutManager.cs
- Propagator.JoinPropagator.cs
- AsymmetricAlgorithm.cs
- XPathException.cs
- NetCodeGroup.cs
- InitializerFacet.cs
- ComAdminInterfaces.cs
- UnmanagedMemoryStreamWrapper.cs
- VisualTarget.cs
- ObjectMemberMapping.cs
- ConditionalBranch.cs
- CodeMemberEvent.cs
- DictionaryGlobals.cs