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
- WindowsGraphics.cs
- ConnectionStringSettings.cs
- ConfigXmlElement.cs
- BamlMapTable.cs
- GridSplitterAutomationPeer.cs
- PropertyBuilder.cs
- parserscommon.cs
- DataGridLinkButton.cs
- TemplateInstanceAttribute.cs
- DataMisalignedException.cs
- CapabilitiesAssignment.cs
- HeaderedItemsControl.cs
- FileSystemInfo.cs
- SchemaImporterExtension.cs
- XmlnsDictionary.cs
- FormCollection.cs
- IntegerFacetDescriptionElement.cs
- RequestCachingSection.cs
- InfoCardSymmetricAlgorithm.cs
- InvalidOperationException.cs
- RandomNumberGenerator.cs
- GrammarBuilderPhrase.cs
- DesigntimeLicenseContextSerializer.cs
- InvalidWMPVersionException.cs
- SqlCharStream.cs
- InvalidComObjectException.cs
- SharedUtils.cs
- FixedDocumentPaginator.cs
- BamlLocalizationDictionary.cs
- SBCSCodePageEncoding.cs
- SynchronizationLockException.cs
- RequestContext.cs
- ClientData.cs
- ColumnResizeAdorner.cs
- PropertyMapper.cs
- StorageModelBuildProvider.cs
- LoginViewDesigner.cs
- Int32.cs
- Int32CollectionConverter.cs
- RectKeyFrameCollection.cs
- AssertSection.cs
- MetadataCache.cs
- Win32Native.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- EdmFunctions.cs
- NameTable.cs
- AVElementHelper.cs
- WebPartUtil.cs
- ServiceHostFactory.cs
- XamlReader.cs
- UnhandledExceptionEventArgs.cs
- XmlSchemaRedefine.cs
- ProviderIncompatibleException.cs
- ImageFormatConverter.cs
- shaperfactory.cs
- XmlCharType.cs
- StorageEntityTypeMapping.cs
- IndicShape.cs
- StrokeCollectionDefaultValueFactory.cs
- MultiPropertyDescriptorGridEntry.cs
- DockingAttribute.cs
- EventProviderWriter.cs
- RuleSetDialog.Designer.cs
- WindowsImpersonationContext.cs
- Html32TextWriter.cs
- HttpHandlerActionCollection.cs
- ChangeTracker.cs
- CultureInfoConverter.cs
- MimeMapping.cs
- UserControlCodeDomTreeGenerator.cs
- ProxyGenerationError.cs
- ReadOnlyHierarchicalDataSource.cs
- MatrixUtil.cs
- CrossContextChannel.cs
- HWStack.cs
- CaseInsensitiveComparer.cs
- VirtualDirectoryMappingCollection.cs
- XmlChildEnumerator.cs
- SQLChars.cs
- TrailingSpaceComparer.cs
- DataServiceConfiguration.cs
- CellTreeNode.cs
- PointAnimationBase.cs
- ViewPort3D.cs
- Clause.cs
- EditorZoneBase.cs
- SystemThemeKey.cs
- AuthorizationRuleCollection.cs
- ConfigsHelper.cs
- InsufficientMemoryException.cs
- SecurityTokenException.cs
- SimpleTypeResolver.cs
- Content.cs
- CodeMethodMap.cs
- Assert.cs
- DelegateHelpers.Generated.cs
- TdsParserSafeHandles.cs
- CollectionViewSource.cs
- Span.cs
- EdmProviderManifest.cs