Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- uribuilder.cs
- TableLayoutPanelCellPosition.cs
- WorkflowView.cs
- TextFormatterContext.cs
- QueryOptionExpression.cs
- XmlNodeReader.cs
- MexBindingBindingCollectionElement.cs
- CallbackTimeoutsElement.cs
- UserControlCodeDomTreeGenerator.cs
- CursorConverter.cs
- XsdDataContractImporter.cs
- CodeStatement.cs
- AnchoredBlock.cs
- ClusterRegistryConfigurationProvider.cs
- WebPartsSection.cs
- StreamWithDictionary.cs
- WizardStepBase.cs
- FixUpCollection.cs
- FSWPathEditor.cs
- CLSCompliantAttribute.cs
- SecureStringHasher.cs
- DataGridAddNewRow.cs
- BoolExpressionVisitors.cs
- LicFileLicenseProvider.cs
- RijndaelManagedTransform.cs
- TextBreakpoint.cs
- XamlPointCollectionSerializer.cs
- DmlSqlGenerator.cs
- IPAddress.cs
- BuildProviderCollection.cs
- LinearKeyFrames.cs
- TextServicesCompartmentContext.cs
- ServiceInfo.cs
- SudsWriter.cs
- Stroke.cs
- RequestQueue.cs
- ConfigurationPermission.cs
- TemplateLookupAction.cs
- OleDbParameter.cs
- ProfileSettingsCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- ConfigXmlElement.cs
- DateTimeAutomationPeer.cs
- KeyFrames.cs
- ImageIndexEditor.cs
- ComponentDispatcher.cs
- InputBindingCollection.cs
- cache.cs
- EntityDataSourceContainerNameConverter.cs
- ConstraintEnumerator.cs
- HasCopySemanticsAttribute.cs
- DispatcherExceptionEventArgs.cs
- TemplateNameScope.cs
- ContextQuery.cs
- XamlClipboardData.cs
- UshortList2.cs
- DefaultTypeArgumentAttribute.cs
- GenericWebPart.cs
- SQLCharsStorage.cs
- ProxyFragment.cs
- BlurEffect.cs
- XPathEmptyIterator.cs
- SemaphoreFullException.cs
- QilFactory.cs
- ComponentGuaranteesAttribute.cs
- Matrix3D.cs
- IList.cs
- FormCollection.cs
- InProcStateClientManager.cs
- Line.cs
- UIPermission.cs
- NetTcpSecurityElement.cs
- KnownTypes.cs
- SerialErrors.cs
- SQLBinary.cs
- IPCCacheManager.cs
- DataGridViewColumnConverter.cs
- ListViewItem.cs
- ContainsRowNumberChecker.cs
- PopupEventArgs.cs
- ArrayHelper.cs
- ProxyFragment.cs
- DesignerActionService.cs
- ResourceDisplayNameAttribute.cs
- CodeMemberEvent.cs
- FactoryGenerator.cs
- TextEncodedRawTextWriter.cs
- CollectionConverter.cs
- GPPOINTF.cs
- SyndicationElementExtensionCollection.cs
- RegexInterpreter.cs
- TextBoxDesigner.cs
- PopupRootAutomationPeer.cs
- CFGGrammar.cs
- MatrixTransform3D.cs
- OdbcHandle.cs
- EdmValidator.cs
- ReadonlyMessageFilter.cs
- CodeParameterDeclarationExpression.cs
- GridEntry.cs