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
- UshortList2.cs
- HTMLTagNameToTypeMapper.cs
- Substitution.cs
- RuleSetCollection.cs
- BitmapEncoder.cs
- AgileSafeNativeMemoryHandle.cs
- SmiRequestExecutor.cs
- MatrixTransform.cs
- XmlChoiceIdentifierAttribute.cs
- TcpTransportSecurity.cs
- TextAnchor.cs
- RelatedView.cs
- XsltLoader.cs
- GiveFeedbackEventArgs.cs
- WmpBitmapDecoder.cs
- Exceptions.cs
- Tag.cs
- NullableDecimalAverageAggregationOperator.cs
- TemplateControlParser.cs
- DocumentViewerBaseAutomationPeer.cs
- RecognizerInfo.cs
- IntranetCredentialPolicy.cs
- Exceptions.cs
- LocationUpdates.cs
- RequestStatusBarUpdateEventArgs.cs
- SchemaDeclBase.cs
- MenuAdapter.cs
- RequestStatusBarUpdateEventArgs.cs
- SqlDataReader.cs
- FontEmbeddingManager.cs
- Rijndael.cs
- XmlWriter.cs
- PhysicalFontFamily.cs
- TransactionTraceIdentifier.cs
- RadioButtonList.cs
- JsonSerializer.cs
- WindowsListViewGroupHelper.cs
- FixedLineResult.cs
- NTAccount.cs
- _SingleItemRequestCache.cs
- CompositeActivityCodeGenerator.cs
- MarkupExtensionReturnTypeAttribute.cs
- X509Certificate2.cs
- COM2AboutBoxPropertyDescriptor.cs
- RelatedImageListAttribute.cs
- PeerNameResolver.cs
- ActivationArguments.cs
- HandleExceptionArgs.cs
- VirtualPathData.cs
- Transform.cs
- EventLog.cs
- TripleDESCryptoServiceProvider.cs
- BehaviorEditorPart.cs
- _IPv4Address.cs
- WindowsIdentity.cs
- IDQuery.cs
- RtfFormatStack.cs
- MimeAnyImporter.cs
- MarshalByRefObject.cs
- SamlSerializer.cs
- XamlTreeBuilder.cs
- TextEditorContextMenu.cs
- XmlTextReaderImplHelpers.cs
- DictationGrammar.cs
- PropertyFilterAttribute.cs
- XmlAggregates.cs
- ProtocolsConfigurationEntry.cs
- MapPathBasedVirtualPathProvider.cs
- DropShadowEffect.cs
- TypeDescriptionProviderAttribute.cs
- ConfigurationManager.cs
- TextDecorationLocationValidation.cs
- BindingsSection.cs
- DetailsViewPagerRow.cs
- Mappings.cs
- ModifierKeysValueSerializer.cs
- HtmlInputControl.cs
- GridViewColumnHeader.cs
- recordstate.cs
- XPathMessageFilter.cs
- WindowsGrip.cs
- ClientFormsAuthenticationCredentials.cs
- SqlXmlStorage.cs
- Soap12ProtocolReflector.cs
- Maps.cs
- Parameter.cs
- XmlAttributeOverrides.cs
- EntityDataSourceUtil.cs
- NumericUpDown.cs
- StreamSecurityUpgradeInitiatorBase.cs
- TextBounds.cs
- StringFunctions.cs
- ApplicationFileCodeDomTreeGenerator.cs
- VirtualPathUtility.cs
- BaseHashHelper.cs
- DelayedRegex.cs
- HiddenFieldPageStatePersister.cs
- ExtensionSimplifierMarkupObject.cs
- BasicViewGenerator.cs
- UserPreferenceChangedEventArgs.cs