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
- SqlTriggerAttribute.cs
- MailFileEditor.cs
- EntityDataSourceWrapperCollection.cs
- SwitchLevelAttribute.cs
- BuildProviderAppliesToAttribute.cs
- SqlNotificationEventArgs.cs
- MemoryRecordBuffer.cs
- PrintPreviewControl.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- SettingsProviderCollection.cs
- CompilerTypeWithParams.cs
- FontConverter.cs
- MessageContractMemberAttribute.cs
- GridViewCommandEventArgs.cs
- TraceLog.cs
- EntitySqlException.cs
- TreeNodeClickEventArgs.cs
- XmlWrappingWriter.cs
- TcpProcessProtocolHandler.cs
- DesignerListAdapter.cs
- UmAlQuraCalendar.cs
- ConfigurationManagerHelperFactory.cs
- LogicalExpr.cs
- FileSystemEventArgs.cs
- SelectionHighlightInfo.cs
- OutputChannel.cs
- IndexedGlyphRun.cs
- Rectangle.cs
- XPathChildIterator.cs
- BaseWebProxyFinder.cs
- DrawingBrush.cs
- XslCompiledTransform.cs
- FormsIdentity.cs
- ScaleTransform3D.cs
- MappingMetadataHelper.cs
- GroupBox.cs
- TextWriter.cs
- AppDomainUnloadedException.cs
- DesignerActionVerbList.cs
- RangeValueProviderWrapper.cs
- ControlValuePropertyAttribute.cs
- SchemeSettingElement.cs
- Parser.cs
- HttpWebRequestElement.cs
- FileUpload.cs
- Point3DConverter.cs
- LogConverter.cs
- ElementInit.cs
- EventSinkActivity.cs
- ContextMenuAutomationPeer.cs
- ObjectListCommand.cs
- MediaEntryAttribute.cs
- Identifier.cs
- ReadOnlyAttribute.cs
- COM2PictureConverter.cs
- DurableOperationContext.cs
- ColumnClickEvent.cs
- EntityPropertyMappingAttribute.cs
- ListViewContainer.cs
- FrameDimension.cs
- PerformanceCountersElement.cs
- ConfigurationManagerHelper.cs
- GenerateTemporaryTargetAssembly.cs
- XmlDocument.cs
- DescendantOverDescendantQuery.cs
- TextBreakpoint.cs
- StoreItemCollection.Loader.cs
- TextLine.cs
- ZipIOBlockManager.cs
- TextReturnReader.cs
- LicFileLicenseProvider.cs
- FloatUtil.cs
- TabletDeviceInfo.cs
- SmiMetaDataProperty.cs
- AVElementHelper.cs
- RefreshEventArgs.cs
- ObjectKeyFrameCollection.cs
- DependencyProperty.cs
- Stopwatch.cs
- ConfigsHelper.cs
- KeyedPriorityQueue.cs
- MaskedTextProvider.cs
- GenericTextProperties.cs
- DocumentViewer.cs
- Journaling.cs
- DesignerAttribute.cs
- XmlSchemaComplexContent.cs
- InstanceOwner.cs
- CryptographicAttribute.cs
- DataGridViewCellStyle.cs
- CancelEventArgs.cs
- DataKey.cs
- Stack.cs
- ValidatorCollection.cs
- ColorTransform.cs
- InkCanvas.cs
- XmlBoundElement.cs
- URLAttribute.cs
- ApplicationGesture.cs