Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CodeObject.cs
- EndEvent.cs
- XmlUtilWriter.cs
- ByteFacetDescriptionElement.cs
- WinEventHandler.cs
- OdbcEnvironment.cs
- FormViewDeletedEventArgs.cs
- XmlAttributeProperties.cs
- TextEditorCopyPaste.cs
- DataBinding.cs
- SwitchAttribute.cs
- CompModHelpers.cs
- XmlElementAttribute.cs
- BuildManagerHost.cs
- XsltOutput.cs
- Expressions.cs
- DataGridDetailsPresenterAutomationPeer.cs
- ProfileParameter.cs
- ObjectDataSourceEventArgs.cs
- Point3DCollection.cs
- JsonFormatWriterGenerator.cs
- TagMapCollection.cs
- ClassicBorderDecorator.cs
- SuppressMergeCheckAttribute.cs
- Subtree.cs
- HtmlProps.cs
- WithParamAction.cs
- SafeNativeMethodsMilCoreApi.cs
- SqlClientFactory.cs
- Site.cs
- Int32Rect.cs
- ApplicationGesture.cs
- PropertiesTab.cs
- CollectionDataContract.cs
- XmlAtomErrorReader.cs
- TextElementCollectionHelper.cs
- ListenerAdapter.cs
- OleDbParameter.cs
- BinaryObjectWriter.cs
- FocusTracker.cs
- ImageSourceValueSerializer.cs
- PlaceHolder.cs
- ComplexPropertyEntry.cs
- SqlMethodTransformer.cs
- DoubleLinkListEnumerator.cs
- StructuredTypeEmitter.cs
- IOException.cs
- DataSourceIDConverter.cs
- StylusPointPropertyUnit.cs
- SupportsPreviewControlAttribute.cs
- ResponseStream.cs
- AnimationLayer.cs
- WizardForm.cs
- Configuration.cs
- TraceContextEventArgs.cs
- ReadWriteObjectLock.cs
- PersonalizationStateQuery.cs
- ExchangeUtilities.cs
- MessageBox.cs
- TypedTableGenerator.cs
- CodeAttributeArgument.cs
- XpsFilter.cs
- DataViewSettingCollection.cs
- DispatcherSynchronizationContext.cs
- DelegatingConfigHost.cs
- ProcessModule.cs
- MiniModule.cs
- WinFormsComponentEditor.cs
- CommandPlan.cs
- Partitioner.cs
- ComponentSerializationService.cs
- SQLDecimal.cs
- QueueProcessor.cs
- FormatterConverter.cs
- PagerSettings.cs
- ADRoleFactory.cs
- MultipleViewProviderWrapper.cs
- CompositeTypefaceMetrics.cs
- Int64Animation.cs
- FullTrustAssembliesSection.cs
- CanExecuteRoutedEventArgs.cs
- DataGridViewToolTip.cs
- PagesSection.cs
- PasswordBox.cs
- NameValueConfigurationCollection.cs
- TemplateInstanceAttribute.cs
- PagedDataSource.cs
- ITreeGenerator.cs
- OperationCanceledException.cs
- ScriptIgnoreAttribute.cs
- GridViewColumnCollectionChangedEventArgs.cs
- CSharpCodeProvider.cs
- FileClassifier.cs
- OptimisticConcurrencyException.cs
- XPathQilFactory.cs
- ClipboardProcessor.cs
- HttpListenerContext.cs
- GridLengthConverter.cs
- AssemblyNameProxy.cs
- SystemWebSectionGroup.cs