Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheOutputQuery.cs / 1305376 / 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. // //[....] //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- sqlstateclientmanager.cs
- TickBar.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- SoapSchemaExporter.cs
- SystemIdentity.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- WebConfigurationHost.cs
- Page.cs
- RemotingAttributes.cs
- EdmError.cs
- COAUTHIDENTITY.cs
- DataPointer.cs
- ConfigXmlDocument.cs
- HtmlInputControl.cs
- UnmanagedMarshal.cs
- Camera.cs
- RecognizedAudio.cs
- ResourceAttributes.cs
- ToolStripItemGlyph.cs
- WhitespaceRuleLookup.cs
- MostlySingletonList.cs
- ConsoleKeyInfo.cs
- D3DImage.cs
- RegexRunner.cs
- TimeoutException.cs
- LineVisual.cs
- SchemaAttDef.cs
- ResourceReferenceExpressionConverter.cs
- RelationshipDetailsRow.cs
- AccessorTable.cs
- DataSourceCollectionBase.cs
- SQLByteStorage.cs
- ZipIOExtraFieldElement.cs
- ElementsClipboardData.cs
- ObjectDataSource.cs
- Vector3DIndependentAnimationStorage.cs
- MailMessage.cs
- DataBoundLiteralControl.cs
- HttpInputStream.cs
- BamlResourceSerializer.cs
- LineGeometry.cs
- CollectionEditorDialog.cs
- DynamicScriptObject.cs
- PolyBezierSegment.cs
- TextParagraphCache.cs
- AudioFormatConverter.cs
- OdbcEnvironmentHandle.cs
- VectorConverter.cs
- ClientData.cs
- SessionStateModule.cs
- TransformerInfoCollection.cs
- FormsAuthenticationTicket.cs
- Exception.cs
- DataGridViewCellCancelEventArgs.cs
- UnicodeEncoding.cs
- XmlException.cs
- PathGeometry.cs
- SortExpressionBuilder.cs
- Processor.cs
- EntityContainerRelationshipSet.cs
- WrappedKeySecurityTokenParameters.cs
- ProvidePropertyAttribute.cs
- QueryCacheEntry.cs
- externdll.cs
- ThemeInfoAttribute.cs
- DbProviderConfigurationHandler.cs
- Zone.cs
- DesignTimeVisibleAttribute.cs
- NullableConverter.cs
- ModelPropertyCollectionImpl.cs
- TraversalRequest.cs
- ContractInstanceProvider.cs
- LogEntryDeserializer.cs
- WindowsGraphicsWrapper.cs
- ScriptIgnoreAttribute.cs
- TransformerConfigurationWizardBase.cs
- NotCondition.cs
- MinMaxParagraphWidth.cs
- WindowsAuthenticationEventArgs.cs
- DeobfuscatingStream.cs
- LessThanOrEqual.cs
- ProxyElement.cs
- Converter.cs
- ColumnCollectionEditor.cs
- FrameworkPropertyMetadata.cs
- _TimerThread.cs
- UnmanagedMemoryStreamWrapper.cs
- Header.cs
- QueryContinueDragEvent.cs
- ServerIdentity.cs
- TypeLibConverter.cs
- SearchForVirtualItemEventArgs.cs
- RpcResponse.cs
- GridItem.cs
- SiteMapPath.cs
- odbcmetadatacollectionnames.cs
- FileResponseElement.cs
- BitmapEffectInput.cs
- handlecollector.cs
- PerfCounterSection.cs