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
- BrowserCapabilitiesCodeGenerator.cs
- PropertyGridEditorPart.cs
- TextParagraph.cs
- ToolStripSeparatorRenderEventArgs.cs
- SchemaNotation.cs
- _Rfc2616CacheValidators.cs
- CssTextWriter.cs
- OleDbSchemaGuid.cs
- TextControlDesigner.cs
- TableNameAttribute.cs
- SiteMapNodeCollection.cs
- DataGridViewRow.cs
- SqlNotificationEventArgs.cs
- ScrollItemPatternIdentifiers.cs
- RenderTargetBitmap.cs
- UnsupportedPolicyOptionsException.cs
- DocumentSequence.cs
- SafeArrayRankMismatchException.cs
- Propagator.JoinPropagator.cs
- WebControlsSection.cs
- CompositeCollectionView.cs
- SplashScreen.cs
- SerializationEventsCache.cs
- ReachFixedPageSerializerAsync.cs
- ExceptionUtil.cs
- HandlerWithFactory.cs
- MembershipPasswordException.cs
- Empty.cs
- GcHandle.cs
- DefaultObjectMappingItemCollection.cs
- WindowsGraphics2.cs
- DmlSqlGenerator.cs
- BitmapImage.cs
- ApplicationSecurityManager.cs
- Mutex.cs
- DataControlFieldCell.cs
- XmlWriter.cs
- WebExceptionStatus.cs
- StoragePropertyMapping.cs
- ClientSponsor.cs
- XmlDocumentSerializer.cs
- AttributeTable.cs
- PathSegmentCollection.cs
- EdmTypeAttribute.cs
- RemotingConfiguration.cs
- BodyGlyph.cs
- AuthenticationModuleElement.cs
- SafeCryptHandles.cs
- LogRestartAreaEnumerator.cs
- TimeManager.cs
- MouseButtonEventArgs.cs
- AuthorizationRule.cs
- RelationshipNavigation.cs
- SystemNetHelpers.cs
- MessageFormatterConverter.cs
- _AuthenticationState.cs
- safex509handles.cs
- DataGridViewAddColumnDialog.cs
- PhysicalFontFamily.cs
- HtmlInputControl.cs
- _SslState.cs
- BooleanSwitch.cs
- FixedSchema.cs
- ConstructorBuilder.cs
- PickBranchDesigner.xaml.cs
- SafeMILHandle.cs
- ThrowHelper.cs
- SerializationInfo.cs
- SecurityPolicySection.cs
- ScrollEvent.cs
- LockCookie.cs
- Int32CollectionConverter.cs
- DaylightTime.cs
- MarkerProperties.cs
- SimpleMailWebEventProvider.cs
- MetafileHeaderWmf.cs
- MembershipSection.cs
- OrderByQueryOptionExpression.cs
- TextEvent.cs
- ArcSegment.cs
- HybridDictionary.cs
- NetworkInformationException.cs
- RepeaterItemEventArgs.cs
- Expander.cs
- XmlSchemaExternal.cs
- DecoderExceptionFallback.cs
- ImageFormat.cs
- NetMsmqSecurityElement.cs
- ConfigXmlCDataSection.cs
- XmlReflectionMember.cs
- DocumentXPathNavigator.cs
- ValuePattern.cs
- DocumentSequence.cs
- DictionaryContent.cs
- ProfessionalColorTable.cs
- DerivedKeySecurityToken.cs
- RequestChannelBinder.cs
- ExceptionTrace.cs
- SystemNetworkInterface.cs
- IDataContractSurrogate.cs