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
- UIElement3D.cs
- GotoExpression.cs
- ViewGenerator.cs
- PackageRelationshipSelector.cs
- RegistryDataKey.cs
- PropertyItemInternal.cs
- RadioButtonStandardAdapter.cs
- PersonalizationEntry.cs
- ConnectionsZone.cs
- SrgsToken.cs
- BreadCrumbTextConverter.cs
- SettingsPropertyIsReadOnlyException.cs
- SuppressMergeCheckAttribute.cs
- DirectoryObjectSecurity.cs
- Zone.cs
- DragEvent.cs
- Exceptions.cs
- DelimitedListTraceListener.cs
- EntityDataSourceQueryBuilder.cs
- SqlDataSourceView.cs
- controlskin.cs
- DesignerOptionService.cs
- RuntimeEnvironment.cs
- UdpRetransmissionSettings.cs
- ContextStack.cs
- BuildProvider.cs
- ExceptionValidationRule.cs
- Scripts.cs
- XmlSchemaObjectTable.cs
- TrackBarDesigner.cs
- SafeThemeHandle.cs
- ProjectionPruner.cs
- SynchronizingStream.cs
- XamlPathDataSerializer.cs
- MenuItem.cs
- AttachedPropertiesService.cs
- SecurityTokenProvider.cs
- HttpCapabilitiesSectionHandler.cs
- OutputCacheSettingsSection.cs
- OracleString.cs
- DataConnectionHelper.cs
- RelativeSource.cs
- NavigatorOutput.cs
- SpecularMaterial.cs
- TemplatingOptionsDialog.cs
- DataControlFieldCollection.cs
- AppDomainAttributes.cs
- TableRow.cs
- DocumentApplication.cs
- Floater.cs
- SmiEventSink_DeferedProcessing.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- WsdlBuildProvider.cs
- ACE.cs
- CornerRadius.cs
- CodeAttributeArgumentCollection.cs
- BitConverter.cs
- FileIOPermission.cs
- SubstitutionList.cs
- TextBoxBase.cs
- IssuedTokenServiceCredential.cs
- EntitySet.cs
- InvalidAsynchronousStateException.cs
- WindowsToolbar.cs
- SpellCheck.cs
- CallContext.cs
- SHA1CryptoServiceProvider.cs
- InvokeFunc.cs
- ElementInit.cs
- ProfileProvider.cs
- BindingContext.cs
- ReaderWriterLockSlim.cs
- XmlValueConverter.cs
- WorkflowEventArgs.cs
- DataGridViewUtilities.cs
- OrderByExpression.cs
- ServicePointManager.cs
- InternalSendMessage.cs
- Attributes.cs
- EnumValAlphaComparer.cs
- IndentedWriter.cs
- FileDialog_Vista_Interop.cs
- DbParameterHelper.cs
- PartDesigner.cs
- TemplatedWizardStep.cs
- Subtract.cs
- InvalidAsynchronousStateException.cs
- NavigationCommands.cs
- ObjectComplexPropertyMapping.cs
- TabItemAutomationPeer.cs
- KeyValueSerializer.cs
- RandomNumberGenerator.cs
- HttpConfigurationContext.cs
- InitializationEventAttribute.cs
- KeyValuePairs.cs
- PageCatalogPart.cs
- BooleanAnimationBase.cs
- OdbcInfoMessageEvent.cs
- ListGeneralPage.cs
- StylusButton.cs