Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //[....] //----------------------------------------------------------------------------- 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
- WebPartsSection.cs
- Oid.cs
- WindowCollection.cs
- OleDbError.cs
- FilterableAttribute.cs
- ToolStripSeparatorRenderEventArgs.cs
- WindowsPen.cs
- ListDictionaryInternal.cs
- ListBoxChrome.cs
- ListParagraph.cs
- SelectionWordBreaker.cs
- DataBoundControlHelper.cs
- SchemaTableOptionalColumn.cs
- DesignTimeSiteMapProvider.cs
- PartialCachingControl.cs
- DomainConstraint.cs
- AccessDataSource.cs
- BitmapCodecInfoInternal.cs
- IpcChannelHelper.cs
- AuthStoreRoleProvider.cs
- Gdiplus.cs
- AsyncResult.cs
- MetafileHeaderWmf.cs
- HandledEventArgs.cs
- BooleanConverter.cs
- XmlSchemaIdentityConstraint.cs
- Transform.cs
- CompressionTracing.cs
- RemoteWebConfigurationHostStream.cs
- MethodRental.cs
- AssemblyHelper.cs
- ExpressionPrefixAttribute.cs
- DataColumnMappingCollection.cs
- AgileSafeNativeMemoryHandle.cs
- CurrentChangingEventArgs.cs
- FormsIdentity.cs
- StringDictionary.cs
- CryptoProvider.cs
- TextSelection.cs
- LinqDataView.cs
- IPGlobalProperties.cs
- sqlcontext.cs
- AccessViolationException.cs
- TextModifier.cs
- CheckedPointers.cs
- Triplet.cs
- PrivacyNoticeBindingElement.cs
- DataStreams.cs
- GestureRecognizer.cs
- XPathNode.cs
- IssuedTokenServiceElement.cs
- XmlSchemaCompilationSettings.cs
- SemaphoreSecurity.cs
- SchemaInfo.cs
- MD5CryptoServiceProvider.cs
- MessageQueueTransaction.cs
- TokenBasedSet.cs
- RawKeyboardInputReport.cs
- DataSourceCacheDurationConverter.cs
- AstTree.cs
- WindowsTokenRoleProvider.cs
- CornerRadius.cs
- CrossAppDomainChannel.cs
- __FastResourceComparer.cs
- XPathMessageFilterTable.cs
- MemoryFailPoint.cs
- CodeFieldReferenceExpression.cs
- GB18030Encoding.cs
- WhitespaceRuleReader.cs
- SemanticResultKey.cs
- WhileDesigner.cs
- Matrix.cs
- XmlAtomErrorReader.cs
- SequentialOutput.cs
- QueueAccessMode.cs
- PartialArray.cs
- EnumValAlphaComparer.cs
- ToolBarOverflowPanel.cs
- InteropEnvironment.cs
- PipelineComponent.cs
- EmptyCollection.cs
- ExpressionUtilities.cs
- CodeLinePragma.cs
- Compiler.cs
- RootBrowserWindowAutomationPeer.cs
- TimeStampChecker.cs
- DataColumnMappingCollection.cs
- PrivilegedConfigurationManager.cs
- WebSysDefaultValueAttribute.cs
- InputDevice.cs
- DataObjectEventArgs.cs
- ActivitySurrogateSelector.cs
- LinearKeyFrames.cs
- DebuggerService.cs
- TypedElement.cs
- ToolConsole.cs
- SafeFileHandle.cs
- QueryOutputWriter.cs
- PolygonHotSpot.cs
- XmlDataLoader.cs