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
- MimeBasePart.cs
- ConfigXmlText.cs
- TextContainer.cs
- CdpEqualityComparer.cs
- PersonalizationStateInfoCollection.cs
- WindowsAuthenticationEventArgs.cs
- ConfigurationElementProperty.cs
- OleDbConnectionInternal.cs
- MetadataItem.cs
- ContourSegment.cs
- AssemblyBuilder.cs
- EntityDataSourceViewSchema.cs
- CustomErrorsSection.cs
- DecimalStorage.cs
- WindowsContainer.cs
- AssemblyAttributesGoHere.cs
- DefaultCommandConverter.cs
- NullRuntimeConfig.cs
- XmlLinkedNode.cs
- CreatingCookieEventArgs.cs
- GeneralTransformCollection.cs
- GlyphRunDrawing.cs
- StringValidator.cs
- SchemeSettingElement.cs
- LocatorBase.cs
- DataGridViewTextBoxCell.cs
- FixedPageProcessor.cs
- AssemblyHash.cs
- ErrorEventArgs.cs
- TemplateControlBuildProvider.cs
- FileInfo.cs
- XmlWhitespace.cs
- StylusCollection.cs
- AssemblySettingAttributes.cs
- DESCryptoServiceProvider.cs
- UserInitiatedRoutedEventPermission.cs
- _ProxyRegBlob.cs
- DataSourceControl.cs
- ChannelBase.cs
- XmlBinaryWriter.cs
- ColorAnimationBase.cs
- ContentOperations.cs
- RoutedEventArgs.cs
- RandomNumberGenerator.cs
- XmlSecureResolver.cs
- ConfigurationLockCollection.cs
- DataColumnCollection.cs
- EdmEntityTypeAttribute.cs
- ProfessionalColorTable.cs
- ToolStripArrowRenderEventArgs.cs
- recordstate.cs
- HwndHost.cs
- ProcessModuleCollection.cs
- EventProvider.cs
- DispatcherExceptionEventArgs.cs
- BackgroundWorker.cs
- Geometry3D.cs
- SqlDataRecord.cs
- SelectManyQueryOperator.cs
- GlobalizationAssembly.cs
- Grid.cs
- XsltArgumentList.cs
- Stroke.cs
- CustomCategoryAttribute.cs
- NameService.cs
- SaveLedgerEntryRequest.cs
- PageBuildProvider.cs
- DrawingVisualDrawingContext.cs
- SqlSupersetValidator.cs
- DecoderBestFitFallback.cs
- GridEntryCollection.cs
- StreamingContext.cs
- ControlCachePolicy.cs
- SqlConnectionStringBuilder.cs
- IndexingContentUnit.cs
- RsaKeyGen.cs
- DetailsViewInsertEventArgs.cs
- ObjectTag.cs
- Match.cs
- AdRotatorDesigner.cs
- PartitionResolver.cs
- MergablePropertyAttribute.cs
- MediaTimeline.cs
- NavigationProgressEventArgs.cs
- ContainsRowNumberChecker.cs
- XmlChildEnumerator.cs
- DataGridViewSelectedColumnCollection.cs
- Drawing.cs
- ValidationEventArgs.cs
- HtmlInputCheckBox.cs
- QilParameter.cs
- CodeMethodInvokeExpression.cs
- XmlWellformedWriter.cs
- PartialCachingAttribute.cs
- FileDialogCustomPlacesCollection.cs
- DataGridItemCollection.cs
- DataGridViewHitTestInfo.cs
- ServiceDescriptionImporter.cs
- ApplicationHost.cs
- PreviewKeyDownEventArgs.cs