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 / ContextQuery.cs / 1 / ContextQuery.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; internal class ContextQuery : Query { protected XPathNavigator contextNode; public ContextQuery() { this.count = 0; } protected ContextQuery(ContextQuery other) : base(other) { this.contextNode = other.contextNode; // Don't need to clone here } public override void Reset() { count = 0; } public override XPathNavigator Current { get { return contextNode; } } public override object Evaluate(XPathNodeIterator context) { contextNode = context.Current; // We don't clone here. Because we never move it. count = 0; return this; } public override XPathNavigator Advance() { if (count == 0) { count = 1; return contextNode; } return null; } public override XPathNavigator MatchNode(XPathNavigator current) { return current; } public override XPathNodeIterator Clone() { return new ContextQuery(this); } public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } } public override int CurrentPosition { get { return count; } } public override int Count { get { return 1; } } public override QueryProps Properties { get { return QueryProps.Merge | QueryProps.Cached | QueryProps.Position | QueryProps.Count; } } } } // 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; internal class ContextQuery : Query { protected XPathNavigator contextNode; public ContextQuery() { this.count = 0; } protected ContextQuery(ContextQuery other) : base(other) { this.contextNode = other.contextNode; // Don't need to clone here } public override void Reset() { count = 0; } public override XPathNavigator Current { get { return contextNode; } } public override object Evaluate(XPathNodeIterator context) { contextNode = context.Current; // We don't clone here. Because we never move it. count = 0; return this; } public override XPathNavigator Advance() { if (count == 0) { count = 1; return contextNode; } return null; } public override XPathNavigator MatchNode(XPathNavigator current) { return current; } public override XPathNodeIterator Clone() { return new ContextQuery(this); } public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } } public override int CurrentPosition { get { return count; } } public override int Count { get { return 1; } } public override QueryProps Properties { get { return QueryProps.Merge | QueryProps.Cached | QueryProps.Position | QueryProps.Count; } } } } // 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
- FixedTextView.cs
- ConfigurationManagerInternalFactory.cs
- XmlIterators.cs
- ColorAnimationBase.cs
- SystemNetHelpers.cs
- RenderingEventArgs.cs
- SqlCommand.cs
- ToolStripMenuItemCodeDomSerializer.cs
- DataSourceXmlTextReader.cs
- Rotation3D.cs
- EntityDataSourceReferenceGroup.cs
- UnmanagedMarshal.cs
- RedirectionProxy.cs
- NamedObject.cs
- HtmlHead.cs
- SiteOfOriginPart.cs
- LinkUtilities.cs
- SchemaHelper.cs
- ExitEventArgs.cs
- XmlNotation.cs
- DurationConverter.cs
- QilValidationVisitor.cs
- SerializationStore.cs
- MatrixTransform.cs
- SqlDataReader.cs
- QilPatternVisitor.cs
- SurrogateEncoder.cs
- ActivityTypeDesigner.xaml.cs
- SelfIssuedAuthProofToken.cs
- MembershipUser.cs
- WeakReference.cs
- AlternateView.cs
- Logging.cs
- WindowsUpDown.cs
- DeleteMemberBinder.cs
- DashStyle.cs
- PointLightBase.cs
- XmlDataContract.cs
- BufferedStream.cs
- XAMLParseException.cs
- StringSorter.cs
- WebPartEditorCancelVerb.cs
- CodeValidator.cs
- DataGrid.cs
- IconBitmapDecoder.cs
- ScriptBehaviorDescriptor.cs
- TdsParserSessionPool.cs
- SqlUserDefinedTypeAttribute.cs
- CustomPopupPlacement.cs
- DecimalFormatter.cs
- GeometryCollection.cs
- MasterPageBuildProvider.cs
- MailBnfHelper.cs
- DeclarationUpdate.cs
- IisNotInstalledException.cs
- safelinkcollection.cs
- Opcode.cs
- ContentDefinition.cs
- StringFormat.cs
- TileBrush.cs
- RepeaterDesigner.cs
- PropertySegmentSerializer.cs
- DataSetFieldSchema.cs
- ToggleProviderWrapper.cs
- BamlResourceSerializer.cs
- MemberHolder.cs
- WebPageTraceListener.cs
- WindowsSysHeader.cs
- SQLGuidStorage.cs
- UnsafeNativeMethods.cs
- ExpressionPrefixAttribute.cs
- Base64Stream.cs
- ValuePatternIdentifiers.cs
- WebPartConnectionsCancelVerb.cs
- ObjectQuery.cs
- StandardOleMarshalObject.cs
- SmiEventStream.cs
- RenderData.cs
- CommandTreeTypeHelper.cs
- BrowserTree.cs
- BidOverLoads.cs
- Geometry.cs
- RoutedEventArgs.cs
- MarginsConverter.cs
- FixedMaxHeap.cs
- DataGridDetailsPresenter.cs
- WindowsUpDown.cs
- DataGridViewComboBoxColumn.cs
- RawKeyboardInputReport.cs
- IRCollection.cs
- ProgressiveCrcCalculatingStream.cs
- Guid.cs
- DecoderFallback.cs
- SecurityCredentialsManager.cs
- WindowsGraphics.cs
- UnSafeCharBuffer.cs
- ByteViewer.cs
- DebuggerAttributes.cs
- RegisteredDisposeScript.cs
- LowerCaseStringConverter.cs