Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DoubleAnimationUsingPath.cs
- ActivityPropertyReference.cs
- HtmlHistory.cs
- FormatterConverter.cs
- DBDataPermissionAttribute.cs
- CopyOfAction.cs
- XPathSelectionIterator.cs
- TransformGroup.cs
- SafeFileMapViewHandle.cs
- SHA1CryptoServiceProvider.cs
- Win32KeyboardDevice.cs
- LineServices.cs
- DataControlFieldsEditor.cs
- DetailsView.cs
- CmsUtils.cs
- LambdaCompiler.ControlFlow.cs
- RunInstallerAttribute.cs
- SHA1.cs
- StaticTextPointer.cs
- FormatException.cs
- Utils.cs
- WebPartConnectionsEventArgs.cs
- DbConnectionClosed.cs
- ComponentManagerBroker.cs
- TailCallAnalyzer.cs
- ReadOnlyCollectionBase.cs
- DbXmlEnabledProviderManifest.cs
- DefinitionUpdate.cs
- DependentList.cs
- Pens.cs
- ResourceProviderFactory.cs
- ResourcePermissionBase.cs
- DataPagerFieldItem.cs
- SortQuery.cs
- SecurityUtils.cs
- PrintingPermissionAttribute.cs
- SettingsSection.cs
- GetFileNameResult.cs
- DesignerLoader.cs
- UserNameSecurityTokenProvider.cs
- FileCodeGroup.cs
- HandlerBase.cs
- WindowsTitleBar.cs
- DoubleAnimation.cs
- PropertyEntry.cs
- TypeExtension.cs
- SQLByte.cs
- _ScatterGatherBuffers.cs
- SessionPageStatePersister.cs
- GeometryHitTestParameters.cs
- FlowDocument.cs
- SectionInput.cs
- DataBoundControlDesigner.cs
- ThreadAbortException.cs
- BufferedStream.cs
- HostProtectionException.cs
- ConfigurationException.cs
- TickBar.cs
- AddIn.cs
- TextRangeEdit.cs
- NodeFunctions.cs
- TransformValueSerializer.cs
- BufferedWebEventProvider.cs
- ProfileBuildProvider.cs
- HtmlInputReset.cs
- EastAsianLunisolarCalendar.cs
- SpanIndex.cs
- XmlRootAttribute.cs
- TypedCompletedAsyncResult.cs
- XPathAncestorIterator.cs
- ProtocolImporter.cs
- InstalledFontCollection.cs
- SerialPort.cs
- AdRotator.cs
- DbConnectionPoolCounters.cs
- DynamicQueryableWrapper.cs
- HyperLinkField.cs
- ResourceIDHelper.cs
- COM2FontConverter.cs
- VerticalAlignConverter.cs
- ListBase.cs
- Model3D.cs
- ErrorsHelper.cs
- ChtmlTextBoxAdapter.cs
- ToggleProviderWrapper.cs
- DiscreteKeyFrames.cs
- HitTestResult.cs
- AmbientValueAttribute.cs
- ColorConvertedBitmapExtension.cs
- CharacterBufferReference.cs
- ProfileBuildProvider.cs
- _NegoStream.cs
- ChineseLunisolarCalendar.cs
- LookupBindingPropertiesAttribute.cs
- COMException.cs
- NativeMethods.cs
- ControlHelper.cs
- Function.cs
- StartUpEventArgs.cs
- CallInfo.cs