Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheAxisQuery.cs / 1305376 / 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
- AttributeUsageAttribute.cs
- TargetParameterCountException.cs
- ConfigXmlText.cs
- ContextTokenTypeConverter.cs
- SyndicationDeserializer.cs
- ResourceCategoryAttribute.cs
- SectionInformation.cs
- KernelTypeValidation.cs
- ConfigurationElementCollection.cs
- SchemaImporterExtension.cs
- SoapInteropTypes.cs
- DataGrid.cs
- EnumCodeDomSerializer.cs
- ObjectConverter.cs
- RightsManagementInformation.cs
- ObservableDictionary.cs
- HtmlSelect.cs
- AsnEncodedData.cs
- InstanceDataCollectionCollection.cs
- ConstraintManager.cs
- NotifyParentPropertyAttribute.cs
- MarkupProperty.cs
- Group.cs
- DesignerActionItemCollection.cs
- DefaultParameterValueAttribute.cs
- DockPatternIdentifiers.cs
- HostingEnvironmentSection.cs
- ObjectItemCollection.cs
- TreeChangeInfo.cs
- _ListenerAsyncResult.cs
- HandleExceptionArgs.cs
- EnumMember.cs
- TouchDevice.cs
- Rotation3DKeyFrameCollection.cs
- XamlParser.cs
- ToolTipService.cs
- ActiveXSerializer.cs
- Visual3DCollection.cs
- ComplexTypeEmitter.cs
- Crc32Helper.cs
- CompilerError.cs
- PersistChildrenAttribute.cs
- PersistChildrenAttribute.cs
- PrintEvent.cs
- TypographyProperties.cs
- ExecutionEngineException.cs
- TypeInitializationException.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- DataGridViewRowsAddedEventArgs.cs
- SqlDataRecord.cs
- LineSegment.cs
- WeakRefEnumerator.cs
- RawMouseInputReport.cs
- Size.cs
- EncryptedPackage.cs
- SqlParameter.cs
- WebPartConnectionsEventArgs.cs
- DoubleAnimation.cs
- OdbcFactory.cs
- QuaternionAnimation.cs
- RuntimeResourceSet.cs
- IteratorDescriptor.cs
- SchemaNamespaceManager.cs
- AppDomain.cs
- CommonProperties.cs
- TextInfo.cs
- TripleDES.cs
- ParameterBuilder.cs
- CodeObject.cs
- TrackBar.cs
- RepeaterCommandEventArgs.cs
- DataListItemEventArgs.cs
- DecoderNLS.cs
- NumericUpDownAccelerationCollection.cs
- CultureInfo.cs
- XmlSubtreeReader.cs
- OperationCanceledException.cs
- BeginEvent.cs
- ValidationSummary.cs
- TemplatePropertyEntry.cs
- AxisAngleRotation3D.cs
- QualifiedCellIdBoolean.cs
- XmlHelper.cs
- FileDataSourceCache.cs
- TextDecorationCollectionConverter.cs
- XmlSchemaIdentityConstraint.cs
- HtmlAnchor.cs
- RegexWorker.cs
- CompositeFontInfo.cs
- HttpCachePolicyBase.cs
- InternalBufferOverflowException.cs
- AccessText.cs
- ApplicationDirectory.cs
- BaseDataList.cs
- BCLDebug.cs
- ConfigXmlComment.cs
- SQLInt32.cs
- RelatedPropertyManager.cs
- ListView.cs
- SecUtil.cs