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 / 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
- BreakRecordTable.cs
- invalidudtexception.cs
- APCustomTypeDescriptor.cs
- XmlValidatingReaderImpl.cs
- ConsoleKeyInfo.cs
- ElapsedEventArgs.cs
- CompilerCollection.cs
- HelpEvent.cs
- DirectoryObjectSecurity.cs
- XPathChildIterator.cs
- EncodingDataItem.cs
- WindowsSecurityToken.cs
- TextView.cs
- SortDescriptionCollection.cs
- TrustSection.cs
- CustomLineCap.cs
- GroupPartitionExpr.cs
- PropagatorResult.cs
- Collection.cs
- WarningException.cs
- LineGeometry.cs
- Stylesheet.cs
- PeerTransportSecurityElement.cs
- NonParentingControl.cs
- HandlerMappingMemo.cs
- ReflectionHelper.cs
- PageStatePersister.cs
- TreeNodeConverter.cs
- Page.cs
- RelatedView.cs
- TdsEnums.cs
- WeakHashtable.cs
- HandlerBase.cs
- ChannelSettingsElement.cs
- Window.cs
- ComponentSerializationService.cs
- RegexMatch.cs
- OperationResponse.cs
- InputScopeAttribute.cs
- MergeFailedEvent.cs
- ProcessStartInfo.cs
- ComponentEditorPage.cs
- ByteConverter.cs
- Keyboard.cs
- PartialList.cs
- MetadataSet.cs
- PinnedBufferMemoryStream.cs
- FormViewRow.cs
- RegexMatchCollection.cs
- MailMessageEventArgs.cs
- DocumentPageView.cs
- HttpClientCertificate.cs
- FileSystemWatcher.cs
- WorkflowApplicationAbortedException.cs
- ModelVisual3D.cs
- LayoutTable.cs
- RealProxy.cs
- FolderBrowserDialog.cs
- PathHelper.cs
- Utility.cs
- SqlUdtInfo.cs
- ResourceBinder.cs
- SessionPageStatePersister.cs
- WriteableBitmap.cs
- BaseParser.cs
- SQLInt32Storage.cs
- WebUtil.cs
- AggregationMinMaxHelpers.cs
- DictionarySectionHandler.cs
- EntityObject.cs
- FunctionDescription.cs
- CalendarDay.cs
- NullableDecimalSumAggregationOperator.cs
- StoreContentChangedEventArgs.cs
- DispatcherEventArgs.cs
- TextSimpleMarkerProperties.cs
- ModelFactory.cs
- FixedSOMContainer.cs
- BulletedListDesigner.cs
- _NtlmClient.cs
- WindowsPen.cs
- _NestedMultipleAsyncResult.cs
- XmlObjectSerializerContext.cs
- BaseTemplateParser.cs
- IsolatedStoragePermission.cs
- TrayIconDesigner.cs
- ImageList.cs
- ObjectQueryState.cs
- ColorConvertedBitmapExtension.cs
- Matrix3DStack.cs
- ModelVisual3D.cs
- SafeNativeMethods.cs
- CodeFieldReferenceExpression.cs
- OciHandle.cs
- Membership.cs
- BaseParaClient.cs
- DragEvent.cs
- InvokeProviderWrapper.cs
- MetadataImporter.cs
- Form.cs