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
- x509utils.cs
- ClientBase.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- ColumnMapVisitor.cs
- WebPartTransformerCollection.cs
- CellRelation.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- WebPartZoneBase.cs
- ThumbAutomationPeer.cs
- Descriptor.cs
- ApplicationBuildProvider.cs
- SvcMapFileLoader.cs
- CaseStatementProjectedSlot.cs
- SHA512.cs
- BitmapMetadata.cs
- BitmapFrameEncode.cs
- DataServiceExpressionVisitor.cs
- DesignTimeType.cs
- LambdaCompiler.Lambda.cs
- ObjectDataSourceDisposingEventArgs.cs
- DispatcherSynchronizationContext.cs
- HttpHandlerActionCollection.cs
- XPathPatternBuilder.cs
- PanelDesigner.cs
- Timer.cs
- DataErrorValidationRule.cs
- XomlCompilerError.cs
- VisualStateGroup.cs
- FixedSOMLineRanges.cs
- TreeViewImageIndexConverter.cs
- EntityDescriptor.cs
- FixedSOMTextRun.cs
- HwndProxyElementProvider.cs
- TypeNameConverter.cs
- CryptoHandle.cs
- DataGridViewSortCompareEventArgs.cs
- PiiTraceSource.cs
- FormViewModeEventArgs.cs
- OleAutBinder.cs
- CodeAccessPermission.cs
- NullableBoolConverter.cs
- RootContext.cs
- ConnectionProviderAttribute.cs
- Canvas.cs
- sqlmetadatafactory.cs
- LogRestartAreaEnumerator.cs
- Object.cs
- SizeAnimationUsingKeyFrames.cs
- IImplicitResourceProvider.cs
- XmlNodeList.cs
- TextTreeRootTextBlock.cs
- _ListenerResponseStream.cs
- XmlEncodedRawTextWriter.cs
- CompositeTypefaceMetrics.cs
- CompilationRelaxations.cs
- BaseValidatorDesigner.cs
- DataServiceQueryProvider.cs
- __Filters.cs
- ClientSideProviderDescription.cs
- PropertyEmitterBase.cs
- TransformerInfoCollection.cs
- BrowserInteropHelper.cs
- KoreanCalendar.cs
- QilTypeChecker.cs
- SpinWait.cs
- StatusBarPanel.cs
- PasswordDeriveBytes.cs
- TracingConnectionListener.cs
- ModuleBuilderData.cs
- TextEditorSelection.cs
- IconConverter.cs
- DocumentGridContextMenu.cs
- ObjectListItemCollection.cs
- ListViewCancelEventArgs.cs
- TextureBrush.cs
- WindowsListView.cs
- DesignerPainter.cs
- ReadOnlyPermissionSet.cs
- DataTableReaderListener.cs
- DefaultProfileManager.cs
- TextTreeInsertElementUndoUnit.cs
- FunctionImportElement.cs
- BitConverter.cs
- ListItemParagraph.cs
- ListViewUpdateEventArgs.cs
- ContractTypeNameCollection.cs
- IndexedString.cs
- MultiBindingExpression.cs
- PlatformCulture.cs
- HttpListenerRequest.cs
- ScriptManagerProxy.cs
- WindowsComboBox.cs
- DataColumnMappingCollection.cs
- TaskResultSetter.cs
- HttpModuleCollection.cs
- UriTemplateEquivalenceComparer.cs
- ManagedIStream.cs
- StreamSecurityUpgradeInitiatorBase.cs
- _OSSOCK.cs
- ObjectHelper.cs