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 List outputBuffer;
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 List outputBuffer;
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
- BindingManagerDataErrorEventArgs.cs
- AttributeXamlType.cs
- XmlArrayItemAttributes.cs
- XmlCustomFormatter.cs
- ItemCheckedEvent.cs
- SchemaNotation.cs
- UInt64.cs
- EditorPartCollection.cs
- SamlSubjectStatement.cs
- ControlValuePropertyAttribute.cs
- EdmTypeAttribute.cs
- BaseTemplateBuildProvider.cs
- RefType.cs
- AnnotationAuthorChangedEventArgs.cs
- Material.cs
- WSSecurityPolicy11.cs
- XmlILModule.cs
- EditingMode.cs
- LogConverter.cs
- FixUpCollection.cs
- NativeMethods.cs
- DWriteFactory.cs
- AsyncOperationManager.cs
- RequestResizeEvent.cs
- BitConverter.cs
- CachedRequestParams.cs
- SqlNotificationEventArgs.cs
- WindowsImpersonationContext.cs
- BevelBitmapEffect.cs
- EnumerableCollectionView.cs
- ClassImporter.cs
- TypeForwardedToAttribute.cs
- SafeArrayTypeMismatchException.cs
- JsonQNameDataContract.cs
- Translator.cs
- BitmapImage.cs
- RubberbandSelector.cs
- TraceHelpers.cs
- handlecollector.cs
- TcpChannelHelper.cs
- VectorAnimationBase.cs
- DispatcherObject.cs
- CodeDirectoryCompiler.cs
- AffineTransform3D.cs
- AstNode.cs
- XsltSettings.cs
- EntityParameter.cs
- DataGridViewColumnEventArgs.cs
- DataGridViewRow.cs
- FileDataSourceCache.cs
- ThicknessAnimation.cs
- BackgroundWorker.cs
- CustomPopupPlacement.cs
- BuildProvider.cs
- SystemKeyConverter.cs
- ExpressionNode.cs
- Converter.cs
- SafeNativeMethods.cs
- coordinator.cs
- ContractInferenceHelper.cs
- DataTableTypeConverter.cs
- SyndicationLink.cs
- Inflater.cs
- Function.cs
- WebPartsPersonalizationAuthorization.cs
- RIPEMD160Managed.cs
- DesignerActionItemCollection.cs
- ItemCollection.cs
- NameSpaceExtractor.cs
- FormViewPageEventArgs.cs
- Int32Animation.cs
- DictionaryBase.cs
- ByteAnimationUsingKeyFrames.cs
- SourceFileInfo.cs
- FormViewInsertedEventArgs.cs
- WmlPhoneCallAdapter.cs
- MessageDescription.cs
- Encoder.cs
- ModifierKeysConverter.cs
- AdornedElementPlaceholder.cs
- MetadataUtil.cs
- NavigationPropertySingletonExpression.cs
- CompiledRegexRunnerFactory.cs
- StringUtil.cs
- DriveInfo.cs
- RegexRunner.cs
- AudioFormatConverter.cs
- GroupBoxDesigner.cs
- StringOutput.cs
- HttpRawResponse.cs
- dbenumerator.cs
- XsdCachingReader.cs
- MetadataPropertyCollection.cs
- HttpAsyncResult.cs
- StaticDataManager.cs
- FillBehavior.cs
- DataServiceQueryProvider.cs
- PackWebRequestFactory.cs
- GcHandle.cs
- SafeSecurityHandles.cs