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
- SizeValueSerializer.cs
- RemoteWebConfigurationHostServer.cs
- FastEncoder.cs
- SourceItem.cs
- DesignerSerializationVisibilityAttribute.cs
- XmlSchemaParticle.cs
- SchemaNamespaceManager.cs
- DataPager.cs
- CompositeKey.cs
- IProvider.cs
- EventSinkActivity.cs
- GenericPrincipal.cs
- ServiceReference.cs
- SqlMethodTransformer.cs
- SingleSelectRootGridEntry.cs
- GridPattern.cs
- SqlCommandBuilder.cs
- HtmlTableCellCollection.cs
- PrivateFontCollection.cs
- CompilationRelaxations.cs
- TargetParameterCountException.cs
- XamlParser.cs
- DmlSqlGenerator.cs
- Part.cs
- SystemInformation.cs
- RectangleConverter.cs
- IsolatedStorageFilePermission.cs
- ModuleBuilder.cs
- XmlSchemaObjectTable.cs
- XmlSchemaSequence.cs
- WindowsToolbarAsMenu.cs
- EdmEntityTypeAttribute.cs
- TreeViewTemplateSelector.cs
- VariableQuery.cs
- MemberAccessException.cs
- backend.cs
- SimpleTypeResolver.cs
- StaticExtension.cs
- TableProviderWrapper.cs
- Validator.cs
- StateMachineHelpers.cs
- RelationshipEndMember.cs
- HtmlForm.cs
- CodeCatchClauseCollection.cs
- XmlSchemaCompilationSettings.cs
- SoapIncludeAttribute.cs
- WindowsFont.cs
- MaterialGroup.cs
- ToolStripSystemRenderer.cs
- JapaneseLunisolarCalendar.cs
- OuterGlowBitmapEffect.cs
- FixedDocumentPaginator.cs
- Variant.cs
- ReaderWriterLock.cs
- DecimalFormatter.cs
- DataGridColumnCollection.cs
- FixedSOMSemanticBox.cs
- Maps.cs
- SystemFonts.cs
- MultiPropertyDescriptorGridEntry.cs
- VariableDesigner.xaml.cs
- ComboBox.cs
- MultitargetUtil.cs
- SqlDataReaderSmi.cs
- PointAnimation.cs
- TypeConverterAttribute.cs
- PathSegment.cs
- IgnoreDeviceFilterElementCollection.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- PropertyEmitterBase.cs
- FormsAuthenticationCredentials.cs
- DbConnectionPoolIdentity.cs
- LostFocusEventManager.cs
- HttpStreams.cs
- CalendarDay.cs
- UdpDuplexChannel.cs
- Keywords.cs
- Sql8ConformanceChecker.cs
- SpotLight.cs
- PersonalizationEntry.cs
- MatrixTransform.cs
- HtmlTitle.cs
- BackgroundWorker.cs
- InvalidOleVariantTypeException.cs
- SqlDataReaderSmi.cs
- StyleCollection.cs
- dsa.cs
- CellIdBoolean.cs
- HideDisabledControlAdapter.cs
- DictionarySectionHandler.cs
- SectionRecord.cs
- ForAllOperator.cs
- WebPartUserCapability.cs
- Timer.cs
- ApplicationActivator.cs
- TextRange.cs
- StrokeSerializer.cs
- EncryptedKeyIdentifierClause.cs
- ViewEvent.cs
- SctClaimSerializer.cs