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
- HyperLinkStyle.cs
- UnmanagedMemoryStream.cs
- ControlBuilder.cs
- ColorDialog.cs
- WebPartCatalogAddVerb.cs
- CalculatedColumn.cs
- BufferModesCollection.cs
- WebSysDisplayNameAttribute.cs
- BinarySerializer.cs
- RefreshEventArgs.cs
- BookmarkScope.cs
- ComponentSerializationService.cs
- DropSourceBehavior.cs
- TextParaLineResult.cs
- ColumnMapProcessor.cs
- EntityDataSourceChangingEventArgs.cs
- OdbcDataAdapter.cs
- ButtonBaseAutomationPeer.cs
- DBDataPermission.cs
- CompositeCollection.cs
- Cell.cs
- XmlCustomFormatter.cs
- ExtensionFile.cs
- SectionUpdates.cs
- CqlQuery.cs
- NaturalLanguageHyphenator.cs
- DataGridViewColumnHeaderCell.cs
- PublisherMembershipCondition.cs
- Closure.cs
- FileCodeGroup.cs
- DataTemplate.cs
- Verify.cs
- Icon.cs
- DataViewManager.cs
- AppSettingsReader.cs
- EntityClassGenerator.cs
- ReferenceSchema.cs
- AxHostDesigner.cs
- PermissionSetTriple.cs
- FileLogRecordStream.cs
- PostBackOptions.cs
- TextDataBindingHandler.cs
- WebPartCatalogAddVerb.cs
- FileChangesMonitor.cs
- PluralizationService.cs
- DataSourceHelper.cs
- XmlCountingReader.cs
- CryptoConfig.cs
- ViewBase.cs
- InfoCardSymmetricCrypto.cs
- ChildTable.cs
- RoleServiceManager.cs
- EventListener.cs
- PKCS1MaskGenerationMethod.cs
- NamespaceEmitter.cs
- SimpleTypeResolver.cs
- RuntimeEnvironment.cs
- MenuStrip.cs
- ClientSettingsSection.cs
- CaseStatementProjectedSlot.cs
- Vector3DCollectionConverter.cs
- WorkflowClientDeliverMessageWrapper.cs
- SQLConvert.cs
- ImageDrawing.cs
- PropertyGeneratedEventArgs.cs
- UrlMappingCollection.cs
- StorageTypeMapping.cs
- HttpException.cs
- BuildManagerHost.cs
- CustomDictionarySources.cs
- SingleConverter.cs
- ListControl.cs
- BigInt.cs
- ConfigurationLockCollection.cs
- AnimationTimeline.cs
- ToolStripPanel.cs
- RuleSetDialog.Designer.cs
- ConversionValidationRule.cs
- RegexCaptureCollection.cs
- Oci.cs
- FontCollection.cs
- CustomWebEventKey.cs
- Encoder.cs
- PropertyDescriptorCollection.cs
- TypeSchema.cs
- MessageDecoder.cs
- HostVisual.cs
- versioninfo.cs
- MasterPageCodeDomTreeGenerator.cs
- CommandPlan.cs
- CollectionTypeElement.cs
- Simplifier.cs
- CryptoApi.cs
- DataGridViewComboBoxColumn.cs
- FormsAuthenticationConfiguration.cs
- ThreadLocal.cs
- TogglePattern.cs
- ModelProperty.cs
- WebServiceFaultDesigner.cs
- XslUrlEditor.cs