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
- MsmqBindingElementBase.cs
- PropertyTabAttribute.cs
- StringAnimationBase.cs
- FrameDimension.cs
- TaskExtensions.cs
- QueryStringHandler.cs
- ElementAtQueryOperator.cs
- DriveInfo.cs
- SecurityTokenResolver.cs
- XmlUtil.cs
- cookieexception.cs
- Compiler.cs
- StringAnimationBase.cs
- SrgsGrammarCompiler.cs
- ToolStripDropDownItem.cs
- EnvironmentPermission.cs
- InputReferenceExpression.cs
- LinearKeyFrames.cs
- BulletDecorator.cs
- CAGDesigner.cs
- StreamMarshaler.cs
- Type.cs
- SimplePropertyEntry.cs
- SystemIPGlobalProperties.cs
- cryptoapiTransform.cs
- Thickness.cs
- RegexTypeEditor.cs
- UnmanagedMemoryStream.cs
- GridViewRow.cs
- RtfToken.cs
- HttpListenerContext.cs
- ContextStack.cs
- TabItemAutomationPeer.cs
- SQlBooleanStorage.cs
- PersonalizationEntry.cs
- ScrollViewerAutomationPeer.cs
- AutomationAttributeInfo.cs
- DPCustomTypeDescriptor.cs
- RequestUriProcessor.cs
- MemberExpression.cs
- WebPartZoneBase.cs
- AllMembershipCondition.cs
- XmlChildNodes.cs
- GlobalEventManager.cs
- CustomCategoryAttribute.cs
- HttpContextServiceHost.cs
- BindStream.cs
- ProtocolsConfigurationEntry.cs
- UnmanagedBitmapWrapper.cs
- FixedSOMFixedBlock.cs
- DataBinder.cs
- Floater.cs
- MethodBuilder.cs
- SerializableAttribute.cs
- OleDbTransaction.cs
- ExtendedProperty.cs
- DeleteWorkflowOwnerCommand.cs
- WebPartManager.cs
- unitconverter.cs
- OdbcError.cs
- DataGridViewSelectedColumnCollection.cs
- WebPartExportVerb.cs
- BitmapEffectInput.cs
- PropertyEmitterBase.cs
- DataSourceUtil.cs
- ClientRolePrincipal.cs
- SchemaObjectWriter.cs
- StateChangeEvent.cs
- ZipIORawDataFileBlock.cs
- XmlUtil.cs
- Exception.cs
- InternalConfigSettingsFactory.cs
- DefaultPrintController.cs
- BufferBuilder.cs
- activationcontext.cs
- WinEventTracker.cs
- TextSelectionHelper.cs
- ConfigXmlWhitespace.cs
- XomlCompilerError.cs
- WebServiceErrorEvent.cs
- ChannelParameterCollection.cs
- InputLanguage.cs
- Triangle.cs
- XmlSerializationGeneratedCode.cs
- MenuEventArgs.cs
- CodeGenerator.cs
- InvokeHandlers.cs
- DataSourceXmlAttributeAttribute.cs
- PrintDialog.cs
- SessionPageStatePersister.cs
- MultipleViewProviderWrapper.cs
- BindingUtils.cs
- Parallel.cs
- LinqDataSourceInsertEventArgs.cs
- DrawingVisualDrawingContext.cs
- BindingsCollection.cs
- AttachedPropertiesService.cs
- ItemDragEvent.cs
- Formatter.cs
- SqlCachedBuffer.cs