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
- AffineTransform3D.cs
- Classification.cs
- TypeBuilderInstantiation.cs
- SystemIPGlobalStatistics.cs
- TableColumnCollection.cs
- BooleanFacetDescriptionElement.cs
- Border.cs
- RewritingPass.cs
- ActiveXHelper.cs
- TlsSspiNegotiation.cs
- VoiceChangeEventArgs.cs
- PngBitmapEncoder.cs
- RegexInterpreter.cs
- ConsumerConnectionPointCollection.cs
- RemoveStoryboard.cs
- OleDbConnectionInternal.cs
- ListenerChannelContext.cs
- Border.cs
- PartialTrustVisibleAssembliesSection.cs
- HttpWebRequest.cs
- DataGridViewTextBoxEditingControl.cs
- StoreContentChangedEventArgs.cs
- XmlAttributeAttribute.cs
- Rect3DValueSerializer.cs
- ItemContainerGenerator.cs
- InnerItemCollectionView.cs
- PerformanceCounter.cs
- keycontainerpermission.cs
- MethodBody.cs
- WebPartConnectionsCancelVerb.cs
- LayoutInformation.cs
- EntityDesignerBuildProvider.cs
- DoubleCollection.cs
- ModuleConfigurationInfo.cs
- GroupPartitionExpr.cs
- ToolStripSettings.cs
- RtfToken.cs
- DirectoryInfo.cs
- XmlSchemaAppInfo.cs
- TableLayoutSettingsTypeConverter.cs
- COM2Properties.cs
- OperationResponse.cs
- webclient.cs
- HttpWebRequestElement.cs
- MruCache.cs
- SystemKeyConverter.cs
- TargetFrameworkUtil.cs
- Matrix.cs
- MultiPageTextView.cs
- PartManifestEntry.cs
- StringReader.cs
- OpenTypeLayout.cs
- HttpResponseInternalWrapper.cs
- XPathParser.cs
- FixedSOMElement.cs
- SizeConverter.cs
- ListViewAutomationPeer.cs
- BinaryNode.cs
- ObjectDataSourceWizardForm.cs
- InheritanceContextChangedEventManager.cs
- VirtualizedCellInfoCollection.cs
- Task.cs
- AddInContractAttribute.cs
- XmlResolver.cs
- PathNode.cs
- xml.cs
- UriTemplateTrieLocation.cs
- ResourceDictionary.cs
- ImageMetadata.cs
- HasCopySemanticsAttribute.cs
- ChangeDirector.cs
- ConfigurationLocationCollection.cs
- SuppressIldasmAttribute.cs
- ListViewItemCollectionEditor.cs
- XamlDesignerSerializationManager.cs
- QueryOpcode.cs
- ExtendedPropertyDescriptor.cs
- ExtensionElementCollection.cs
- CanonicalFontFamilyReference.cs
- OrderedDictionaryStateHelper.cs
- Header.cs
- FlowPosition.cs
- Utils.cs
- HwndHostAutomationPeer.cs
- DesignerActionList.cs
- CredentialCache.cs
- BindStream.cs
- DesignerVerbCollection.cs
- ScrollViewerAutomationPeer.cs
- SocketInformation.cs
- ProfileServiceManager.cs
- NameValuePermission.cs
- ScriptDescriptor.cs
- RIPEMD160Managed.cs
- TimeManager.cs
- AutoResizedEvent.cs
- ProtocolElement.cs
- WmlPageAdapter.cs
- ToolStripKeyboardHandlingService.cs
- RegisteredExpandoAttribute.cs