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
- DiscriminatorMap.cs
- TextRangeBase.cs
- CollectionBase.cs
- RtfToXamlReader.cs
- ComponentEvent.cs
- Debug.cs
- RealProxy.cs
- TextSimpleMarkerProperties.cs
- EventHandlers.cs
- CompiledQueryCacheEntry.cs
- IISMapPath.cs
- TabletCollection.cs
- RectAnimationUsingKeyFrames.cs
- Pair.cs
- SimpleHandlerBuildProvider.cs
- Resources.Designer.cs
- XmlName.cs
- TabItem.cs
- BaseDataList.cs
- KeyValueConfigurationCollection.cs
- translator.cs
- TableLayoutStyle.cs
- ISAPIWorkerRequest.cs
- Variant.cs
- HttpProfileBase.cs
- DynamicValidatorEventArgs.cs
- ImageIndexConverter.cs
- InstanceDataCollectionCollection.cs
- GetPageCompletedEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- TraceContextRecord.cs
- VarRemapper.cs
- SqlDataSourceConfigureFilterForm.cs
- TextEditorTyping.cs
- DataControlFieldCollection.cs
- LocatorGroup.cs
- HttpRequestWrapper.cs
- ContentElementAutomationPeer.cs
- AnchoredBlock.cs
- PenContext.cs
- FormViewPagerRow.cs
- AsyncCompletedEventArgs.cs
- FontSourceCollection.cs
- DispatcherHooks.cs
- EmissiveMaterial.cs
- Symbol.cs
- DataRow.cs
- StaticSiteMapProvider.cs
- OdbcHandle.cs
- OrderByQueryOptionExpression.cs
- DateTimeStorage.cs
- SwitchLevelAttribute.cs
- SmiRequestExecutor.cs
- IdentityModelDictionary.cs
- DataGridBoolColumn.cs
- KeySpline.cs
- XomlCompilerResults.cs
- DataBoundControlAdapter.cs
- GeometryGroup.cs
- ToolStripDropDownClosingEventArgs.cs
- DoubleCollectionValueSerializer.cs
- X509Utils.cs
- ZoneButton.cs
- DesignerProperties.cs
- ExplicitDiscriminatorMap.cs
- GlyphRun.cs
- MimeAnyImporter.cs
- XmlResolver.cs
- TextServicesContext.cs
- BezierSegment.cs
- WebEvents.cs
- XmlSchemaSimpleType.cs
- StylusEditingBehavior.cs
- UidPropertyAttribute.cs
- ProxyWebPartConnectionCollection.cs
- ReplacementText.cs
- HtmlInputHidden.cs
- QilScopedVisitor.cs
- OracleEncoding.cs
- MergeFilterQuery.cs
- XPathSingletonIterator.cs
- followingquery.cs
- TreeNodeStyle.cs
- XamlSerializerUtil.cs
- InputLanguage.cs
- UIInitializationException.cs
- ChtmlLinkAdapter.cs
- ExpressionsCollectionEditor.cs
- DataBoundControl.cs
- _DomainName.cs
- SchemaImporterExtensionElementCollection.cs
- WebServiceErrorEvent.cs
- Triplet.cs
- SortedList.cs
- BrowserDefinition.cs
- ComboBox.cs
- GraphicsPath.cs
- QilList.cs
- SponsorHelper.cs
- WindowsUserNameSecurityTokenAuthenticator.cs