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
- UpdatePanel.cs
- ToolStripTextBox.cs
- DataGridViewSelectedCellCollection.cs
- RichTextBoxConstants.cs
- PreservationFileReader.cs
- SourceSwitch.cs
- UTF7Encoding.cs
- XmlParserContext.cs
- ActivityBuilder.cs
- WebControlAdapter.cs
- LeaseManager.cs
- TargetException.cs
- PassportIdentity.cs
- FlowLayoutPanel.cs
- RuleSetDialog.cs
- Missing.cs
- FileLogRecordHeader.cs
- TextParagraph.cs
- FormatterServices.cs
- LinqDataSourceStatusEventArgs.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- RegexNode.cs
- ExtensibleClassFactory.cs
- BuildResultCache.cs
- Tokenizer.cs
- HScrollProperties.cs
- QilStrConcatenator.cs
- OleDbPropertySetGuid.cs
- IisTraceListener.cs
- LinkClickEvent.cs
- ContainerUIElement3D.cs
- TraceSection.cs
- CodeDOMProvider.cs
- WebPartConnectionsConnectVerb.cs
- ReachSerializationCacheItems.cs
- ADMembershipProvider.cs
- GridItemPattern.cs
- GuidConverter.cs
- RangeValueProviderWrapper.cs
- BlurBitmapEffect.cs
- EdmToObjectNamespaceMap.cs
- unsafenativemethodsother.cs
- DataGridViewRowEventArgs.cs
- IpcServerChannel.cs
- columnmapfactory.cs
- ParserStreamGeometryContext.cs
- DoubleAnimationUsingPath.cs
- SafeArrayRankMismatchException.cs
- XmlChildEnumerator.cs
- PublisherIdentityPermission.cs
- ToolStripGripRenderEventArgs.cs
- SafeThreadHandle.cs
- MethodImplAttribute.cs
- VisemeEventArgs.cs
- WsdlBuildProvider.cs
- ViewStateChangedEventArgs.cs
- PropertyBuilder.cs
- DataGridViewCellLinkedList.cs
- SiteMapHierarchicalDataSourceView.cs
- ProcessModule.cs
- XmlSerializationGeneratedCode.cs
- KeyInterop.cs
- SessionIDManager.cs
- CorrelationManager.cs
- ListViewAutomationPeer.cs
- ApplicationSettingsBase.cs
- ExtentJoinTreeNode.cs
- GeneralTransformGroup.cs
- Types.cs
- BamlResourceSerializer.cs
- OutputScope.cs
- ConfigurationStrings.cs
- WSDualHttpSecurityElement.cs
- IndentedTextWriter.cs
- AncillaryOps.cs
- GrammarBuilder.cs
- WebConfigurationManager.cs
- AccessDataSource.cs
- BrowserCapabilitiesFactory.cs
- ToolboxItemAttribute.cs
- RequestCacheValidator.cs
- TraceProvider.cs
- DescendantOverDescendantQuery.cs
- TemplatePropertyEntry.cs
- ConnectionInterfaceCollection.cs
- CngProperty.cs
- DictionaryEntry.cs
- WebPartEditVerb.cs
- FileSystemWatcher.cs
- DmlSqlGenerator.cs
- ConfigXmlComment.cs
- CharConverter.cs
- TaskSchedulerException.cs
- ContextMenuService.cs
- VBIdentifierName.cs
- IIS7WorkerRequest.cs
- Logging.cs
- FixedPosition.cs
- StandardToolWindows.cs
- TableRow.cs