Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- WindowsAuthenticationModule.cs
- SerializationObjectManager.cs
- OdbcEnvironment.cs
- TypeElement.cs
- AppearanceEditorPart.cs
- DataBoundControlDesigner.cs
- EntitySet.cs
- Rectangle.cs
- SqlSupersetValidator.cs
- DbConnectionStringCommon.cs
- SqlTriggerContext.cs
- AuthorizationRuleCollection.cs
- PolicyStatement.cs
- HuffmanTree.cs
- ObjectNavigationPropertyMapping.cs
- BinaryMethodMessage.cs
- AnimatedTypeHelpers.cs
- BoundColumn.cs
- HttpHostedTransportConfiguration.cs
- HostedTransportConfigurationManager.cs
- UnmanagedMarshal.cs
- DataGridColumn.cs
- _IPv4Address.cs
- newinstructionaction.cs
- HandleExceptionArgs.cs
- NativeMethodsCLR.cs
- ConnectionManagementSection.cs
- QueryCreatedEventArgs.cs
- SqlDataSource.cs
- TextCompositionManager.cs
- GenericTypeParameterBuilder.cs
- SystemResources.cs
- TextBoxBase.cs
- FormViewAutoFormat.cs
- FileVersion.cs
- HttpWebResponse.cs
- Point.cs
- AppSettingsExpressionBuilder.cs
- UnionExpr.cs
- ParameterModifier.cs
- SystemIPAddressInformation.cs
- ClientRuntimeConfig.cs
- Queue.cs
- FontFamily.cs
- ProxyAttribute.cs
- StringExpressionSet.cs
- ISAPIWorkerRequest.cs
- localization.cs
- WebPartConnectionsEventArgs.cs
- EdmItemError.cs
- CompoundFileDeflateTransform.cs
- Clock.cs
- MultiAsyncResult.cs
- GenericWebPart.cs
- MailMessage.cs
- ListViewCancelEventArgs.cs
- ThreadAttributes.cs
- EpmSyndicationContentDeSerializer.cs
- IdentifierCreationService.cs
- DirectoryGroupQuery.cs
- AsyncOperation.cs
- BamlResourceSerializer.cs
- SoapReflectionImporter.cs
- EastAsianLunisolarCalendar.cs
- OutputCache.cs
- GeneratedCodeAttribute.cs
- PerformanceCounterPermissionEntry.cs
- XmlSerializationWriter.cs
- SimpleTextLine.cs
- ThumbAutomationPeer.cs
- PerfService.cs
- SpecularMaterial.cs
- PageCache.cs
- HttpModulesSection.cs
- PaintEvent.cs
- Compilation.cs
- XmlDataCollection.cs
- MouseWheelEventArgs.cs
- AxHostDesigner.cs
- followingquery.cs
- FixedDocumentSequencePaginator.cs
- SamlSecurityTokenAuthenticator.cs
- ButtonBaseAdapter.cs
- SqlCacheDependencySection.cs
- ValueProviderWrapper.cs
- VectorCollectionConverter.cs
- OleDbInfoMessageEvent.cs
- SoapSchemaExporter.cs
- MediaElement.cs
- ReversePositionQuery.cs
- DeclarativeCatalogPart.cs
- FileDialog.cs
- SrgsElementList.cs
- DbDataSourceEnumerator.cs
- AmbientLight.cs
- InvalidComObjectException.cs
- OleStrCAMarshaler.cs
- HuffmanTree.cs
- ItemCheckedEvent.cs
- ComplexPropertyEntry.cs