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
- WizardStepBase.cs
- relpropertyhelper.cs
- ConfigurationManagerInternalFactory.cs
- TcpConnectionPool.cs
- FrameSecurityDescriptor.cs
- ConnectorDragDropGlyph.cs
- ExternalFile.cs
- WindowAutomationPeer.cs
- Filter.cs
- EdmRelationshipRoleAttribute.cs
- WebPartConnectionsCancelVerb.cs
- TargetConverter.cs
- ByteRangeDownloader.cs
- OdbcConnectionString.cs
- CreateParams.cs
- StringFunctions.cs
- MultiView.cs
- TabItem.cs
- XmlSchemaSimpleTypeRestriction.cs
- CmsUtils.cs
- OracleCommandBuilder.cs
- TriggerCollection.cs
- DataServices.cs
- GridViewRowEventArgs.cs
- XmlSchemaNotation.cs
- TypeBinaryExpression.cs
- AddressingVersion.cs
- SplitterEvent.cs
- ConfigXmlElement.cs
- BindingExpressionUncommonField.cs
- ImageMap.cs
- TextDpi.cs
- MessageSecurityOverTcpElement.cs
- MetadataPropertyvalue.cs
- ContextTokenTypeConverter.cs
- LineMetrics.cs
- SchemaImporterExtensionElement.cs
- RequestNavigateEventArgs.cs
- SpellerStatusTable.cs
- PtsHelper.cs
- MexBindingElement.cs
- ControlParameter.cs
- ListViewInsertedEventArgs.cs
- HierarchicalDataTemplate.cs
- UncommonField.cs
- InvalidAsynchronousStateException.cs
- ComponentEditorPage.cs
- NativeMethodsCLR.cs
- compensatingcollection.cs
- OperationDescription.cs
- FixedSOMContainer.cs
- SqlDataSourceEnumerator.cs
- Int32Rect.cs
- Light.cs
- UnicodeEncoding.cs
- XsltContext.cs
- MouseButton.cs
- MainMenu.cs
- InheritanceAttribute.cs
- _ConnectOverlappedAsyncResult.cs
- InstanceOwnerException.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- SupportsPreviewControlAttribute.cs
- SQLBoolean.cs
- CriticalFinalizerObject.cs
- XslTransformFileEditor.cs
- UICuesEvent.cs
- CultureMapper.cs
- SystemFonts.cs
- ResourceWriter.cs
- NestPullup.cs
- precedingsibling.cs
- PrintPreviewGraphics.cs
- KeyValueSerializer.cs
- TypeNameHelper.cs
- XmlEntity.cs
- TextTrailingCharacterEllipsis.cs
- XsltSettings.cs
- ListViewHitTestInfo.cs
- ModelTypeConverter.cs
- WindowsListViewItemCheckBox.cs
- CapabilitiesRule.cs
- FileCodeGroup.cs
- StructuralComparisons.cs
- DeviceOverridableAttribute.cs
- FormatException.cs
- RuleSettingsCollection.cs
- Quaternion.cs
- HttpProfileGroupBase.cs
- AsymmetricSignatureFormatter.cs
- TraceContextEventArgs.cs
- DataSetUtil.cs
- SchemaCollectionCompiler.cs
- Cursor.cs
- ExtractorMetadata.cs
- XmlSchemaAny.cs
- ProfileGroupSettingsCollection.cs
- Win32SafeHandles.cs
- PartialCachingAttribute.cs
- WinInetCache.cs