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
- CaseStatementProjectedSlot.cs
- SqlTrackingQuery.cs
- FontCacheUtil.cs
- MatrixTransform3D.cs
- SafeEventLogReadHandle.cs
- Debug.cs
- TypeLoadException.cs
- SamlAssertion.cs
- EllipseGeometry.cs
- HostProtectionPermission.cs
- LicenseContext.cs
- WpfPayload.cs
- RelativeSource.cs
- PageWrapper.cs
- ProgressBar.cs
- ProxyAttribute.cs
- PackagePartCollection.cs
- GroupItem.cs
- TableCellAutomationPeer.cs
- webproxy.cs
- ValueOfAction.cs
- RecognizerBase.cs
- PackageDigitalSignatureManager.cs
- AsyncStreamReader.cs
- StateMachineSubscriptionManager.cs
- oledbconnectionstring.cs
- TextServicesLoader.cs
- InheritanceRules.cs
- ToolStripDropDownButton.cs
- SqlCommandBuilder.cs
- ToolStripLocationCancelEventArgs.cs
- DocumentXmlWriter.cs
- TransformerInfo.cs
- ToolStripContentPanelRenderEventArgs.cs
- XamlToRtfParser.cs
- GrabHandleGlyph.cs
- ListViewGroupItemCollection.cs
- ToolStripHighContrastRenderer.cs
- HyperLink.cs
- HostedTcpTransportManager.cs
- SafeLibraryHandle.cs
- ServicesExceptionNotHandledEventArgs.cs
- XmlILIndex.cs
- Part.cs
- HttpCachePolicyWrapper.cs
- BitmapDecoder.cs
- XamlTypeWithExplicitNamespace.cs
- ChangeToolStripParentVerb.cs
- ReliableChannelBinder.cs
- PointLightBase.cs
- ObjectSet.cs
- CodeMemberMethod.cs
- DownloadProgressEventArgs.cs
- DataGridRowClipboardEventArgs.cs
- MsmqIntegrationSecurityMode.cs
- FontResourceCache.cs
- PersonalizationState.cs
- WindowsFormsHostAutomationPeer.cs
- MimeTypeMapper.cs
- Pointer.cs
- DesignerDataColumn.cs
- SoundPlayer.cs
- SymmetricAlgorithm.cs
- ArithmeticException.cs
- ProviderException.cs
- DbConnectionFactory.cs
- CellParagraph.cs
- FrameDimension.cs
- DiscoveryOperationContextExtension.cs
- RelationshipConverter.cs
- OutputCacheProfile.cs
- InvokeMethodActivity.cs
- TextTreeRootNode.cs
- SafePipeHandle.cs
- MenuItemAutomationPeer.cs
- PropertyIDSet.cs
- TableLayoutRowStyleCollection.cs
- Assert.cs
- NativeActivityFaultContext.cs
- AsmxEndpointPickerExtension.cs
- Image.cs
- cookie.cs
- SpeechSeg.cs
- HexParser.cs
- EventWaitHandle.cs
- NavigatorInput.cs
- ApplicationInfo.cs
- ValidationHelper.cs
- ComponentEvent.cs
- WorkflowService.cs
- DbQueryCommandTree.cs
- EmulateRecognizeCompletedEventArgs.cs
- Grid.cs
- DataGridViewLayoutData.cs
- HttpWriter.cs
- RegexCode.cs
- SourceItem.cs
- ProxyFragment.cs
- DbDataAdapter.cs
- MimeTextImporter.cs