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
- Point3D.cs
- WebPartDescription.cs
- HealthMonitoringSection.cs
- DispatcherObject.cs
- TextLineResult.cs
- PreviewControlDesigner.cs
- SQLStringStorage.cs
- CodeSnippetStatement.cs
- ProvidersHelper.cs
- Crc32Helper.cs
- CqlErrorHelper.cs
- XmlSerializationWriter.cs
- LinkLabel.cs
- DriveNotFoundException.cs
- DataGridViewLinkColumn.cs
- XsltException.cs
- MarkupCompilePass1.cs
- OdbcCommandBuilder.cs
- XmlArrayItemAttributes.cs
- WindowsFormsDesignerOptionService.cs
- UserValidatedEventArgs.cs
- SafeNativeHandle.cs
- ValueHandle.cs
- BinaryQueryOperator.cs
- ExpressionWriter.cs
- XPathSelectionIterator.cs
- AmbientProperties.cs
- sqlnorm.cs
- EventMappingSettingsCollection.cs
- MatrixCamera.cs
- HelpProvider.cs
- xsdvalidator.cs
- CryptoApi.cs
- URIFormatException.cs
- designeractionbehavior.cs
- BaseTreeIterator.cs
- TemplateAction.cs
- MonthChangedEventArgs.cs
- EventLogPropertySelector.cs
- PresentationSource.cs
- DesignerCapabilities.cs
- TransactionWaitAsyncResult.cs
- DesignerProperties.cs
- PagesChangedEventArgs.cs
- JumpPath.cs
- Permission.cs
- CompoundFileStreamReference.cs
- ProviderConnectionPointCollection.cs
- MethodImplAttribute.cs
- SqlEnums.cs
- GetWinFXPath.cs
- NavigationEventArgs.cs
- XsdBuildProvider.cs
- OleDbConnectionInternal.cs
- URL.cs
- Timeline.cs
- SmiEventSink_Default.cs
- TableRowGroup.cs
- XmlDigitalSignatureProcessor.cs
- ButtonChrome.cs
- DefaultHttpHandler.cs
- MeasureItemEvent.cs
- PolyLineSegment.cs
- SourceElementsCollection.cs
- EntryPointNotFoundException.cs
- CachedFontFamily.cs
- InnerItemCollectionView.cs
- CodeExpressionCollection.cs
- DocumentSchemaValidator.cs
- EntryWrittenEventArgs.cs
- TextSimpleMarkerProperties.cs
- ScalarConstant.cs
- PrimitiveSchema.cs
- FileDialogCustomPlace.cs
- TextFragmentEngine.cs
- DataObject.cs
- Literal.cs
- RectangleF.cs
- EUCJPEncoding.cs
- EntityDescriptor.cs
- dataobject.cs
- DataGridViewComboBoxCell.cs
- SerializationInfoEnumerator.cs
- Psha1DerivedKeyGeneratorHelper.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- ElapsedEventArgs.cs
- ReliabilityContractAttribute.cs
- HandlerFactoryWrapper.cs
- OpenFileDialog.cs
- ToolStripPanel.cs
- ProcessModelSection.cs
- IERequestCache.cs
- SingleObjectCollection.cs
- DateTimeValueSerializerContext.cs
- TextTreeUndoUnit.cs
- XsltSettings.cs
- AnchoredBlock.cs
- DataGridAddNewRow.cs
- StructuredType.cs
- ButtonBase.cs