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
- MatchingStyle.cs
- SettingsSavedEventArgs.cs
- InputElement.cs
- AppSecurityManager.cs
- XmlAggregates.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- WindowsComboBox.cs
- ToolBarPanel.cs
- MarkupCompiler.cs
- OracleLob.cs
- LocationSectionRecord.cs
- DeploymentSectionCache.cs
- TableLayout.cs
- UntrustedRecipientException.cs
- CodeVariableDeclarationStatement.cs
- CustomErrorsSection.cs
- NamespaceQuery.cs
- ScriptingSectionGroup.cs
- PtsHost.cs
- CodeSnippetStatement.cs
- datacache.cs
- Knowncolors.cs
- HijriCalendar.cs
- Inline.cs
- FormViewModeEventArgs.cs
- Typography.cs
- ListViewTableCell.cs
- Directory.cs
- EdmComplexPropertyAttribute.cs
- EllipseGeometry.cs
- TextElement.cs
- SystemUnicastIPAddressInformation.cs
- WindowsAltTab.cs
- SignedPkcs7.cs
- MenuItemCollection.cs
- SqlMethodCallConverter.cs
- SubordinateTransaction.cs
- MethodCallConverter.cs
- TextDecorations.cs
- DashStyles.cs
- WebHttpSecurity.cs
- GroupBox.cs
- CodeVariableReferenceExpression.cs
- PersonalizationState.cs
- SynchronizedPool.cs
- Brushes.cs
- UpdatePanel.cs
- NameScope.cs
- HttpProcessUtility.cs
- XPathEmptyIterator.cs
- Descriptor.cs
- TextClipboardData.cs
- ViewGenerator.cs
- CfgSemanticTag.cs
- DataSourceHelper.cs
- HttpInputStream.cs
- DataGridViewCellCancelEventArgs.cs
- BamlBinaryWriter.cs
- ButtonPopupAdapter.cs
- DataGridViewDataErrorEventArgs.cs
- ProviderManager.cs
- Int16Converter.cs
- EdgeProfileValidation.cs
- IntegerFacetDescriptionElement.cs
- OleDbEnumerator.cs
- AtomServiceDocumentSerializer.cs
- CollectionType.cs
- CodeDomLocalizationProvider.cs
- DecimalAnimationBase.cs
- ConditionalAttribute.cs
- Double.cs
- DiagnosticTraceSource.cs
- ContentValidator.cs
- SqlError.cs
- ScrollEventArgs.cs
- SchemaMapping.cs
- MouseEventArgs.cs
- ObjectMemberMapping.cs
- OneToOneMappingSerializer.cs
- Tablet.cs
- XmlRootAttribute.cs
- LinqDataSourceEditData.cs
- MemoryRecordBuffer.cs
- QueryReaderSettings.cs
- XmlnsDefinitionAttribute.cs
- cookieexception.cs
- ScriptResourceHandler.cs
- EntitySqlQueryCacheEntry.cs
- Menu.cs
- RelationshipNavigation.cs
- BuiltInExpr.cs
- ValidateNames.cs
- LinkUtilities.cs
- FormatPage.cs
- BinaryCommonClasses.cs
- FileDialog_Vista.cs
- EdmProperty.cs
- XmlIlTypeHelper.cs
- SamlAttributeStatement.cs
- SafeWaitHandle.cs