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
- SQLInt16Storage.cs
- AuthenticationService.cs
- EntityDataSourceState.cs
- LinkButton.cs
- XmlRootAttribute.cs
- XmlKeywords.cs
- PiiTraceSource.cs
- StorageModelBuildProvider.cs
- DockingAttribute.cs
- ProcessModelInfo.cs
- PassportAuthenticationEventArgs.cs
- XmlNamedNodeMap.cs
- TimeoutValidationAttribute.cs
- serverconfig.cs
- StylusPlugin.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- PageThemeBuildProvider.cs
- OdbcConnectionHandle.cs
- EntityProviderFactory.cs
- XmlMapping.cs
- SharedStatics.cs
- TextTreeTextNode.cs
- DataException.cs
- ConfigXmlText.cs
- SerTrace.cs
- Point3DCollection.cs
- HtmlElement.cs
- SerialPinChanges.cs
- XmlBoundElement.cs
- CharStorage.cs
- PolyQuadraticBezierSegment.cs
- Renderer.cs
- SystemWebSectionGroup.cs
- TextParentUndoUnit.cs
- AppLevelCompilationSectionCache.cs
- HierarchicalDataSourceControl.cs
- DeclarativeCatalogPart.cs
- EdmPropertyAttribute.cs
- UrlMappingsSection.cs
- DataGridViewButtonCell.cs
- InfiniteIntConverter.cs
- SerializerWriterEventHandlers.cs
- HtmlAnchor.cs
- DefaultPropertyAttribute.cs
- BidOverLoads.cs
- DataRecord.cs
- VisualBrush.cs
- FacetChecker.cs
- PropertyDescriptor.cs
- CompilerHelpers.cs
- WindowPatternIdentifiers.cs
- StringOutput.cs
- PasswordBox.cs
- SelectionRangeConverter.cs
- PaintEvent.cs
- FileRecordSequenceHelper.cs
- PrintDocument.cs
- WindowsSpinner.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- OracleTimeSpan.cs
- EntitySetDataBindingList.cs
- SiteMapProvider.cs
- TextContainerChangedEventArgs.cs
- LayoutEvent.cs
- GeneralTransform3DTo2D.cs
- BaseParagraph.cs
- SQLGuidStorage.cs
- DesignTimeSiteMapProvider.cs
- Point3DCollection.cs
- SystemColorTracker.cs
- DesignerFrame.cs
- QilUnary.cs
- HttpPostedFile.cs
- DebugViewWriter.cs
- XsdBuilder.cs
- PathFigureCollectionConverter.cs
- ErrorTolerantObjectWriter.cs
- TemplatedMailWebEventProvider.cs
- RecognizedAudio.cs
- DiscardableAttribute.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- VersionValidator.cs
- ColorAnimation.cs
- XmlComplianceUtil.cs
- TcpClientSocketManager.cs
- GPRECTF.cs
- FileAuthorizationModule.cs
- ToolStripItemBehavior.cs
- SignedXmlDebugLog.cs
- DataServiceExpressionVisitor.cs
- ConstraintCollection.cs
- InlineObject.cs
- AsyncInvokeContext.cs
- MonitorWrapper.cs
- TypeGeneratedEventArgs.cs
- GridViewRowEventArgs.cs
- EventNotify.cs
- XmlNavigatorStack.cs
- TextEditorCopyPaste.cs
- NonVisualControlAttribute.cs