Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / XPath / Internal / CacheOutputQuery.cs / 1 / CacheOutputQuery.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.Xml.Xsl; using System.Collections.Generic; internal abstract class CacheOutputQuery : Query { internal Query input; // int count; -- we reusing it here protected ListoutputBuffer; public CacheOutputQuery(Query input) { this.input = input; this.outputBuffer = new List (); this.count = 0; } protected CacheOutputQuery(CacheOutputQuery other) : base(other) { this.input = Clone(other.input); this.outputBuffer = new List (other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override void SetXsltContext(XsltContext context){ input.SetXsltContext(context); } public override object Evaluate(XPathNodeIterator context) { outputBuffer.Clear(); count = 0; return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this. // All subclasses should and would anyway override thismethod and 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 XPathResultType StaticType { get { return XPathResultType.NodeSet; } } 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; } } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); w.WriteEndElement(); } } } // 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.Xml.Xsl; using System.Collections.Generic; internal abstract class CacheOutputQuery : Query { internal Query input; // int count; -- we reusing it here protected ListoutputBuffer; public CacheOutputQuery(Query input) { this.input = input; this.outputBuffer = new List (); this.count = 0; } protected CacheOutputQuery(CacheOutputQuery other) : base(other) { this.input = Clone(other.input); this.outputBuffer = new List (other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override void SetXsltContext(XsltContext context){ input.SetXsltContext(context); } public override object Evaluate(XPathNodeIterator context) { outputBuffer.Clear(); count = 0; return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this. // All subclasses should and would anyway override thismethod and 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 XPathResultType StaticType { get { return XPathResultType.NodeSet; } } 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; } } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); w.WriteEndElement(); } } } // 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
- WebPartConnection.cs
- _NTAuthentication.cs
- Function.cs
- TypeCodeDomSerializer.cs
- ImageField.cs
- StylusOverProperty.cs
- DecimalFormatter.cs
- Native.cs
- AttachedPropertyInfo.cs
- InputDevice.cs
- DocumentPageHost.cs
- _DisconnectOverlappedAsyncResult.cs
- PipeStream.cs
- SmtpDigestAuthenticationModule.cs
- InertiaTranslationBehavior.cs
- XhtmlBasicTextBoxAdapter.cs
- ImageBrush.cs
- DependencyPropertyKey.cs
- CustomTypeDescriptor.cs
- Latin1Encoding.cs
- PointAnimation.cs
- Perspective.cs
- ResXDataNode.cs
- MailSettingsSection.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SoapTransportImporter.cs
- File.cs
- DBDataPermission.cs
- LeafCellTreeNode.cs
- KeyInterop.cs
- CodeDomDecompiler.cs
- SlipBehavior.cs
- Preprocessor.cs
- List.cs
- AnnotationHighlightLayer.cs
- BufferedWebEventProvider.cs
- DragDrop.cs
- CheckBoxRenderer.cs
- IndexerNameAttribute.cs
- Matrix.cs
- EditorBrowsableAttribute.cs
- FontWeightConverter.cs
- DbParameterCollectionHelper.cs
- MessageEnumerator.cs
- PrimaryKeyTypeConverter.cs
- RelationshipEndMember.cs
- DataListCommandEventArgs.cs
- XmlSignatureManifest.cs
- TextFormatterImp.cs
- BitmapCacheBrush.cs
- RemotingServices.cs
- PropertyChangeTracker.cs
- MediaTimeline.cs
- CommandDesigner.cs
- TableLayoutStyle.cs
- ADMembershipProvider.cs
- DataGridTable.cs
- CompilerState.cs
- ProcessDesigner.cs
- XmlAttributes.cs
- SelectorAutomationPeer.cs
- Keyboard.cs
- SelectionGlyph.cs
- FirstMatchCodeGroup.cs
- XPathArrayIterator.cs
- XPathParser.cs
- ExtenderProvidedPropertyAttribute.cs
- SerializationEventsCache.cs
- SqlCacheDependency.cs
- GeometryHitTestResult.cs
- Parameter.cs
- PathTooLongException.cs
- LongValidatorAttribute.cs
- DateTimeFormatInfoScanner.cs
- CacheChildrenQuery.cs
- Memoizer.cs
- PlainXmlWriter.cs
- GetPolicyDetailsRequest.cs
- Transform.cs
- ClientBuildManagerCallback.cs
- NetworkInterface.cs
- CodeExporter.cs
- HttpHandlerAction.cs
- DependencyPropertyKey.cs
- Exceptions.cs
- bidPrivateBase.cs
- ObjectDataSource.cs
- DebugManager.cs
- DateTimeStorage.cs
- SemanticBasicElement.cs
- Sql8ConformanceChecker.cs
- CultureTable.cs
- ReaderWriterLockWrapper.cs
- TranslateTransform.cs
- SystemFonts.cs
- SqlDataSourceCommandParser.cs
- SHA512Managed.cs
- WebPartConnectionsConfigureVerb.cs
- TypeUsage.cs
- ObjectDataSourceEventArgs.cs