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
- ComMethodElement.cs
- ComPlusDiagnosticTraceRecords.cs
- StringValueSerializer.cs
- CodeIdentifiers.cs
- BuilderInfo.cs
- PropertyTabAttribute.cs
- XmlEventCache.cs
- DataServiceProcessingPipeline.cs
- Publisher.cs
- DelayedRegex.cs
- HiddenField.cs
- WebPartZone.cs
- MatrixKeyFrameCollection.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- FixedTextBuilder.cs
- MaskDescriptor.cs
- PersonalizationEntry.cs
- PresentationUIStyleResources.cs
- SystemFonts.cs
- DelayedRegex.cs
- CustomAttributeFormatException.cs
- LassoHelper.cs
- SimpleExpression.cs
- PersistChildrenAttribute.cs
- XsltOutput.cs
- FramingEncoders.cs
- GlyphElement.cs
- UndoManager.cs
- WebPartMovingEventArgs.cs
- CustomAttributeBuilder.cs
- Quad.cs
- BitmapCacheBrush.cs
- NetWebProxyFinder.cs
- CodeCompiler.cs
- Image.cs
- ActivityInterfaces.cs
- GridErrorDlg.cs
- ClickablePoint.cs
- TriggerCollection.cs
- Hash.cs
- TypeUsageBuilder.cs
- DataPager.cs
- HtmlImage.cs
- ScriptingScriptResourceHandlerSection.cs
- X509UI.cs
- LineVisual.cs
- CodeRemoveEventStatement.cs
- DrawingImage.cs
- UniqueIdentifierService.cs
- PeerMaintainer.cs
- DropShadowEffect.cs
- GotoExpression.cs
- WmlSelectionListAdapter.cs
- Timer.cs
- TimeSpanValidatorAttribute.cs
- ResourceAssociationType.cs
- XmlSchemaGroupRef.cs
- InputMethod.cs
- BooleanSwitch.cs
- HtmlElementCollection.cs
- ViewPort3D.cs
- Grant.cs
- IndentedTextWriter.cs
- MemberMaps.cs
- DataTableMapping.cs
- WriteTimeStream.cs
- VectorConverter.cs
- OleDbCommandBuilder.cs
- EntryIndex.cs
- XsltException.cs
- CachedBitmap.cs
- MultitargetingHelpers.cs
- ObjectDataSourceEventArgs.cs
- DataGridBeginningEditEventArgs.cs
- MaterialGroup.cs
- MembershipSection.cs
- ZoneIdentityPermission.cs
- UserControlCodeDomTreeGenerator.cs
- ToolStripTemplateNode.cs
- FrameworkPropertyMetadata.cs
- SafeCryptoHandles.cs
- KeyBinding.cs
- SelectionItemPattern.cs
- BrowserCapabilitiesCompiler.cs
- GuidConverter.cs
- TdsParserSessionPool.cs
- GPPOINTF.cs
- MarkupProperty.cs
- BridgeDataReader.cs
- CssClassPropertyAttribute.cs
- QilTargetType.cs
- VectorAnimationBase.cs
- ToolStrip.cs
- TileModeValidation.cs
- DataQuery.cs
- SecUtil.cs
- Privilege.cs
- ListViewContainer.cs
- Visitor.cs
- FrameworkContentElement.cs