Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheAxisQuery.cs / 1 / CacheAxisQuery.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.Collections.Generic; internal abstract class CacheAxisQuery : BaseAxisQuery { // int count; -- we reusing it here protected ListoutputBuffer; public CacheAxisQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) { this.outputBuffer = new List (); this.count = 0; } protected CacheAxisQuery(CacheAxisQuery other) : base(other) { this.outputBuffer = new List (other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override object Evaluate(XPathNodeIterator context) { base.Evaluate(context); outputBuffer.Clear(); 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 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; } } } } // 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.Collections.Generic; internal abstract class CacheAxisQuery : BaseAxisQuery { // int count; -- we reusing it here protected ListoutputBuffer; public CacheAxisQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) { this.outputBuffer = new List (); this.count = 0; } protected CacheAxisQuery(CacheAxisQuery other) : base(other) { this.outputBuffer = new List (other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override object Evaluate(XPathNodeIterator context) { base.Evaluate(context); outputBuffer.Clear(); 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 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; } } } } // 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
- RequestStatusBarUpdateEventArgs.cs
- ProcessModuleCollection.cs
- ConversionContext.cs
- DocumentReferenceCollection.cs
- WindowsRegion.cs
- PositiveTimeSpanValidator.cs
- Translator.cs
- AnimationClock.cs
- DataServiceProviderMethods.cs
- AttributeEmitter.cs
- ExpressionList.cs
- WebCategoryAttribute.cs
- CodeConstructor.cs
- CodeCompileUnit.cs
- ClientBase.cs
- AnimationTimeline.cs
- SafePEFileHandle.cs
- IPGlobalProperties.cs
- SchemaManager.cs
- XmlParserContext.cs
- DoubleUtil.cs
- CompilerErrorCollection.cs
- IndicFontClient.cs
- SystemIPInterfaceStatistics.cs
- PictureBox.cs
- MimeMapping.cs
- SafeNativeMethods.cs
- ContextMenuAutomationPeer.cs
- CreateSequenceResponse.cs
- Statements.cs
- DesignerTransactionCloseEvent.cs
- MDIClient.cs
- ConstrainedDataObject.cs
- PrefixQName.cs
- MultipleViewProviderWrapper.cs
- MultipleViewPattern.cs
- TableLayoutSettingsTypeConverter.cs
- WaitHandle.cs
- EnumerableRowCollection.cs
- System.Data_BID.cs
- UTF8Encoding.cs
- DetailsViewDeletedEventArgs.cs
- SourceItem.cs
- WebHttpDispatchOperationSelector.cs
- PlatformNotSupportedException.cs
- DataGridViewAutoSizeModeEventArgs.cs
- VectorConverter.cs
- RotateTransform3D.cs
- NameNode.cs
- LinkUtilities.cs
- BaseServiceProvider.cs
- ThreadPool.cs
- OleDbException.cs
- FormatConvertedBitmap.cs
- CacheSection.cs
- SettingsSection.cs
- X509UI.cs
- FileUtil.cs
- VirtualizingPanel.cs
- RefreshEventArgs.cs
- mactripleDES.cs
- AxisAngleRotation3D.cs
- WebPartChrome.cs
- WebPartDisplayModeCancelEventArgs.cs
- xdrvalidator.cs
- IPGlobalProperties.cs
- IPEndPointCollection.cs
- DecimalMinMaxAggregationOperator.cs
- Literal.cs
- AutomationIdentifier.cs
- ScrollChrome.cs
- StylusTip.cs
- HttpsChannelFactory.cs
- InertiaExpansionBehavior.cs
- IpcClientChannel.cs
- DisableDpiAwarenessAttribute.cs
- OraclePermissionAttribute.cs
- Span.cs
- RepeaterItem.cs
- SamlEvidence.cs
- TextServicesContext.cs
- InputReport.cs
- HotSpotCollectionEditor.cs
- BufferedReceiveManager.cs
- Utilities.cs
- AspNetSynchronizationContext.cs
- FormClosedEvent.cs
- Context.cs
- BrowserCapabilitiesFactoryBase.cs
- AxParameterData.cs
- SpecialNameAttribute.cs
- SecurityDescriptor.cs
- ToolboxCategoryItems.cs
- FormsAuthenticationCredentials.cs
- ScrollProviderWrapper.cs
- DataGridItem.cs
- PanelStyle.cs
- SslStream.cs
- IsolatedStorageFile.cs
- JoinElimination.cs