Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DSACryptoServiceProvider.cs
- PanelStyle.cs
- HtmlControlPersistable.cs
- TextMessageEncodingElement.cs
- ButtonPopupAdapter.cs
- RegexRunner.cs
- ListManagerBindingsCollection.cs
- EntityTemplateUserControl.cs
- CompiledQueryCacheKey.cs
- PlanCompiler.cs
- EventPropertyMap.cs
- FontFamily.cs
- shaper.cs
- DocumentEventArgs.cs
- RequestSecurityToken.cs
- AttachedAnnotationChangedEventArgs.cs
- SizeConverter.cs
- SettingsContext.cs
- SimpleWebHandlerParser.cs
- CalendarDay.cs
- DNS.cs
- EntityDataSourceReferenceGroup.cs
- DoubleCollection.cs
- DataTemplateSelector.cs
- MembershipPasswordException.cs
- TagMapInfo.cs
- DetailsViewRow.cs
- RequestSecurityTokenResponse.cs
- ImageFormat.cs
- ICspAsymmetricAlgorithm.cs
- objectquery_tresulttype.cs
- ActivityExecutorDelegateInfo.cs
- WindowsFont.cs
- MainMenu.cs
- StreamingContext.cs
- TabRenderer.cs
- PagePropertiesChangingEventArgs.cs
- HybridDictionary.cs
- UInt32.cs
- ConstructorBuilder.cs
- HostProtectionException.cs
- MappedMetaModel.cs
- ISO2022Encoding.cs
- XmlDataSourceNodeDescriptor.cs
- Stylus.cs
- Signature.cs
- FloaterParaClient.cs
- VirtualizingPanel.cs
- XslUrlEditor.cs
- DockPanel.cs
- EdmEntityTypeAttribute.cs
- NativeBuffer.cs
- DataServiceRequest.cs
- ReadOnlyHierarchicalDataSource.cs
- FontConverter.cs
- ResourceReferenceExpressionConverter.cs
- CallbackCorrelationInitializer.cs
- SessionEndingCancelEventArgs.cs
- WorkflowServiceBehavior.cs
- AttributeQuery.cs
- PerformanceCounter.cs
- UriExt.cs
- TextTreeNode.cs
- EmptyReadOnlyDictionaryInternal.cs
- PropertyFilterAttribute.cs
- ArraySortHelper.cs
- SqlIdentifier.cs
- App.cs
- Storyboard.cs
- SR.cs
- NumberSubstitution.cs
- SerializationTrace.cs
- FlowDocumentPage.cs
- MetadataConversionError.cs
- ComboBoxRenderer.cs
- ContextMenuService.cs
- DockEditor.cs
- QuadraticBezierSegment.cs
- WebHostedComPlusServiceHost.cs
- WebServiceAttribute.cs
- PaperSource.cs
- FrameworkReadOnlyPropertyMetadata.cs
- HashStream.cs
- RegisterInfo.cs
- MimeFormImporter.cs
- CompileXomlTask.cs
- XmlWrappingReader.cs
- DispatcherTimer.cs
- RegisterResponseInfo.cs
- ColumnResizeAdorner.cs
- DiagnosticsConfigurationHandler.cs
- UIAgentMonitor.cs
- ActivityDesigner.cs
- WorkflowIdleBehavior.cs
- SelectionManager.cs
- XmlSchemaAttributeGroupRef.cs
- ReadOnlyTernaryTree.cs
- DataSourceControl.cs
- TileBrush.cs
- AttributeUsageAttribute.cs