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
- FormViewModeEventArgs.cs
- WindowsStartMenu.cs
- XamlVector3DCollectionSerializer.cs
- SqlProviderServices.cs
- hebrewshape.cs
- BrowserInteropHelper.cs
- HttpContextWrapper.cs
- MethodBody.cs
- Animatable.cs
- EnterpriseServicesHelper.cs
- GlyphRunDrawing.cs
- KeyGestureValueSerializer.cs
- PageRequestManager.cs
- ControlPaint.cs
- XhtmlMobileTextWriter.cs
- PreProcessor.cs
- WrappingXamlSchemaContext.cs
- LocatorGroup.cs
- DictionaryMarkupSerializer.cs
- Set.cs
- AuthenticateEventArgs.cs
- RealizationDrawingContextWalker.cs
- ZipQueryOperator.cs
- ToggleProviderWrapper.cs
- DataGridViewCellEventArgs.cs
- Triangle.cs
- AutomationPatternInfo.cs
- PingOptions.cs
- SerializableReadOnlyDictionary.cs
- FilterElement.cs
- ToolStripItem.cs
- DateTimeFormat.cs
- ApplicationProxyInternal.cs
- StylusButtonEventArgs.cs
- CodeArgumentReferenceExpression.cs
- SplineKeyFrames.cs
- ExtensionMethods.cs
- SecureStringHasher.cs
- IDictionary.cs
- TextBoxView.cs
- DataServiceProviderWrapper.cs
- _TLSstream.cs
- EntityWrapper.cs
- _OverlappedAsyncResult.cs
- TextCompositionManager.cs
- TextRunCache.cs
- XamlClipboardData.cs
- Math.cs
- NodeLabelEditEvent.cs
- AsyncResult.cs
- SendMailErrorEventArgs.cs
- GridView.cs
- InputBindingCollection.cs
- DispatcherTimer.cs
- QuotedPrintableStream.cs
- Polyline.cs
- AccessibleObject.cs
- SqlConnectionHelper.cs
- SelectedDatesCollection.cs
- StaticTextPointer.cs
- WebAdminConfigurationHelper.cs
- EventLogEntry.cs
- ButtonBaseAutomationPeer.cs
- BamlResourceContent.cs
- Nullable.cs
- MiniLockedBorderGlyph.cs
- TransformerInfoCollection.cs
- StateMachineSubscriptionManager.cs
- MessageDroppedTraceRecord.cs
- Converter.cs
- SqlProvider.cs
- indexingfiltermarshaler.cs
- SessionStateUtil.cs
- EventInfo.cs
- EventLogPermission.cs
- SafeSecurityHelper.cs
- HttpCapabilitiesSectionHandler.cs
- DynamicValueConverter.cs
- CancellationState.cs
- DetailsViewDeletedEventArgs.cs
- TextElementCollectionHelper.cs
- DataGridCommandEventArgs.cs
- PathFigure.cs
- GradientBrush.cs
- DataSetUtil.cs
- MDIWindowDialog.cs
- IriParsingElement.cs
- TransactionProxy.cs
- StorageFunctionMapping.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- ResourceExpressionEditorSheet.cs
- RelationshipType.cs
- SupportedAddressingMode.cs
- TextWriter.cs
- AnchoredBlock.cs
- ExtensibleClassFactory.cs
- PropertyDescriptorGridEntry.cs
- AssemblyFilter.cs
- CircleHotSpot.cs
- ManagedIStream.cs