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
- GeometryModel3D.cs
- TdsEnums.cs
- DataColumnMapping.cs
- ExpressionNormalizer.cs
- OutputCacheProfileCollection.cs
- FixedSOMTableRow.cs
- RemoveStoryboard.cs
- ReadOnlyHierarchicalDataSource.cs
- BuildDependencySet.cs
- XmlIlVisitor.cs
- DataGridViewAutoSizeModeEventArgs.cs
- FixedSOMPageConstructor.cs
- SafeArrayTypeMismatchException.cs
- TypeSource.cs
- CommandPlan.cs
- ReadContentAsBinaryHelper.cs
- SafeProcessHandle.cs
- StorageModelBuildProvider.cs
- ToolStripOverflowButton.cs
- DocumentSchemaValidator.cs
- DiscoveryProxy.cs
- SQLDateTimeStorage.cs
- OperandQuery.cs
- LineServicesCallbacks.cs
- ZoomPercentageConverter.cs
- ChannelPool.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- CodeDomDesignerLoader.cs
- UnsafeNativeMethodsPenimc.cs
- CssTextWriter.cs
- EncoderBestFitFallback.cs
- ToolBarPanel.cs
- DataPagerField.cs
- ThrowHelper.cs
- TextView.cs
- MissingManifestResourceException.cs
- NativeMethods.cs
- RectValueSerializer.cs
- RegistrationServices.cs
- Win32.cs
- Cursor.cs
- Pts.cs
- sqlnorm.cs
- CanonicalXml.cs
- DurableRuntimeValidator.cs
- TargetControlTypeAttribute.cs
- InvalidComObjectException.cs
- DispatcherProcessingDisabled.cs
- DataKey.cs
- ResourceKey.cs
- StorageEntityTypeMapping.cs
- KeyValueConfigurationElement.cs
- FileRecordSequenceCompletedAsyncResult.cs
- CustomPopupPlacement.cs
- XPathAxisIterator.cs
- AuthorizationSection.cs
- StylusPoint.cs
- ContextMarshalException.cs
- DrawingGroup.cs
- LinkConverter.cs
- ClientSession.cs
- FtpCachePolicyElement.cs
- ProcessModelSection.cs
- DataBoundControl.cs
- TableColumnCollection.cs
- MouseEvent.cs
- DifferencingCollection.cs
- ControlIdConverter.cs
- Base64Encoding.cs
- TrayIconDesigner.cs
- KeyInterop.cs
- AccessedThroughPropertyAttribute.cs
- HttpWebRequest.cs
- ProfessionalColors.cs
- ServiceOperation.cs
- PageVisual.cs
- ADMembershipProvider.cs
- AQNBuilder.cs
- ControlUtil.cs
- DesignerObject.cs
- IdleTimeoutMonitor.cs
- TargetException.cs
- WebPartEditorApplyVerb.cs
- RuntimeCompatibilityAttribute.cs
- ObjectListCommandCollection.cs
- JapaneseCalendar.cs
- Signature.cs
- ContainerFilterService.cs
- Compiler.cs
- KeyConverter.cs
- CustomLineCap.cs
- Int32Storage.cs
- StrokeDescriptor.cs
- ProviderBase.cs
- TypeSystemHelpers.cs
- FieldNameLookup.cs
- WebPartMenuStyle.cs
- ScalarRestriction.cs
- XamlVector3DCollectionSerializer.cs
- Container.cs