Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheOutputQuery.cs / 1 / CacheOutputQuery.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 abstract class CacheOutputQuery : Query { internal Query input; // int count; -- we reusing it here protected ListoutputBuffer; public CacheOutputQuery(Query input) { this.input = input; this.outputBuffer = new List (); this.count = 0; } protected CacheOutputQuery(CacheOutputQuery other) : base(other) { this.input = Clone(other.input); this.outputBuffer = new List (other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override void SetXsltContext(XsltContext context){ input.SetXsltContext(context); } public override object Evaluate(XPathNodeIterator context) { outputBuffer.Clear(); count = 0; return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this. // All subclasses should and would anyway override thismethod and return this. } public override XPathNavigator Advance() { Debug.Assert(0 <= count && count <= outputBuffer.Count); if (count < outputBuffer.Count) { return outputBuffer[count++]; } return null; } public override XPathNavigator Current { get { Debug.Assert(0 <= count && count <= outputBuffer.Count); if (count == 0) { return null; } return outputBuffer[count - 1]; } } public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } } public override int CurrentPosition { get { return count; } } public override int Count { get { return outputBuffer.Count; } } public override QueryProps Properties { get { return QueryProps.Merge | QueryProps.Cached | QueryProps.Position | QueryProps.Count; } } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); w.WriteEndElement(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ResourceSet.cs
- mediaclock.cs
- XPathArrayIterator.cs
- SafeEventLogWriteHandle.cs
- SrgsNameValueTag.cs
- ServicePoint.cs
- CustomCredentialPolicy.cs
- SiteMapNodeItem.cs
- CommandConverter.cs
- AsyncOperation.cs
- SqlDataSourceCache.cs
- TextComposition.cs
- Propagator.ExtentPlaceholderCreator.cs
- OleDbError.cs
- EmissiveMaterial.cs
- BindingExpressionUncommonField.cs
- MetricEntry.cs
- SelectedDatesCollection.cs
- TransactionsSectionGroup.cs
- CompressEmulationStream.cs
- ProcessMessagesAsyncResult.cs
- FieldNameLookup.cs
- ToolStripSettings.cs
- CopyCodeAction.cs
- XmlExpressionDumper.cs
- PermissionAttributes.cs
- MeshGeometry3D.cs
- StylusPointProperties.cs
- processwaithandle.cs
- Number.cs
- DataGridViewImageColumn.cs
- QueryStringParameter.cs
- QilList.cs
- PolyLineSegment.cs
- SocketException.cs
- GeneralTransform3DGroup.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- TextEndOfParagraph.cs
- SqlUserDefinedTypeAttribute.cs
- Geometry3D.cs
- RouteItem.cs
- SurrogateEncoder.cs
- ReflectionUtil.cs
- PreservationFileWriter.cs
- LoginDesigner.cs
- TypeLoadException.cs
- UiaCoreProviderApi.cs
- BaseUriHelper.cs
- PolicyException.cs
- AssociatedControlConverter.cs
- ToolboxItemAttribute.cs
- BitmapEffect.cs
- GridView.cs
- ArgumentValue.cs
- CompositeTypefaceMetrics.cs
- SerialReceived.cs
- AuthenticatingEventArgs.cs
- WindowVisualStateTracker.cs
- WebPartConnectionsCloseVerb.cs
- CLSCompliantAttribute.cs
- IndexingContentUnit.cs
- DriveNotFoundException.cs
- Condition.cs
- SuppressMessageAttribute.cs
- TokenBasedSet.cs
- MetadataPropertyAttribute.cs
- State.cs
- TableParagraph.cs
- DoubleAnimationUsingPath.cs
- LineBreak.cs
- SubtreeProcessor.cs
- ProxyFragment.cs
- ServiceBuildProvider.cs
- FieldNameLookup.cs
- DataGridColumnCollection.cs
- HtmlInputControl.cs
- DecimalKeyFrameCollection.cs
- PassportAuthenticationModule.cs
- Pair.cs
- RecognitionEventArgs.cs
- Iis7Helper.cs
- LinkGrep.cs
- _CacheStreams.cs
- SecondaryViewProvider.cs
- PingReply.cs
- PasswordPropertyTextAttribute.cs
- TableAdapterManagerMethodGenerator.cs
- SafeProcessHandle.cs
- DataMemberAttribute.cs
- Util.cs
- XmlNamedNodeMap.cs
- PropertyToken.cs
- SubMenuStyle.cs
- NotConverter.cs
- FieldAccessException.cs
- XmlText.cs
- FixedBufferAttribute.cs
- MimeMapping.cs
- HttpListenerResponse.cs
- HandoffBehavior.cs