Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- X509IssuerSerialKeyIdentifierClause.cs
- SessionParameter.cs
- SqlInternalConnectionTds.cs
- EntityAdapter.cs
- LinqDataSourceDeleteEventArgs.cs
- Stroke2.cs
- AssemblyBuilder.cs
- APCustomTypeDescriptor.cs
- SimpleWebHandlerParser.cs
- HideDisabledControlAdapter.cs
- TextOutput.cs
- DataGridCommandEventArgs.cs
- CodeParameterDeclarationExpression.cs
- LogicalTreeHelper.cs
- TraceHandlerErrorFormatter.cs
- XmlDocumentFragment.cs
- EventLogEntry.cs
- DataGridViewHitTestInfo.cs
- OleDbWrapper.cs
- XsdBuilder.cs
- CustomAttributeFormatException.cs
- DiagnosticsConfiguration.cs
- BrowserCapabilitiesFactory.cs
- FrameworkContentElementAutomationPeer.cs
- SqlNode.cs
- CustomErrorsSection.cs
- ApplicationTrust.cs
- ConfigurationStrings.cs
- GACMembershipCondition.cs
- TypeUtil.cs
- SchemaMapping.cs
- ToggleButton.cs
- InkCollectionBehavior.cs
- Figure.cs
- ButtonBase.cs
- TriState.cs
- SqlExpander.cs
- AutoFocusStyle.xaml.cs
- ShaderEffect.cs
- StdValidatorsAndConverters.cs
- SchemaMerger.cs
- MarshalByRefObject.cs
- TemplateBuilder.cs
- X509AudioLogo.cs
- UnauthorizedWebPart.cs
- PointF.cs
- AddingNewEventArgs.cs
- UnknownWrapper.cs
- ResourceAssociationTypeEnd.cs
- PersonalizablePropertyEntry.cs
- XamlPathDataSerializer.cs
- PartitionResolver.cs
- UnsafeNativeMethods.cs
- SplitContainer.cs
- GlyphElement.cs
- HtmlInputPassword.cs
- FigureParagraph.cs
- SHA384Cng.cs
- XmlCharCheckingReader.cs
- ArcSegment.cs
- SwitchAttribute.cs
- CodeMethodReturnStatement.cs
- SectionInformation.cs
- TextRunTypographyProperties.cs
- HttpDebugHandler.cs
- PublisherIdentityPermission.cs
- ConfigDefinitionUpdates.cs
- LicenseProviderAttribute.cs
- GetLedgerEntryForRecipientRequest.cs
- Baml2006KnownTypes.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- MatchingStyle.cs
- WebPartMenu.cs
- DataGridViewLinkColumn.cs
- OutputWindow.cs
- AudioException.cs
- DataControlFieldCollection.cs
- ToolStripItemClickedEventArgs.cs
- XmlSchemaComplexContentExtension.cs
- ScriptResourceAttribute.cs
- TextDpi.cs
- StandardTransformFactory.cs
- ApplicationFileCodeDomTreeGenerator.cs
- PersistenceTypeAttribute.cs
- DataBindingHandlerAttribute.cs
- CacheHelper.cs
- RelationshipEnd.cs
- CompiledXpathExpr.cs
- DisplayMemberTemplateSelector.cs
- TraceSection.cs
- Win32NamedPipes.cs
- WindowsListViewGroupHelper.cs
- TableAdapterManagerGenerator.cs
- TimeoutTimer.cs
- ExpressionNode.cs
- DecoderReplacementFallback.cs
- AspNetSynchronizationContext.cs
- BindingRestrictions.cs
- ResourceExpressionBuilder.cs
- ParentQuery.cs