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
- SchemaTypeEmitter.cs
- Emitter.cs
- ExpressionWriter.cs
- GroupBox.cs
- Expressions.cs
- _NegoStream.cs
- MessageAction.cs
- DoubleAnimationUsingPath.cs
- HtmlWindowCollection.cs
- IndexedEnumerable.cs
- TextServicesManager.cs
- FileDialogPermission.cs
- CompilationRelaxations.cs
- IdentifierCollection.cs
- login.cs
- SqlStatistics.cs
- TrackBarRenderer.cs
- HtmlDocument.cs
- SqlDataReaderSmi.cs
- RightsManagementPermission.cs
- PasswordRecovery.cs
- Dictionary.cs
- DragEvent.cs
- ConfigXmlWhitespace.cs
- XmlElementAttributes.cs
- mansign.cs
- JournalEntryListConverter.cs
- MobileUserControlDesigner.cs
- DefaultHttpHandler.cs
- ExternalFile.cs
- WebPartMovingEventArgs.cs
- ModifyActivitiesPropertyDescriptor.cs
- DependencyObjectValidator.cs
- DropDownButton.cs
- ReflectionHelper.cs
- BuilderElements.cs
- WebEventTraceProvider.cs
- CheckBoxPopupAdapter.cs
- HtmlInputHidden.cs
- TextLineResult.cs
- SafeRightsManagementSessionHandle.cs
- Thickness.cs
- RepeatBehavior.cs
- SecurityState.cs
- QuadraticBezierSegment.cs
- WpfWebRequestHelper.cs
- CodeNamespaceCollection.cs
- NameTable.cs
- EntityClientCacheKey.cs
- FileInfo.cs
- SafeMILHandle.cs
- ProcessInfo.cs
- _CommandStream.cs
- PublisherIdentityPermission.cs
- WCFBuildProvider.cs
- FileUtil.cs
- BCLDebug.cs
- TextElementEnumerator.cs
- ErrorWebPart.cs
- SqlFactory.cs
- DynamicILGenerator.cs
- DynamicFilter.cs
- SamlAdvice.cs
- TrackBarDesigner.cs
- Vector3DAnimation.cs
- GeneralTransform3DGroup.cs
- RadioButton.cs
- XmlCharacterData.cs
- SafeRightsManagementQueryHandle.cs
- DataTable.cs
- ResourcesGenerator.cs
- ProcessManager.cs
- Vector3DAnimation.cs
- MetabaseReader.cs
- versioninfo.cs
- UInt32Converter.cs
- UserNameSecurityTokenParameters.cs
- RowTypePropertyElement.cs
- MouseGestureConverter.cs
- SqlLiftWhereClauses.cs
- GridEntry.cs
- HyperLink.cs
- CompositeDuplexElement.cs
- path.cs
- ChtmlTextBoxAdapter.cs
- RequestCacheManager.cs
- StateBag.cs
- EventHandlersStore.cs
- DataShape.cs
- RankException.cs
- XamlFilter.cs
- BindableAttribute.cs
- FormCollection.cs
- LazyTextWriterCreator.cs
- SpinWait.cs
- VirtualizedItemPattern.cs
- ConnectionInterfaceCollection.cs
- X509ChainElement.cs
- TextTreeInsertUndoUnit.cs
- SerialReceived.cs