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
- TreeNodeSelectionProcessor.cs
- HttpDictionary.cs
- ProtectedConfigurationProviderCollection.cs
- WindowsMenu.cs
- BooleanFunctions.cs
- StorageFunctionMapping.cs
- Win32SafeHandles.cs
- AutomationAttributeInfo.cs
- QueuedDeliveryRequirementsMode.cs
- SerializationSectionGroup.cs
- NetSectionGroup.cs
- BufferAllocator.cs
- Boolean.cs
- Util.cs
- ObjectQuery.cs
- ObservableDictionary.cs
- WebPartMovingEventArgs.cs
- nulltextcontainer.cs
- Exceptions.cs
- BaseEntityWrapper.cs
- EntryWrittenEventArgs.cs
- MaskInputRejectedEventArgs.cs
- CompoundFileStorageReference.cs
- WebControlAdapter.cs
- ParameterModifier.cs
- DataGridViewAccessibleObject.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- PreviewPrintController.cs
- RadialGradientBrush.cs
- BaseValidator.cs
- DelegatingHeader.cs
- BuildResult.cs
- SystemNetworkInterface.cs
- Timer.cs
- UpdateCompiler.cs
- XPathNode.cs
- MessageHeaderT.cs
- RectValueSerializer.cs
- HMACSHA1.cs
- Screen.cs
- TextBoxLine.cs
- XmlSchemaAttributeGroup.cs
- Query.cs
- HtmlTable.cs
- ItemCheckedEvent.cs
- RegexCompilationInfo.cs
- Vector3DConverter.cs
- DataGrid.cs
- PolicyUnit.cs
- KnownColorTable.cs
- DecoratedNameAttribute.cs
- SqlFunctionAttribute.cs
- UnknownBitmapDecoder.cs
- WebPartUtil.cs
- Point.cs
- Environment.cs
- PropertyPath.cs
- CustomTrackingRecord.cs
- PolyQuadraticBezierSegment.cs
- SectionUpdates.cs
- ObjectItemCollection.cs
- LongTypeConverter.cs
- XPathParser.cs
- DataTableReaderListener.cs
- XmlExtensionFunction.cs
- SessionStateUtil.cs
- SecureUICommand.cs
- XmlSchemaIdentityConstraint.cs
- OleDbConnection.cs
- ParseHttpDate.cs
- SessionParameter.cs
- CroppedBitmap.cs
- XPathConvert.cs
- XmlAttributeCollection.cs
- BeginEvent.cs
- ServiceNameElement.cs
- CapabilitiesState.cs
- ApplicationHost.cs
- TabControlEvent.cs
- XmlElementAttributes.cs
- Assembly.cs
- XComponentModel.cs
- UnmanagedHandle.cs
- OleDbWrapper.cs
- IImplicitResourceProvider.cs
- LinearGradientBrush.cs
- TextServicesCompartmentContext.cs
- _KerberosClient.cs
- CommandHelpers.cs
- UrlPropertyAttribute.cs
- VarRefManager.cs
- Attributes.cs
- SplineKeyFrames.cs
- StringSorter.cs
- DockingAttribute.cs
- ThreadExceptionEvent.cs
- WriteFileContext.cs
- CodeAttributeDeclaration.cs
- MouseDevice.cs
- OperationResponse.cs