Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
- UiaCoreProviderApi.cs
- ExceptionValidationRule.cs
- UnsafeNativeMethods.cs
- ECDiffieHellmanCng.cs
- DataConnectionHelper.cs
- SequentialOutput.cs
- ActivationServices.cs
- Registration.cs
- BinaryMethodMessage.cs
- FamilyMap.cs
- ToolStripDropDownMenu.cs
- CookielessHelper.cs
- CheckBoxField.cs
- SqlFacetAttribute.cs
- Mutex.cs
- TextEditorParagraphs.cs
- DesignTimeTemplateParser.cs
- CollectionConverter.cs
- WindowPattern.cs
- StaticTextPointer.cs
- SqlDeflator.cs
- IconBitmapDecoder.cs
- ClientRoleProvider.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- DataGridViewTextBoxCell.cs
- RotateTransform.cs
- AlgoModule.cs
- WebReferencesBuildProvider.cs
- SessionEndingEventArgs.cs
- ServiceProviders.cs
- CqlWriter.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- UnsafePeerToPeerMethods.cs
- DbConnectionOptions.cs
- RuleSettingsCollection.cs
- Point3D.cs
- SqlCacheDependency.cs
- ViewLoader.cs
- UriTemplateMatch.cs
- ValueType.cs
- PipelineComponent.cs
- AssemblyNameEqualityComparer.cs
- DataErrorValidationRule.cs
- BindingCollection.cs
- Graphics.cs
- StrokeNode.cs
- DataGridViewSortCompareEventArgs.cs
- GAC.cs
- UpdateTracker.cs
- TableRowCollection.cs
- RadioButtonFlatAdapter.cs
- ScalarConstant.cs
- Transform3DGroup.cs
- SimplePropertyEntry.cs
- ApplicationBuildProvider.cs
- NullableFloatSumAggregationOperator.cs
- EdmError.cs
- Positioning.cs
- WriteStateInfoBase.cs
- RegexTree.cs
- ItemsPresenter.cs
- CapabilitiesUse.cs
- DbConnectionOptions.cs
- XmlObjectSerializer.cs
- DataGridViewRowCollection.cs
- ManagementObjectCollection.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DictionaryTraceRecord.cs
- initElementDictionary.cs
- FixedFindEngine.cs
- SafeRegistryHandle.cs
- HuffModule.cs
- CodeArrayCreateExpression.cs
- BuildProviderAppliesToAttribute.cs
- KeysConverter.cs
- TrackBarRenderer.cs
- MSHTMLHostUtil.cs
- BatchServiceHost.cs
- WinEventTracker.cs
- DateTimeConverter.cs
- Marshal.cs
- Span.cs
- securestring.cs
- Bitmap.cs
- CompressionTracing.cs
- XmlWhitespace.cs
- SqlConnectionStringBuilder.cs
- CodeArrayIndexerExpression.cs
- AppDomainUnloadedException.cs
- ConversionHelper.cs
- CompositeClientFormatter.cs
- TreeNode.cs
- FilterQuery.cs
- LocationFactory.cs
- NoneExcludedImageIndexConverter.cs
- DateTimeConstantAttribute.cs
- RIPEMD160.cs
- CodeDirectoryCompiler.cs
- GPRECTF.cs
- ProxyWebPartManager.cs