Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- GridViewRowCollection.cs
- WorkflowServiceNamespace.cs
- Paragraph.cs
- WebPartDeleteVerb.cs
- CultureMapper.cs
- IDQuery.cs
- RemotingServices.cs
- SmiContextFactory.cs
- DirectoryObjectSecurity.cs
- PointAnimationClockResource.cs
- SessionIDManager.cs
- ScrollItemProviderWrapper.cs
- DataServiceRequestOfT.cs
- WpfWebRequestHelper.cs
- Membership.cs
- WindowsButton.cs
- ConnectionManagementSection.cs
- ResourceFallbackManager.cs
- SystemNetHelpers.cs
- CheckBoxField.cs
- PropertyGeneratedEventArgs.cs
- CachedBitmap.cs
- OpCellTreeNode.cs
- KnownColorTable.cs
- LogicalExpressionTypeConverter.cs
- PersistenceContextEnlistment.cs
- GeneralTransformCollection.cs
- OutputCacheProfileCollection.cs
- CustomAttribute.cs
- TableItemPattern.cs
- TextModifier.cs
- DataControlCommands.cs
- TextTreeRootTextBlock.cs
- PersianCalendar.cs
- TypeExtension.cs
- BookmarkEventArgs.cs
- LabelEditEvent.cs
- Int16AnimationUsingKeyFrames.cs
- ColorTransform.cs
- StringToken.cs
- SqlBooleanizer.cs
- ReaderWriterLockSlim.cs
- ObjectSpanRewriter.cs
- PreloadHost.cs
- RoleBoolean.cs
- SystemTcpStatistics.cs
- StateFinalizationDesigner.cs
- SpecialFolderEnumConverter.cs
- MetadataAssemblyHelper.cs
- VSDExceptions.cs
- SingleSelectRootGridEntry.cs
- ContainerUIElement3D.cs
- WpfPayload.cs
- DebuggerAttributes.cs
- ItemsControlAutomationPeer.cs
- MemberCollection.cs
- IntSecurity.cs
- FixedTextBuilder.cs
- UInt16Converter.cs
- XmlElementAttributes.cs
- SafeHandles.cs
- ProfileManager.cs
- NetworkInterface.cs
- CapabilitiesAssignment.cs
- AuthorizationSection.cs
- PermissionSetTriple.cs
- GroupPartitionExpr.cs
- Bezier.cs
- SearchForVirtualItemEventArgs.cs
- WebBaseEventKeyComparer.cs
- RelationshipDetailsCollection.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- CompositeFontFamily.cs
- ConfigurationValidatorAttribute.cs
- XPathAxisIterator.cs
- TemplateBindingExpression.cs
- MemoryMappedFile.cs
- ImageCodecInfo.cs
- XmlSerializationWriter.cs
- Membership.cs
- AvtEvent.cs
- HtmlTableRowCollection.cs
- DetailsViewPageEventArgs.cs
- ViewValidator.cs
- CompoundFileDeflateTransform.cs
- ReadWriteObjectLock.cs
- MailMessageEventArgs.cs
- EFAssociationProvider.cs
- MD5Cng.cs
- WinEventQueueItem.cs
- TypeConverterHelper.cs
- HtmlWindowCollection.cs
- PropertySourceInfo.cs
- ModelItemDictionaryImpl.cs
- DefaultEventAttribute.cs
- TextElementEditingBehaviorAttribute.cs
- UxThemeWrapper.cs
- XslTransformFileEditor.cs
- ConfigurationValidatorBase.cs
- SerializationEventsCache.cs