Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SimplePropertyEntry.cs
- DataGridViewHeaderCell.cs
- PageCodeDomTreeGenerator.cs
- Misc.cs
- SQLBinary.cs
- PowerModeChangedEventArgs.cs
- SiteMapNode.cs
- IdentityReference.cs
- BooleanAnimationUsingKeyFrames.cs
- OleDbRowUpdatingEvent.cs
- EndpointAddress.cs
- XmlEnumAttribute.cs
- SmtpReplyReaderFactory.cs
- MissingSatelliteAssemblyException.cs
- SchemaMapping.cs
- ApplicationInfo.cs
- BasicKeyConstraint.cs
- Messages.cs
- Serializer.cs
- ClientBuildManager.cs
- CharKeyFrameCollection.cs
- GregorianCalendarHelper.cs
- PagerSettings.cs
- Cursors.cs
- TextContainer.cs
- CriticalHandle.cs
- WebRequest.cs
- LayoutTable.cs
- DetailsViewInsertedEventArgs.cs
- FontUnit.cs
- RegistryPermission.cs
- DynamicRouteExpression.cs
- TimeSpan.cs
- HttpGetProtocolImporter.cs
- Brush.cs
- DataFormats.cs
- HttpWebResponse.cs
- PathTooLongException.cs
- TextTreeInsertElementUndoUnit.cs
- DependencyObject.cs
- SchemaType.cs
- NetworkInterface.cs
- ViewEvent.cs
- XPathMultyIterator.cs
- XmlSchemaSimpleContent.cs
- DocComment.cs
- WbmpConverter.cs
- XmlChildNodes.cs
- DataGridViewCellLinkedList.cs
- ConnectionStringSettingsCollection.cs
- CodeMemberProperty.cs
- UnicodeEncoding.cs
- RegexNode.cs
- TextBlock.cs
- DataColumnCollection.cs
- AmbiguousMatchException.cs
- ScalarRestriction.cs
- ObjectIDGenerator.cs
- UnsupportedPolicyOptionsException.cs
- NumberSubstitution.cs
- WindowsSpinner.cs
- StringStorage.cs
- BidOverLoads.cs
- BulletedListEventArgs.cs
- SafeFileMapViewHandle.cs
- DataServiceException.cs
- DataSet.cs
- HostVisual.cs
- XmlSchemaSimpleTypeList.cs
- UIElement.cs
- Point3DValueSerializer.cs
- LogEntryHeaderSerializer.cs
- CombinedGeometry.cs
- TraceContextEventArgs.cs
- XmlSchemaExporter.cs
- CodeDomDecompiler.cs
- BooleanFacetDescriptionElement.cs
- ProcessModuleCollection.cs
- TextEditorSelection.cs
- MissingManifestResourceException.cs
- ReferenceConverter.cs
- HtmlHistory.cs
- NetMsmqSecurityMode.cs
- AssemblyNameProxy.cs
- ValidatingPropertiesEventArgs.cs
- ExceptionUtil.cs
- CustomPopupPlacement.cs
- ValueTable.cs
- HashMembershipCondition.cs
- ImageBrush.cs
- SimpleColumnProvider.cs
- EasingKeyFrames.cs
- ImageField.cs
- SiteMapProvider.cs
- ScrollProperties.cs
- GroupBox.cs
- FixedSOMImage.cs
- ArrayMergeHelper.cs
- WebPartEditVerb.cs
- PerformanceCounterPermissionEntry.cs