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
- ErrorWebPart.cs
- ViewValidator.cs
- SharedStatics.cs
- StorageComplexPropertyMapping.cs
- SqlServer2KCompatibilityAnnotation.cs
- WebPartMinimizeVerb.cs
- TypedElement.cs
- PageBreakRecord.cs
- HiddenFieldDesigner.cs
- WebBrowserContainer.cs
- Internal.cs
- GridItemPattern.cs
- ProjectionCamera.cs
- RewritingPass.cs
- CookieHandler.cs
- DispatcherExceptionEventArgs.cs
- Size3D.cs
- ListItemParagraph.cs
- ReaderWriterLock.cs
- EntityClassGenerator.cs
- Identity.cs
- Border.cs
- PlatformCulture.cs
- VScrollProperties.cs
- QilInvoke.cs
- FormsIdentity.cs
- XmlHierarchicalEnumerable.cs
- AlgoModule.cs
- SecurityUniqueId.cs
- ExpressionConverter.cs
- DBAsyncResult.cs
- XmlConverter.cs
- XamlPathDataSerializer.cs
- TextPointerBase.cs
- NativeMethods.cs
- RenderingBiasValidation.cs
- ProtocolsConfigurationHandler.cs
- GridViewItemAutomationPeer.cs
- CompilerParameters.cs
- SparseMemoryStream.cs
- Panel.cs
- Preprocessor.cs
- DataObjectAttribute.cs
- WindowsListViewItemStartMenu.cs
- BindingsSection.cs
- ScaleTransform.cs
- RemoteX509AsymmetricSecurityKey.cs
- SafeLocalAllocation.cs
- ConstraintEnumerator.cs
- UseAttributeSetsAction.cs
- TemplatePagerField.cs
- ConfigXmlDocument.cs
- DataBinder.cs
- DataGridViewCellCancelEventArgs.cs
- SimpleMailWebEventProvider.cs
- ToolStripSplitButton.cs
- ConsoleTraceListener.cs
- RestHandler.cs
- Thumb.cs
- ToolStripMenuItemDesigner.cs
- TriggerBase.cs
- DictionaryEntry.cs
- ClientScriptManager.cs
- ExternalCalls.cs
- XmlNodeList.cs
- StorageInfo.cs
- XmlHelper.cs
- EventRouteFactory.cs
- Fonts.cs
- DefaultProxySection.cs
- ReliableSessionElement.cs
- DoubleAnimationUsingKeyFrames.cs
- PointAnimationUsingKeyFrames.cs
- ResourceManager.cs
- EncodingInfo.cs
- SqlConnectionString.cs
- SqlDataSourceRefreshSchemaForm.cs
- TreeNodeMouseHoverEvent.cs
- MulticastIPAddressInformationCollection.cs
- activationcontext.cs
- XmlUrlResolver.cs
- DataGridViewRowCollection.cs
- ControlPaint.cs
- CultureNotFoundException.cs
- CookieProtection.cs
- HttpDebugHandler.cs
- Lease.cs
- SelectedGridItemChangedEvent.cs
- HttpValueCollection.cs
- DataGridViewCellConverter.cs
- Config.cs
- BinaryObjectInfo.cs
- RenderCapability.cs
- CheckedPointers.cs
- FontFamily.cs
- PermissionSetTriple.cs
- PassportAuthenticationEventArgs.cs
- SafeNativeMethods.cs
- RectAnimationBase.cs
- Thickness.cs