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 / 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
- CatalogZone.cs
- EventListener.cs
- SqlServer2KCompatibilityCheck.cs
- EDesignUtil.cs
- WebBrowserProgressChangedEventHandler.cs
- CodeGroup.cs
- ExpressionList.cs
- ServerIdentity.cs
- TransformGroup.cs
- CurrentChangedEventManager.cs
- PolicyUtility.cs
- FlowDocumentReader.cs
- PassportAuthenticationModule.cs
- Process.cs
- IdentitySection.cs
- Int32KeyFrameCollection.cs
- HMACSHA256.cs
- RequestQueue.cs
- WebServiceHostFactory.cs
- Int32Collection.cs
- HttpDebugHandler.cs
- MembershipPasswordException.cs
- CurrentChangingEventArgs.cs
- BoolExpressionVisitors.cs
- CompressEmulationStream.cs
- AnimatedTypeHelpers.cs
- PathSegmentCollection.cs
- SafeArrayTypeMismatchException.cs
- IPAddressCollection.cs
- StringUtil.cs
- PropertyGridView.cs
- WebPartVerbCollection.cs
- CompositeControlDesigner.cs
- ZipIORawDataFileBlock.cs
- SafeHandles.cs
- TextDecorations.cs
- TextParaClient.cs
- storepermissionattribute.cs
- TypeCollectionDesigner.xaml.cs
- XamlBrushSerializer.cs
- ThumbAutomationPeer.cs
- PTManager.cs
- DrawingImage.cs
- SizeAnimationClockResource.cs
- StreamGeometry.cs
- ThemeDictionaryExtension.cs
- SystemWebCachingSectionGroup.cs
- AccessKeyManager.cs
- FileDialog_Vista.cs
- XmlArrayAttribute.cs
- Int32CollectionConverter.cs
- ToolStripItemImageRenderEventArgs.cs
- DesignTimeParseData.cs
- DataBindingHandlerAttribute.cs
- LoginView.cs
- SetUserLanguageRequest.cs
- RC2CryptoServiceProvider.cs
- Hyperlink.cs
- ChildTable.cs
- ListViewEditEventArgs.cs
- EmptyEnumerator.cs
- ServiceSecurityContext.cs
- TabControlEvent.cs
- CodeTypeOfExpression.cs
- WizardStepBase.cs
- SelectionProcessor.cs
- Logging.cs
- StyleTypedPropertyAttribute.cs
- SerializableAttribute.cs
- DataControlHelper.cs
- SkewTransform.cs
- MemberHolder.cs
- PointConverter.cs
- TrackBar.cs
- Dictionary.cs
- PrincipalPermission.cs
- ColorConvertedBitmap.cs
- StringAttributeCollection.cs
- CopyCodeAction.cs
- RouteParameter.cs
- ExtractCollection.cs
- ProcessHost.cs
- SrgsElementFactory.cs
- ApplicationBuildProvider.cs
- XmlSchemaAttributeGroupRef.cs
- DecimalStorage.cs
- formatter.cs
- FullTextBreakpoint.cs
- SoapCodeExporter.cs
- CodeTypeOfExpression.cs
- FieldMetadata.cs
- StylusPlugin.cs
- NumericUpDown.cs
- UnSafeCharBuffer.cs
- versioninfo.cs
- SqlMethods.cs
- GACIdentityPermission.cs
- BinarySerializer.cs
- UnknownWrapper.cs
- TCEAdapterGenerator.cs