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
- XhtmlConformanceSection.cs
- XmlUtf8RawTextWriter.cs
- HttpConfigurationContext.cs
- Soap12ProtocolReflector.cs
- PauseStoryboard.cs
- MultipleViewProviderWrapper.cs
- NumberFormatInfo.cs
- Padding.cs
- IdentifierService.cs
- GroupLabel.cs
- MaskInputRejectedEventArgs.cs
- FormsAuthenticationUser.cs
- StringHandle.cs
- ToolStripStatusLabel.cs
- QuaternionAnimation.cs
- TextServicesContext.cs
- ToolStripStatusLabel.cs
- CAGDesigner.cs
- XPathParser.cs
- EdmTypeAttribute.cs
- securitycriticaldataClass.cs
- TokenBasedSet.cs
- _AutoWebProxyScriptEngine.cs
- OutputCacheSection.cs
- DataColumn.cs
- FrameworkTemplate.cs
- BmpBitmapDecoder.cs
- OleDbSchemaGuid.cs
- SystemException.cs
- Font.cs
- XPathSingletonIterator.cs
- QuotedPairReader.cs
- WebPermission.cs
- FormsAuthenticationConfiguration.cs
- PartialTrustHelpers.cs
- SqlNodeAnnotations.cs
- DataGrid.cs
- XmlSiteMapProvider.cs
- MemberDescriptor.cs
- DbTransaction.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- QuaternionKeyFrameCollection.cs
- SoapAttributes.cs
- ToolStripItemCollection.cs
- SequentialOutput.cs
- SeverityFilter.cs
- PrivilegeNotHeldException.cs
- RoleManagerSection.cs
- XPathNodePointer.cs
- IteratorDescriptor.cs
- ClientSideQueueItem.cs
- basenumberconverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- HuffmanTree.cs
- ObjectContext.cs
- ActivityWithResult.cs
- ScriptingWebServicesSectionGroup.cs
- RuleEngine.cs
- DispatcherProcessingDisabled.cs
- XmlAttributeOverrides.cs
- InProcStateClientManager.cs
- CorrelationTokenInvalidatedHandler.cs
- Int16Animation.cs
- EventDescriptorCollection.cs
- DataControlFieldHeaderCell.cs
- ThicknessAnimationBase.cs
- Section.cs
- DesignConnection.cs
- OrderByBuilder.cs
- Timeline.cs
- CollectionContainer.cs
- ChtmlTextBoxAdapter.cs
- KeyBinding.cs
- SettingsPropertyIsReadOnlyException.cs
- ProcessThreadDesigner.cs
- ProfilePropertySettings.cs
- CredentialManagerDialog.cs
- IdnMapping.cs
- RegexWorker.cs
- CodeLinePragma.cs
- ConfigXmlSignificantWhitespace.cs
- StateDesigner.Layouts.cs
- CommonGetThemePartSize.cs
- CompiledIdentityConstraint.cs
- Rules.cs
- Byte.cs
- HtmlEncodedRawTextWriter.cs
- RadioButton.cs
- JpegBitmapEncoder.cs
- DataGridCommandEventArgs.cs
- ReadWriteSpinLock.cs
- ProviderConnectionPoint.cs
- XmlAggregates.cs
- ParseNumbers.cs
- ModelFunctionTypeElement.cs
- Pen.cs
- EncryptedReference.cs
- TableParaClient.cs
- PrinterUnitConvert.cs
- DataGridViewButtonColumn.cs