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
- XmlSchemaChoice.cs
- NamespaceCollection.cs
- MergeEnumerator.cs
- RealProxy.cs
- ApplicationDirectoryMembershipCondition.cs
- WebConfigurationHost.cs
- FactoryMaker.cs
- EditorAttribute.cs
- TabPanel.cs
- DataGridHeaderBorder.cs
- ReliableReplySessionChannel.cs
- NullableLongSumAggregationOperator.cs
- BitmapSource.cs
- DataGridViewCellCancelEventArgs.cs
- RootBrowserWindowAutomationPeer.cs
- BufferedWebEventProvider.cs
- OdbcStatementHandle.cs
- RadioButton.cs
- OleDbDataReader.cs
- FileAuthorizationModule.cs
- Border.cs
- ObjectHelper.cs
- PrinterUnitConvert.cs
- FontStyleConverter.cs
- XmlNodeChangedEventArgs.cs
- unsafeIndexingFilterStream.cs
- GradientStop.cs
- Package.cs
- ItemType.cs
- NonParentingControl.cs
- ToolStripDropDownButton.cs
- SystemFonts.cs
- CdpEqualityComparer.cs
- Error.cs
- Transaction.cs
- ToolboxItemFilterAttribute.cs
- EntityDesignerUtils.cs
- MultiTrigger.cs
- ToolStripCustomTypeDescriptor.cs
- XmlQueryCardinality.cs
- XmlReturnWriter.cs
- ViewSimplifier.cs
- FontFamily.cs
- XmlHierarchyData.cs
- ModelVisual3D.cs
- FloatUtil.cs
- WpfKnownMember.cs
- XamlSerializerUtil.cs
- PathBox.cs
- HtmlFormWrapper.cs
- MailDefinitionBodyFileNameEditor.cs
- TextElement.cs
- VisualBasicReference.cs
- NativeMethods.cs
- wmiutil.cs
- XamlVector3DCollectionSerializer.cs
- AutomationElementCollection.cs
- EventLog.cs
- MatrixUtil.cs
- HitTestParameters3D.cs
- NullableLongSumAggregationOperator.cs
- Focus.cs
- CatalogPartCollection.cs
- dsa.cs
- ProcessModuleDesigner.cs
- IteratorFilter.cs
- TypeConstant.cs
- METAHEADER.cs
- FormViewPageEventArgs.cs
- UnsafeNetInfoNativeMethods.cs
- ScaleTransform.cs
- TimeSpanHelper.cs
- PropertyCondition.cs
- EdmToObjectNamespaceMap.cs
- ConnectionPoint.cs
- XmlBinaryReader.cs
- ManifestResourceInfo.cs
- XamlTypeMapperSchemaContext.cs
- MailWebEventProvider.cs
- ContextStack.cs
- MaterialGroup.cs
- DataComponentGenerator.cs
- EventSinkHelperWriter.cs
- ProcessProtocolHandler.cs
- WindowsClaimSet.cs
- FileDialog.cs
- ItemAutomationPeer.cs
- DocumentationServerProtocol.cs
- SystemInformation.cs
- Wizard.cs
- ACE.cs
- SqlXmlStorage.cs
- WebPartTransformerAttribute.cs
- UIPermission.cs
- Int64.cs
- IteratorDescriptor.cs
- GroupBox.cs
- RemotingConfiguration.cs
- DataGridCell.cs
- StylusPointPropertyUnit.cs