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
- QueryOperationResponseOfT.cs
- AutoGeneratedFieldProperties.cs
- DeclarativeCatalogPart.cs
- Pair.cs
- UrlPath.cs
- OwnerDrawPropertyBag.cs
- CursorInteropHelper.cs
- MaxValueConverter.cs
- PermissionListSet.cs
- ManagementBaseObject.cs
- WebPartManager.cs
- ListView.cs
- FixedSOMGroup.cs
- AspCompat.cs
- HttpResponse.cs
- AnimationClock.cs
- _HeaderInfoTable.cs
- GlyphCache.cs
- PoisonMessageException.cs
- GridViewRowCollection.cs
- SimpleWebHandlerParser.cs
- MiniLockedBorderGlyph.cs
- SBCSCodePageEncoding.cs
- SiteMapPathDesigner.cs
- DataContext.cs
- LayoutDump.cs
- DropTarget.cs
- KnownColorTable.cs
- SystemIPInterfaceStatistics.cs
- XmlAttributes.cs
- CalloutQueueItem.cs
- ChangePassword.cs
- DbExpressionRules.cs
- StrokeRenderer.cs
- SeverityFilter.cs
- TraceListener.cs
- TextBox.cs
- HttpListenerResponse.cs
- AddDataControlFieldDialog.cs
- OrderedDictionary.cs
- MimeBasePart.cs
- DocumentViewerConstants.cs
- RSAPKCS1SignatureFormatter.cs
- DataObjectMethodAttribute.cs
- ComponentEditorForm.cs
- X509Certificate2Collection.cs
- Base64Encoder.cs
- CapacityStreamGeometryContext.cs
- HtmlGenericControl.cs
- CompiledQueryCacheEntry.cs
- AttributeExtensions.cs
- DragEvent.cs
- HostingPreferredMapPath.cs
- XPathBinder.cs
- PageHandlerFactory.cs
- PropertyRef.cs
- EmptyEnumerator.cs
- DataRowView.cs
- FunctionQuery.cs
- ZipIOCentralDirectoryFileHeader.cs
- BamlVersionHeader.cs
- DurableServiceAttribute.cs
- HttpListenerRequest.cs
- HttpWebRequest.cs
- PrivilegedConfigurationManager.cs
- TextBoxDesigner.cs
- Int32Animation.cs
- IOException.cs
- DBParameter.cs
- HierarchicalDataBoundControl.cs
- Aes.cs
- ClientEventManager.cs
- TextTreeUndo.cs
- SqlRecordBuffer.cs
- X509CertificateInitiatorServiceCredential.cs
- AssertSection.cs
- PropertyToken.cs
- RoleManagerModule.cs
- IPAddress.cs
- Label.cs
- QueryOptionExpression.cs
- Int32Rect.cs
- BreakRecordTable.cs
- ZipIOExtraFieldPaddingElement.cs
- RegexTree.cs
- XmlCollation.cs
- VectorValueSerializer.cs
- HttpVersion.cs
- DelegateBodyWriter.cs
- Point4D.cs
- ConfigurationSettings.cs
- ExpandableObjectConverter.cs
- PtsPage.cs
- ZipPackage.cs
- OutputCacheSettingsSection.cs
- AuthenticationModulesSection.cs
- TextEditorCharacters.cs
- XmlSchemaSimpleContentExtension.cs
- ObjectItemNoOpAssemblyLoader.cs
- UnrecognizedAssertionsBindingElement.cs