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
- DelegateCompletionCallbackWrapper.cs
- RewritingValidator.cs
- OdbcParameter.cs
- GridItemProviderWrapper.cs
- RawStylusSystemGestureInputReport.cs
- FormView.cs
- SliderAutomationPeer.cs
- HttpListenerException.cs
- SqlHelper.cs
- DBCommand.cs
- TextTreeInsertElementUndoUnit.cs
- ComAdminWrapper.cs
- PageThemeBuildProvider.cs
- StylusButton.cs
- ConfigXmlElement.cs
- webproxy.cs
- CodeThrowExceptionStatement.cs
- DrawListViewColumnHeaderEventArgs.cs
- TransactionFlowOption.cs
- StylusButton.cs
- XmlSchemaObjectTable.cs
- TextBoxBaseDesigner.cs
- BaseCollection.cs
- DBCommand.cs
- LocalizedNameDescriptionPair.cs
- ModifierKeysConverter.cs
- InputReport.cs
- SqlException.cs
- PartialList.cs
- DiscoveryReferences.cs
- ForceCopyBuildProvider.cs
- DesignerCategoryAttribute.cs
- COM2TypeInfoProcessor.cs
- InstallHelper.cs
- SettingsPropertyWrongTypeException.cs
- Viewport2DVisual3D.cs
- KeyNotFoundException.cs
- CounterCreationData.cs
- TagPrefixInfo.cs
- EditorZone.cs
- WebPartUtil.cs
- AssociationTypeEmitter.cs
- Vector3DValueSerializer.cs
- RelationshipConverter.cs
- _HeaderInfoTable.cs
- dbdatarecord.cs
- AutomationPatternInfo.cs
- ModelPropertyImpl.cs
- SimpleHandlerBuildProvider.cs
- XMLSchema.cs
- XmlCustomFormatter.cs
- StringUtil.cs
- CodeCatchClauseCollection.cs
- TemplateXamlParser.cs
- StyleHelper.cs
- ComboBoxDesigner.cs
- RuleProcessor.cs
- MultipleCopiesCollection.cs
- CompatibleComparer.cs
- WebPartTransformerAttribute.cs
- entityreference_tresulttype.cs
- DataSetUtil.cs
- CryptoApi.cs
- HandledEventArgs.cs
- TypeUsage.cs
- ToolStripButton.cs
- BaseCollection.cs
- IgnoreSection.cs
- UIElementCollection.cs
- ExpressionVisitorHelpers.cs
- ImageBrush.cs
- ThreadExceptionDialog.cs
- XmlNamespaceDeclarationsAttribute.cs
- IisNotInstalledException.cs
- ListenerConstants.cs
- URLIdentityPermission.cs
- SafeEventLogReadHandle.cs
- categoryentry.cs
- BooleanFunctions.cs
- StatusBarAutomationPeer.cs
- ItemTypeToolStripMenuItem.cs
- PrintPreviewControl.cs
- DeadCharTextComposition.cs
- MaskDescriptors.cs
- ResourceExpression.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- PathData.cs
- Lock.cs
- MinMaxParagraphWidth.cs
- XamlPathDataSerializer.cs
- FontUnitConverter.cs
- PostBackTrigger.cs
- ExtendLockAsyncResult.cs
- FrameworkObject.cs
- OutputWindow.cs
- DispatchChannelSink.cs
- __Filters.cs
- GPRECTF.cs
- AndAlso.cs
- ViewStateException.cs