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
- XmlSchemaAnnotated.cs
- BinaryMethodMessage.cs
- OrderByQueryOptionExpression.cs
- MD5.cs
- AuditLevel.cs
- PageTextBox.cs
- SessionStateSection.cs
- ChangePasswordDesigner.cs
- CharUnicodeInfo.cs
- FileSystemEventArgs.cs
- PageBreakRecord.cs
- HtmlInputButton.cs
- IdentityHolder.cs
- DetailsView.cs
- TileModeValidation.cs
- ObjectConverter.cs
- CookielessHelper.cs
- HttpPostedFileBase.cs
- DispatcherObject.cs
- BrowsableAttribute.cs
- ProfileService.cs
- SerializationInfoEnumerator.cs
- DataGridViewSelectedCellCollection.cs
- Pointer.cs
- TreeNode.cs
- BitmapSourceSafeMILHandle.cs
- XmlIterators.cs
- DesignTimeTemplateParser.cs
- ClientScriptManager.cs
- GuidelineCollection.cs
- CodeBlockBuilder.cs
- AnnouncementClient.cs
- InputScopeConverter.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- CompoundFileStorageReference.cs
- StringAttributeCollection.cs
- DataReaderContainer.cs
- Column.cs
- BaseComponentEditor.cs
- NamespaceMapping.cs
- PolicyManager.cs
- CodeNamespaceImport.cs
- BooleanAnimationUsingKeyFrames.cs
- DocumentApplicationJournalEntry.cs
- SynchronizedPool.cs
- DetailsViewModeEventArgs.cs
- GridViewDeleteEventArgs.cs
- SqlNodeTypeOperators.cs
- Selector.cs
- ReadOnlyDictionary.cs
- HandleTable.cs
- Int32RectValueSerializer.cs
- NativeMethods.cs
- BevelBitmapEffect.cs
- Dynamic.cs
- RepeatButton.cs
- DataGridAddNewRow.cs
- AlternateView.cs
- milrender.cs
- ThemeableAttribute.cs
- PageEventArgs.cs
- PanelStyle.cs
- ColumnTypeConverter.cs
- TypeHelpers.cs
- ExtensionFile.cs
- ZoneLinkButton.cs
- XmlQueryRuntime.cs
- ScopelessEnumAttribute.cs
- SqlServer2KCompatibilityAnnotation.cs
- CultureMapper.cs
- CroppedBitmap.cs
- GroupQuery.cs
- WebEventTraceProvider.cs
- LinqDataSourceContextEventArgs.cs
- CachedRequestParams.cs
- SessionStateContainer.cs
- CodeNamespaceCollection.cs
- IFormattable.cs
- StateWorkerRequest.cs
- SingleStorage.cs
- HtmlElementEventArgs.cs
- tibetanshape.cs
- LinkUtilities.cs
- DataStorage.cs
- parserscommon.cs
- XamlTreeBuilder.cs
- XmlReflectionMember.cs
- Metadata.cs
- LoginStatusDesigner.cs
- OpenFileDialog.cs
- XPathNodeIterator.cs
- ColorConvertedBitmap.cs
- TextEditorDragDrop.cs
- MD5CryptoServiceProvider.cs
- PrintPreviewDialog.cs
- RequestResizeEvent.cs
- ToolStripProgressBar.cs
- ConfigurationLocation.cs
- Thread.cs
- PaperSize.cs