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
- GeometryCombineModeValidation.cs
- ComponentResourceManager.cs
- ConfigDefinitionUpdates.cs
- GZipStream.cs
- FixedSOMPageConstructor.cs
- InlineObject.cs
- DataRowExtensions.cs
- HtmlContainerControl.cs
- DataGridCellAutomationPeer.cs
- Decimal.cs
- Classification.cs
- EventProviderWriter.cs
- HttpRuntimeSection.cs
- ReflectTypeDescriptionProvider.cs
- EncodingDataItem.cs
- TouchPoint.cs
- PathParser.cs
- XmlWhitespace.cs
- ImageCodecInfoPrivate.cs
- BitmapEffectCollection.cs
- codemethodreferenceexpression.cs
- WriterOutput.cs
- ImageBrush.cs
- BinaryObjectWriter.cs
- XslAstAnalyzer.cs
- ExpressionWriter.cs
- ClearTypeHintValidation.cs
- GenericXmlSecurityTokenAuthenticator.cs
- ProtocolsConfigurationHandler.cs
- CompiledRegexRunner.cs
- XmlSchemaElement.cs
- NetMsmqBindingCollectionElement.cs
- CircleHotSpot.cs
- SourceFilter.cs
- ExtenderControl.cs
- FullTrustAssembly.cs
- ZipIOExtraField.cs
- StdValidatorsAndConverters.cs
- SequenceFullException.cs
- TextCollapsingProperties.cs
- DeferredReference.cs
- DataGridViewCellParsingEventArgs.cs
- BamlTreeNode.cs
- CompoundFileIOPermission.cs
- Rectangle.cs
- Span.cs
- CustomAttributeSerializer.cs
- CellIdBoolean.cs
- ConstraintCollection.cs
- InfocardClientCredentials.cs
- FixedFindEngine.cs
- Material.cs
- SafeArrayRankMismatchException.cs
- PixelFormats.cs
- SafeFileMapViewHandle.cs
- JsonDeserializer.cs
- SemaphoreFullException.cs
- TreeBuilder.cs
- SubstitutionList.cs
- DependencyPropertyValueSerializer.cs
- FileClassifier.cs
- Action.cs
- Verify.cs
- QueryPageSettingsEventArgs.cs
- PipeStream.cs
- UpdateCompiler.cs
- QilGeneratorEnv.cs
- EpmHelper.cs
- NullableIntAverageAggregationOperator.cs
- DataBoundControlDesigner.cs
- EntityReference.cs
- EntityReference.cs
- ContainerControl.cs
- DataTableMappingCollection.cs
- OpenTypeCommon.cs
- TypeSystemProvider.cs
- Pens.cs
- PipeConnection.cs
- ForwardPositionQuery.cs
- NavigationPropertyEmitter.cs
- HttpCacheVary.cs
- DefaultAutoFieldGenerator.cs
- BigInt.cs
- TreeNodeBinding.cs
- ConfigXmlCDataSection.cs
- DataRelation.cs
- LowerCaseStringConverter.cs
- SmiContext.cs
- TextCharacters.cs
- XmlReflectionImporter.cs
- FrameworkElement.cs
- EncryptedType.cs
- ScrollableControl.cs
- Nullable.cs
- XmlIlVisitor.cs
- TimeoutHelper.cs
- OwnerDrawPropertyBag.cs
- DependencyObjectProvider.cs
- SortFieldComparer.cs
- ToolboxDataAttribute.cs