Code:
/ DotNET / DotNET / 8.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
- CallbackTimeoutsBehavior.cs
- UnmanagedMarshal.cs
- HostProtectionPermission.cs
- CategoryGridEntry.cs
- AutoGeneratedField.cs
- QueryReaderSettings.cs
- SyndicationDeserializer.cs
- FontUnit.cs
- Style.cs
- BaseTemplateParser.cs
- SelectionHighlightInfo.cs
- HtmlWindow.cs
- WindowsGraphics.cs
- Selection.cs
- ViewGenResults.cs
- XmlMtomReader.cs
- ComponentManagerBroker.cs
- AlternateViewCollection.cs
- PerformanceCounterPermissionEntryCollection.cs
- RotateTransform.cs
- MenuAdapter.cs
- _DisconnectOverlappedAsyncResult.cs
- PersonalizationAdministration.cs
- XmlBoundElement.cs
- HtmlElementErrorEventArgs.cs
- ToolStripTextBox.cs
- PublisherIdentityPermission.cs
- EditorZoneBase.cs
- BuildProvider.cs
- COM2EnumConverter.cs
- FutureFactory.cs
- ReaderWriterLockWrapper.cs
- ExcludePathInfo.cs
- AspNetSynchronizationContext.cs
- UnknownWrapper.cs
- PartialList.cs
- XmlSerializationReader.cs
- DesignerActionVerbList.cs
- CompilerGlobalScopeAttribute.cs
- StrokeDescriptor.cs
- DigitShape.cs
- Renderer.cs
- DesignRelationCollection.cs
- TextBoxLine.cs
- HighlightVisual.cs
- SqlUserDefinedTypeAttribute.cs
- CssStyleCollection.cs
- XDRSchema.cs
- UnmanagedBitmapWrapper.cs
- CodeGenerator.cs
- ConfigurationSectionGroup.cs
- OuterGlowBitmapEffect.cs
- IItemProperties.cs
- HuffCodec.cs
- SimpleTextLine.cs
- HitTestDrawingContextWalker.cs
- TaskFormBase.cs
- ContainerAction.cs
- RelatedCurrencyManager.cs
- ClientUrlResolverWrapper.cs
- MaskedTextProvider.cs
- NativeCppClassAttribute.cs
- BitmapMetadataEnumerator.cs
- UniqueConstraint.cs
- WindowsTreeView.cs
- RemotingServices.cs
- PromptBuilder.cs
- XmlChildEnumerator.cs
- ClientEventManager.cs
- DPAPIProtectedConfigurationProvider.cs
- PasswordRecoveryAutoFormat.cs
- StorageBasedPackageProperties.cs
- PathFigureCollection.cs
- XmlNotation.cs
- EditorZone.cs
- AttachedPropertyMethodSelector.cs
- SessionState.cs
- StorageEntitySetMapping.cs
- SamlAuthorizationDecisionStatement.cs
- TextStore.cs
- ProviderConnectionPoint.cs
- TableLayoutPanelCellPosition.cs
- ZipIOExtraFieldZip64Element.cs
- AuthenticationConfig.cs
- VSWCFServiceContractGenerator.cs
- DoubleStorage.cs
- NamedPipeAppDomainProtocolHandler.cs
- XsdDuration.cs
- ScalarOps.cs
- AsymmetricSignatureFormatter.cs
- ReadContentAsBinaryHelper.cs
- InkPresenterAutomationPeer.cs
- TypefaceMap.cs
- DataGridViewColumnCollection.cs
- ChangeNode.cs
- _SingleItemRequestCache.cs
- CombinedGeometry.cs
- MenuItemBinding.cs
- XPathNavigator.cs
- ContractListAdapter.cs