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
- Update.cs
- StringBuilder.cs
- ScriptResourceInfo.cs
- BitmapEffectState.cs
- FloaterBaseParaClient.cs
- BaseUriHelper.cs
- EventListener.cs
- _KerberosClient.cs
- DrawingState.cs
- StringResourceManager.cs
- WebScriptMetadataFormatter.cs
- PartitionResolver.cs
- SvcMapFileSerializer.cs
- BindingsCollection.cs
- EmbeddedMailObjectsCollection.cs
- BinarySerializer.cs
- Compiler.cs
- BinaryConverter.cs
- BuildProvidersCompiler.cs
- ImageList.cs
- CheckBoxField.cs
- EntityParameterCollection.cs
- HttpCapabilitiesEvaluator.cs
- ContextBase.cs
- BaseProcessor.cs
- IssuedTokenServiceElement.cs
- ReversePositionQuery.cs
- XmlIlTypeHelper.cs
- SamlAction.cs
- TranslateTransform3D.cs
- ProtocolsConfiguration.cs
- ConfigurationStrings.cs
- RuleSettingsCollection.cs
- QilParameter.cs
- ToolStripTemplateNode.cs
- ExtendedProtectionPolicyElement.cs
- DbTypeMap.cs
- DetailsViewPageEventArgs.cs
- AssociationTypeEmitter.cs
- BitmapFrameEncode.cs
- PrintController.cs
- VisualBasicHelper.cs
- CustomErrorCollection.cs
- RIPEMD160Managed.cs
- HostExecutionContextManager.cs
- WindowsFormsHost.cs
- LostFocusEventManager.cs
- SystemThemeKey.cs
- DesignerAdapterAttribute.cs
- TextBox.cs
- DataBindingHandlerAttribute.cs
- ExtendedTransformFactory.cs
- webeventbuffer.cs
- ISAPIRuntime.cs
- AbstractDataSvcMapFileLoader.cs
- ListChangedEventArgs.cs
- FixedSOMSemanticBox.cs
- SoapSchemaExporter.cs
- GenericsInstances.cs
- DrawingAttributeSerializer.cs
- FileLogRecordEnumerator.cs
- ManagedIStream.cs
- HttpRequestCacheValidator.cs
- DataGridPagerStyle.cs
- ObjectDataSourceView.cs
- CssStyleCollection.cs
- NoneExcludedImageIndexConverter.cs
- MediaEntryAttribute.cs
- HttpClientProtocol.cs
- RadioButton.cs
- TextSegment.cs
- Evidence.cs
- ServiceOperationWrapper.cs
- QuadraticBezierSegment.cs
- ItemType.cs
- IPipelineRuntime.cs
- MultiPropertyDescriptorGridEntry.cs
- FileUtil.cs
- ReflectionTypeLoadException.cs
- NativeMethodsCLR.cs
- CustomAttributeSerializer.cs
- IDispatchConstantAttribute.cs
- SecureConversationServiceCredential.cs
- XmlBoundElement.cs
- RuleSettingsCollection.cs
- BuildResult.cs
- SqlCommandBuilder.cs
- SpotLight.cs
- x509store.cs
- AnimationTimeline.cs
- DataGridPagerStyle.cs
- DataRelationCollection.cs
- CommonGetThemePartSize.cs
- RelationshipConstraintValidator.cs
- WinEventTracker.cs
- MasterPageParser.cs
- ViewEventArgs.cs
- XmlDataLoader.cs
- ObsoleteAttribute.cs
- SQlBooleanStorage.cs