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
- DataGridViewToolTip.cs
- WorkflowMessageEventArgs.cs
- DataBindingCollection.cs
- HelpEvent.cs
- ClientRoleProvider.cs
- EnumBuilder.cs
- DependencyObjectPropertyDescriptor.cs
- BorderGapMaskConverter.cs
- CapacityStreamGeometryContext.cs
- GridViewSortEventArgs.cs
- Facet.cs
- CodeAttachEventStatement.cs
- UshortList2.cs
- ObfuscationAttribute.cs
- ObjectDataSourceSelectingEventArgs.cs
- PerformanceCounterPermissionEntry.cs
- Row.cs
- EventMappingSettingsCollection.cs
- Base64Decoder.cs
- IISUnsafeMethods.cs
- MessageHeaders.cs
- DateTimeFormatInfoScanner.cs
- DesignerEditorPartChrome.cs
- TableChangeProcessor.cs
- PrintPageEvent.cs
- DataViewManager.cs
- RightsManagementErrorHandler.cs
- ConnectionStringsSection.cs
- DockPanel.cs
- XmlNullResolver.cs
- UpdatableWrapper.cs
- UnwrappedTypesXmlSerializerManager.cs
- EncodingInfo.cs
- Converter.cs
- TypeDescriptor.cs
- ClockGroup.cs
- SqlClientFactory.cs
- BitmapEffectInputData.cs
- TextDecorationCollectionConverter.cs
- ButtonBaseAutomationPeer.cs
- DataKey.cs
- DrawingGroup.cs
- SqlConnectionPoolGroupProviderInfo.cs
- TextCharacters.cs
- QueryCacheKey.cs
- MouseOverProperty.cs
- FixedPageProcessor.cs
- NavigationWindowAutomationPeer.cs
- EventSourceCreationData.cs
- AddInEnvironment.cs
- CompressEmulationStream.cs
- RankException.cs
- EngineSite.cs
- AppLevelCompilationSectionCache.cs
- FrameworkContextData.cs
- __ConsoleStream.cs
- BuildProviderAppliesToAttribute.cs
- externdll.cs
- PointCollection.cs
- PackageFilter.cs
- QueryContinueDragEvent.cs
- MetadataPropertyCollection.cs
- __Filters.cs
- ColumnResizeUndoUnit.cs
- InteropTrackingRecord.cs
- TextRange.cs
- WebPartConnectionsConnectVerb.cs
- AssertSection.cs
- DotExpr.cs
- SimpleTypeResolver.cs
- AdapterSwitches.cs
- CapabilitiesState.cs
- RevocationPoint.cs
- LabelEditEvent.cs
- SimpleTextLine.cs
- CapacityStreamGeometryContext.cs
- BevelBitmapEffect.cs
- CdpEqualityComparer.cs
- PageWrapper.cs
- ContentPresenter.cs
- IndividualDeviceConfig.cs
- SqlServices.cs
- Substitution.cs
- Compilation.cs
- DataShape.cs
- DrawingState.cs
- DateTimeConverter.cs
- BinHexDecoder.cs
- WindowsSlider.cs
- CommonBehaviorsSection.cs
- TextEmbeddedObject.cs
- HtmlTableRow.cs
- ExceptionUtil.cs
- HttpProfileGroupBase.cs
- FactoryGenerator.cs
- FileSystemInfo.cs
- DrawingGroupDrawingContext.cs
- DataSourceComponent.cs
- Axis.cs
- IntegerValidatorAttribute.cs