Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- xmlsaver.cs
- ClientEventManager.cs
- Material.cs
- DataBoundControlHelper.cs
- StateDesigner.Layouts.cs
- EventMappingSettings.cs
- DBPropSet.cs
- PenContext.cs
- SchemaReference.cs
- CharStorage.cs
- DependencySource.cs
- QuotedStringWriteStateInfo.cs
- RichTextBox.cs
- RadioButtonAutomationPeer.cs
- ToolStripComboBox.cs
- querybuilder.cs
- FocusChangedEventArgs.cs
- EntityKey.cs
- PersonalizationState.cs
- __ConsoleStream.cs
- Graph.cs
- ContextMenuStripActionList.cs
- XPathNavigatorKeyComparer.cs
- Vertex.cs
- UIServiceHelper.cs
- BrushMappingModeValidation.cs
- InstallerTypeAttribute.cs
- SeekStoryboard.cs
- ClientScriptManagerWrapper.cs
- AppDomainProtocolHandler.cs
- PeerNeighborManager.cs
- DataGridBoolColumn.cs
- ListViewDesigner.cs
- HybridObjectCache.cs
- ObjectKeyFrameCollection.cs
- Zone.cs
- XmlSerializerFactory.cs
- ICspAsymmetricAlgorithm.cs
- RuleInfoComparer.cs
- ListViewHitTestInfo.cs
- OleDbMetaDataFactory.cs
- BulletedListEventArgs.cs
- ExpressionBuilder.cs
- messageonlyhwndwrapper.cs
- WebPartManagerInternals.cs
- ReflectionPermission.cs
- SharedStatics.cs
- SqlClientWrapperSmiStreamChars.cs
- DataGridViewImageCell.cs
- BasicExpandProvider.cs
- TabControl.cs
- GenericTypeParameterConverter.cs
- Point4DValueSerializer.cs
- BindingEntityInfo.cs
- XmlCharCheckingReader.cs
- DataFormat.cs
- Page.cs
- newitemfactory.cs
- PersistenceTask.cs
- LifetimeServices.cs
- ModelUIElement3D.cs
- DataServiceEntityAttribute.cs
- XmlDataImplementation.cs
- TemplateKeyConverter.cs
- TargetInvocationException.cs
- querybuilder.cs
- ScriptResourceDefinition.cs
- UrlMappingsSection.cs
- BitConverter.cs
- UserMapPath.cs
- ListItemConverter.cs
- ControlPager.cs
- NativeCompoundFileAPIs.cs
- GroupQuery.cs
- TextCompositionEventArgs.cs
- EmptyEnumerator.cs
- GroupQuery.cs
- AssemblyNameProxy.cs
- GeneralTransform3DTo2D.cs
- AppDomainAttributes.cs
- XmlExpressionDumper.cs
- Point3D.cs
- DataGridDetailsPresenter.cs
- MetadataCacheItem.cs
- CodeDelegateCreateExpression.cs
- ConfigurationStrings.cs
- XamlClipboardData.cs
- CellRelation.cs
- RayMeshGeometry3DHitTestResult.cs
- WebBrowserEvent.cs
- PeerNameRecordCollection.cs
- PathBox.cs
- GenericIdentity.cs
- FileDialog_Vista_Interop.cs
- SelectingProviderEventArgs.cs
- TransactionScope.cs
- TranslateTransform.cs
- TableLayoutStyleCollection.cs
- XmlArrayAttribute.cs
- ImageAnimator.cs