Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheAxisQuery.cs / 1305376 / 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
- XPathNodeIterator.cs
- OleDbDataAdapter.cs
- DriveNotFoundException.cs
- XmlElement.cs
- DocumentViewerConstants.cs
- XmlQualifiedNameTest.cs
- StrongNameKeyPair.cs
- Converter.cs
- PingOptions.cs
- SubtreeProcessor.cs
- DeobfuscatingStream.cs
- BCLDebug.cs
- RangeValidator.cs
- StyleCollection.cs
- TraceHandler.cs
- ISAPIApplicationHost.cs
- HandlerMappingMemo.cs
- ClientType.cs
- DoubleLink.cs
- CLSCompliantAttribute.cs
- SimpleBitVector32.cs
- TextProviderWrapper.cs
- SQLResource.cs
- RandomNumberGenerator.cs
- ComponentDispatcherThread.cs
- PerformanceCounters.cs
- XpsThumbnail.cs
- ServiceThrottlingBehavior.cs
- CommonObjectSecurity.cs
- ExtensionSimplifierMarkupObject.cs
- HierarchicalDataBoundControl.cs
- SiteMapNode.cs
- SafeHandle.cs
- FlowDocumentScrollViewer.cs
- FileIOPermission.cs
- Container.cs
- SafeWaitHandle.cs
- EventInfo.cs
- DataGridViewControlCollection.cs
- ValidationResult.cs
- BitmapEffectDrawingContextState.cs
- SqlDataSourceCache.cs
- DataSourceSelectArguments.cs
- FixedDocument.cs
- ReliableChannelBinder.cs
- Decoder.cs
- ToolStripStatusLabel.cs
- MenuItemBinding.cs
- UnsignedPublishLicense.cs
- Socket.cs
- FieldToken.cs
- WhitespaceSignificantCollectionAttribute.cs
- WebBrowser.cs
- TextElementEditingBehaviorAttribute.cs
- SynchronizedDispatch.cs
- SqlNotificationRequest.cs
- CssStyleCollection.cs
- ObjectDataSourceFilteringEventArgs.cs
- StringStorage.cs
- PagePropertiesChangingEventArgs.cs
- LabelAutomationPeer.cs
- ExpressionTextBox.xaml.cs
- ComplexType.cs
- QuaternionConverter.cs
- DefaultValidator.cs
- TransactionChannelFaultConverter.cs
- GeneralTransform.cs
- clipboard.cs
- HttpListenerRequest.cs
- ActivityTypeDesigner.xaml.cs
- XmlSchemaIdentityConstraint.cs
- UnsafeNativeMethods.cs
- IdnMapping.cs
- GridViewCommandEventArgs.cs
- IIS7WorkerRequest.cs
- CultureData.cs
- XmlSchemaComplexContentExtension.cs
- SQLInt32.cs
- RoutedEventValueSerializer.cs
- RectangleConverter.cs
- XDRSchema.cs
- OuterGlowBitmapEffect.cs
- Hyperlink.cs
- HtmlInputReset.cs
- OleServicesContext.cs
- URLIdentityPermission.cs
- PasswordDeriveBytes.cs
- DBDataPermission.cs
- ToolStripContentPanel.cs
- ServerType.cs
- MetadataSource.cs
- WindowsServiceElement.cs
- _NegotiateClient.cs
- XmlSchemaCompilationSettings.cs
- SecurityTokenResolver.cs
- FormParameter.cs
- TableParagraph.cs
- EditingCoordinator.cs
- CounterSample.cs
- WebPartMenu.cs