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
- XmlWrappingWriter.cs
- ByeOperation11AsyncResult.cs
- MergeFailedEvent.cs
- TypographyProperties.cs
- SpeechRecognitionEngine.cs
- RectAnimation.cs
- ServiceChannel.cs
- DynamicAttribute.cs
- FullTextLine.cs
- ColorComboBox.cs
- Application.cs
- ZipArchive.cs
- DetailsViewInsertEventArgs.cs
- ZipIORawDataFileBlock.cs
- PagesChangedEventArgs.cs
- SqlInternalConnection.cs
- DataGridViewCheckBoxColumn.cs
- ResourceDisplayNameAttribute.cs
- Empty.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- ClrPerspective.cs
- JournalEntryListConverter.cs
- FigureParagraph.cs
- StickyNoteAnnotations.cs
- SqlDeflator.cs
- CacheDependency.cs
- XmlEncodedRawTextWriter.cs
- LinqDataSource.cs
- XPathNodeHelper.cs
- OleDbPermission.cs
- ItemDragEvent.cs
- SystemException.cs
- CodeSubDirectoriesCollection.cs
- _TLSstream.cs
- HashAlgorithm.cs
- RoleService.cs
- MenuItemStyleCollection.cs
- KeyBinding.cs
- _AutoWebProxyScriptHelper.cs
- login.cs
- TextParagraphView.cs
- PrinterSettings.cs
- IndexingContentUnit.cs
- ImageCodecInfoPrivate.cs
- Transform3DGroup.cs
- SchemaCollectionPreprocessor.cs
- EncoderNLS.cs
- DispatcherHookEventArgs.cs
- FacetChecker.cs
- NativeBuffer.cs
- DocumentApplicationDocumentViewer.cs
- WinCategoryAttribute.cs
- GPPOINTF.cs
- WsrmTraceRecord.cs
- FixedStringLookup.cs
- GridEntry.cs
- XmlProcessingInstruction.cs
- CodeSnippetExpression.cs
- FormsAuthenticationConfiguration.cs
- TimeoutException.cs
- GlyphManager.cs
- SqlPersonalizationProvider.cs
- XmlSchemaObject.cs
- GroupItem.cs
- ControlIdConverter.cs
- CqlWriter.cs
- FacetValues.cs
- PageThemeParser.cs
- input.cs
- Codec.cs
- ApplicationTrust.cs
- MenuItemBinding.cs
- TextElement.cs
- UIHelper.cs
- HostedElements.cs
- NetworkCredential.cs
- WbemProvider.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- BidPrivateBase.cs
- Grammar.cs
- SqlConnectionPoolProviderInfo.cs
- ModuleBuilderData.cs
- MatrixTransform3D.cs
- HwndPanningFeedback.cs
- OverloadGroupAttribute.cs
- PartManifestEntry.cs
- ProfileSettingsCollection.cs
- ReadOnlyTernaryTree.cs
- CodeTypeMemberCollection.cs
- RegisteredHiddenField.cs
- SubtreeProcessor.cs
- ToolBarDesigner.cs
- SQLDateTime.cs
- DataSpaceManager.cs
- GPPOINTF.cs
- TextFormatterHost.cs
- ObjectNotFoundException.cs
- TableLayoutSettings.cs
- DBCommandBuilder.cs
- DataServiceResponse.cs