Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheOutputQuery.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ParallelTimeline.cs
- CommunicationException.cs
- SetterBase.cs
- UInt64.cs
- StringWriter.cs
- WebColorConverter.cs
- DynamicQueryStringParameter.cs
- DataControlButton.cs
- BeginSelectCardRequest.cs
- TouchDevice.cs
- MultiDataTrigger.cs
- StringAttributeCollection.cs
- Visual.cs
- TemplatedWizardStep.cs
- PolicyStatement.cs
- DataStreamFromComStream.cs
- Encoder.cs
- PackageRelationship.cs
- DbLambda.cs
- SamlNameIdentifierClaimResource.cs
- StylusDevice.cs
- DBDataPermission.cs
- JsonReaderWriterFactory.cs
- ScalarRestriction.cs
- FlowDocumentFormatter.cs
- QuotedPairReader.cs
- WebPartCatalogAddVerb.cs
- DbConvert.cs
- FunctionNode.cs
- Brush.cs
- LinqDataSourceDeleteEventArgs.cs
- Assert.cs
- AttributeUsageAttribute.cs
- CommandLineParser.cs
- HttpModulesSection.cs
- XXXInfos.cs
- ReverseQueryOperator.cs
- QueryContinueDragEventArgs.cs
- ExtentCqlBlock.cs
- QilScopedVisitor.cs
- CompressedStack.cs
- ListenerElementsCollection.cs
- IndexOutOfRangeException.cs
- PartialTrustVisibleAssemblyCollection.cs
- DbModificationClause.cs
- SchemaComplexType.cs
- MultiViewDesigner.cs
- Automation.cs
- RuntimeHandles.cs
- InvalidAsynchronousStateException.cs
- DecoderNLS.cs
- QueueSurrogate.cs
- MetadataProperty.cs
- CustomValidator.cs
- CheckBoxList.cs
- EventDescriptorCollection.cs
- TypeDescriptorFilterService.cs
- DataServices.cs
- XmlSchemaGroupRef.cs
- SQLString.cs
- MessageQueueKey.cs
- ReadOnlyTernaryTree.cs
- Bitmap.cs
- VectorAnimation.cs
- EventLogPermissionAttribute.cs
- XmlTypeMapping.cs
- ArgumentNullException.cs
- SqlUtils.cs
- AppDomainManager.cs
- xml.cs
- Globals.cs
- ProviderBase.cs
- PeerToPeerException.cs
- BitmapCacheBrush.cs
- DataBindingCollection.cs
- CollectionViewGroupRoot.cs
- OdbcCommand.cs
- UnaryOperationBinder.cs
- LicenseProviderAttribute.cs
- Model3DGroup.cs
- FacetValueContainer.cs
- OleDbConnection.cs
- Repeater.cs
- BaseUriWithWildcard.cs
- ConditionalDesigner.cs
- AdCreatedEventArgs.cs
- MetaData.cs
- SerTrace.cs
- ListViewDeleteEventArgs.cs
- SafeNativeMethodsMilCoreApi.cs
- ElementNotEnabledException.cs
- DtdParser.cs
- CaseStatement.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- AgileSafeNativeMemoryHandle.cs
- MethodMessage.cs
- ImportRequest.cs
- PagedDataSource.cs
- BaseUriHelper.cs
- SHA256.cs