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
- MouseEvent.cs
- MethodBuilder.cs
- XmlArrayItemAttributes.cs
- InstanceDescriptor.cs
- HwndProxyElementProvider.cs
- SpecularMaterial.cs
- RemoteWebConfigurationHostStream.cs
- XamlTreeBuilderBamlRecordWriter.cs
- HttpPostProtocolReflector.cs
- EntityDataSourceState.cs
- MdImport.cs
- FtpCachePolicyElement.cs
- EntityDataSourceStatementEditor.cs
- BinaryObjectWriter.cs
- WebSysDisplayNameAttribute.cs
- diagnosticsswitches.cs
- OleDbErrorCollection.cs
- DependencySource.cs
- PropertyConverter.cs
- SystemParameters.cs
- MediaElementAutomationPeer.cs
- BasicKeyConstraint.cs
- BitmapData.cs
- Knowncolors.cs
- _LoggingObject.cs
- AttachedAnnotationChangedEventArgs.cs
- SqlConnectionFactory.cs
- QueueSurrogate.cs
- StrokeCollection.cs
- ConfigurationStrings.cs
- HttpContext.cs
- WpfKnownTypeInvoker.cs
- DecimalFormatter.cs
- OletxVolatileEnlistment.cs
- GlyphsSerializer.cs
- parserscommon.cs
- TreeNodeCollection.cs
- ObjectCache.cs
- StreamWriter.cs
- StringHandle.cs
- Msec.cs
- TraceFilter.cs
- SymLanguageType.cs
- PagedDataSource.cs
- TextStore.cs
- VarInfo.cs
- OdbcConnectionFactory.cs
- WebBrowserNavigatedEventHandler.cs
- TypeToken.cs
- TextRangeProviderWrapper.cs
- Types.cs
- CachingParameterInspector.cs
- RowSpanVector.cs
- DefaultValueConverter.cs
- ObjRef.cs
- InputProcessorProfilesLoader.cs
- NotifyInputEventArgs.cs
- LinearKeyFrames.cs
- BridgeDataReader.cs
- GuidelineSet.cs
- Triangle.cs
- DiscoveryEndpointElement.cs
- WebPartRestoreVerb.cs
- ListItemCollection.cs
- SqlDataSourceFilteringEventArgs.cs
- AstTree.cs
- RunInstallerAttribute.cs
- Version.cs
- DataServiceQueryException.cs
- ClientApiGenerator.cs
- StatusBar.cs
- BrowserCapabilitiesCodeGenerator.cs
- SelectionGlyph.cs
- XmlMemberMapping.cs
- VisualProxy.cs
- ChangeInterceptorAttribute.cs
- Executor.cs
- SyntaxCheck.cs
- ObjectFullSpanRewriter.cs
- TreeNode.cs
- SmiContext.cs
- XmlSchemaType.cs
- _UncName.cs
- RichTextBox.cs
- InputScope.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ValueUnavailableException.cs
- InputMethod.cs
- WebBrowserNavigatingEventHandler.cs
- DataGridHelper.cs
- Permission.cs
- HTMLTagNameToTypeMapper.cs
- Privilege.cs
- VScrollProperties.cs
- EdmValidator.cs
- ExpressionList.cs
- MethodBody.cs
- DataColumnMapping.cs
- SafeIUnknown.cs
- SQLDecimal.cs