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
- GeneralTransform3DGroup.cs
- CoreSwitches.cs
- LeafCellTreeNode.cs
- BStrWrapper.cs
- ViewCellSlot.cs
- MiniMapControl.xaml.cs
- BrushConverter.cs
- CopyOnWriteList.cs
- HttpChannelHelpers.cs
- ConsoleTraceListener.cs
- HtmlInputReset.cs
- NullExtension.cs
- GridPatternIdentifiers.cs
- HttpHostedTransportConfiguration.cs
- ConstraintConverter.cs
- COM2ColorConverter.cs
- SspiWrapper.cs
- SamlAuthorizationDecisionClaimResource.cs
- PackageRelationshipCollection.cs
- ArgumentOutOfRangeException.cs
- DynamicDiscoveryDocument.cs
- TreeNodeSelectionProcessor.cs
- EntityDataSourceChangingEventArgs.cs
- ListControlStringCollectionEditor.cs
- _emptywebproxy.cs
- Size.cs
- XmlSchemaSimpleType.cs
- LineUtil.cs
- SoapSchemaExporter.cs
- TextBox.cs
- ConfigurationException.cs
- webeventbuffer.cs
- ErrorFormatter.cs
- XmlAttributeHolder.cs
- MessageQueue.cs
- securestring.cs
- BlurBitmapEffect.cs
- VoiceObjectToken.cs
- SafeFileMapViewHandle.cs
- AggregateNode.cs
- CellQuery.cs
- StrokeDescriptor.cs
- ConfigXmlAttribute.cs
- ViewGenerator.cs
- CapabilitiesRule.cs
- WebPartMenu.cs
- GeneralTransform.cs
- TableAutomationPeer.cs
- EntityTransaction.cs
- LinkedResource.cs
- RuntimeHandles.cs
- TableParaClient.cs
- RawStylusSystemGestureInputReport.cs
- ConsumerConnectionPoint.cs
- SelectionWordBreaker.cs
- Bitmap.cs
- RadioButtonBaseAdapter.cs
- XmlBufferedByteStreamReader.cs
- SQLByteStorage.cs
- InputBindingCollection.cs
- DataGridViewCell.cs
- WindowsListViewGroupHelper.cs
- DependencyObject.cs
- RunInstallerAttribute.cs
- DrawingContextWalker.cs
- RadioButtonStandardAdapter.cs
- SqlUserDefinedTypeAttribute.cs
- BodyGlyph.cs
- XmlArrayItemAttributes.cs
- LinqDataSourceContextData.cs
- NamespaceInfo.cs
- CommandExpr.cs
- ExpressionConverter.cs
- XPathDocumentBuilder.cs
- ProxyWebPart.cs
- x509store.cs
- ElementHostPropertyMap.cs
- PartialArray.cs
- ItemMap.cs
- X509ChainPolicy.cs
- WebBrowserContainer.cs
- FixedTextSelectionProcessor.cs
- ColorAnimation.cs
- CodeSnippetTypeMember.cs
- Thumb.cs
- Screen.cs
- XAMLParseException.cs
- XmlSerializationWriter.cs
- CallContext.cs
- HtmlImage.cs
- MemoryFailPoint.cs
- Pair.cs
- WorkflowStateRollbackService.cs
- SmiEventStream.cs
- StartFileNameEditor.cs
- PathSegmentCollection.cs
- ExtractorMetadata.cs
- WaitingCursor.cs
- CompiledELinqQueryState.cs
- HttpApplicationStateBase.cs