Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / AttributeQuery.cs / 1 / AttributeQuery.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.Globalization; internal sealed class AttributeQuery : BaseAxisQuery { private bool onAttribute = false; public AttributeQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type) : base(qyParent, Name, Prefix, Type) {} private AttributeQuery(AttributeQuery other) : base(other) { this.onAttribute = other.onAttribute; } public override void Reset() { onAttribute = false; base.Reset(); } public override XPathNavigator Advance() { while (true) { if (! onAttribute) { currentNode = qyInput.Advance(); if (currentNode == null) { return null; } position = 0; currentNode = currentNode.Clone(); onAttribute = currentNode.MoveToFirstAttribute(); } else { onAttribute = currentNode.MoveToNextAttribute(); } if (onAttribute) { Debug.Assert(! currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs)); if (matches(currentNode)) { position++; return currentNode; } } } // while } public override XPathNavigator MatchNode(XPathNavigator context) { if (context != null) { if (context.NodeType == XPathNodeType.Attribute && matches(context)) { XPathNavigator temp = context.Clone(); if (temp.MoveToParent()) { return qyInput.MatchNode(temp); } } } return null; } public override XPathNodeIterator Clone() { return new AttributeQuery(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpHeaderCollection.cs
- XmlSchemaSimpleContentExtension.cs
- EdmSchemaAttribute.cs
- ProcessMessagesAsyncResult.cs
- counter.cs
- TrueReadOnlyCollection.cs
- RenderingBiasValidation.cs
- FrameDimension.cs
- WindowsSpinner.cs
- XmlDataProvider.cs
- ObjectNotFoundException.cs
- SmiTypedGetterSetter.cs
- ProviderUtil.cs
- NullRuntimeConfig.cs
- PlainXmlSerializer.cs
- DictionaryEntry.cs
- Ops.cs
- EntityDataSourceWrapperCollection.cs
- LinqDataSourceDeleteEventArgs.cs
- PasswordTextContainer.cs
- VisualStyleRenderer.cs
- SystemIcons.cs
- MulticastOption.cs
- ChannelListenerBase.cs
- UpdatePanel.cs
- Interlocked.cs
- SaveFileDialog.cs
- FloaterBaseParagraph.cs
- ToolBarButtonClickEvent.cs
- _SafeNetHandles.cs
- ToolStripRenderEventArgs.cs
- ErrorFormatter.cs
- ParameterModifier.cs
- AlphaSortedEnumConverter.cs
- Validator.cs
- ObjectDataSourceView.cs
- MappingModelBuildProvider.cs
- DoubleAnimation.cs
- ConnectionConsumerAttribute.cs
- COM2ColorConverter.cs
- Calendar.cs
- ADRoleFactory.cs
- ProvidePropertyAttribute.cs
- BufferAllocator.cs
- FixedPageStructure.cs
- StringReader.cs
- CommandField.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- SqlBulkCopyColumnMapping.cs
- XmlHelper.cs
- HttpCacheVary.cs
- IdentityModelStringsVersion1.cs
- FixedSOMLineRanges.cs
- ErrorHandler.cs
- ToolStripContentPanelRenderEventArgs.cs
- SynchronizedDispatch.cs
- TreeNode.cs
- SQLBytesStorage.cs
- TargetControlTypeAttribute.cs
- CfgSemanticTag.cs
- EdmProviderManifest.cs
- SimpleType.cs
- ClientConvert.cs
- OledbConnectionStringbuilder.cs
- EntityTemplateFactory.cs
- MexBindingBindingCollectionElement.cs
- ConnectionPoolManager.cs
- FileUpload.cs
- LabelLiteral.cs
- CodeArrayCreateExpression.cs
- RtfNavigator.cs
- XamlRtfConverter.cs
- DeferredReference.cs
- X509PeerCertificateAuthenticationElement.cs
- DrawingServices.cs
- InputDevice.cs
- ParameterCollection.cs
- CodePageEncoding.cs
- CurrentChangingEventArgs.cs
- PromptBuilder.cs
- X509Certificate2Collection.cs
- XpsTokenContext.cs
- SingleStorage.cs
- EntityStoreSchemaGenerator.cs
- WindowsListViewScroll.cs
- safesecurityhelperavalon.cs
- XmlNodeReader.cs
- Vector3DKeyFrameCollection.cs
- AccessDataSourceView.cs
- StorageEntityContainerMapping.cs
- NegotiationTokenProvider.cs
- ExpressionBindingCollection.cs
- InvalidPropValue.cs
- DesignerTransaction.cs
- ReceiveSecurityHeader.cs
- CachedResourceDictionaryExtension.cs
- LingerOption.cs
- TableLayout.cs
- RadioButtonPopupAdapter.cs
- ParallelTimeline.cs