Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / AttributeQuery.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CollectionType.cs
- DataPager.cs
- RelativeSource.cs
- HtmlElementErrorEventArgs.cs
- RSAPKCS1KeyExchangeFormatter.cs
- WebRequestModuleElement.cs
- SuppressMessageAttribute.cs
- Cell.cs
- jithelpers.cs
- InputBinder.cs
- DataGridPageChangedEventArgs.cs
- MsmqChannelFactory.cs
- AdapterDictionary.cs
- FileSecurity.cs
- RequestResponse.cs
- NotSupportedException.cs
- ViewStateModeByIdAttribute.cs
- ValidatorCollection.cs
- SmiEventSink_Default.cs
- FileSystemInfo.cs
- StronglyTypedResourceBuilder.cs
- DecodeHelper.cs
- CancellationTokenRegistration.cs
- CodeCastExpression.cs
- XmlEntity.cs
- DataGridTablesFactory.cs
- SourceFileInfo.cs
- ReturnEventArgs.cs
- oledbmetadatacolumnnames.cs
- UriExt.cs
- Msec.cs
- ReachDocumentSequenceSerializerAsync.cs
- Knowncolors.cs
- UndoManager.cs
- ListSourceHelper.cs
- CaseInsensitiveComparer.cs
- FacetChecker.cs
- IResourceProvider.cs
- EnvironmentPermission.cs
- AssertFilter.cs
- CompositionAdorner.cs
- ListDictionaryInternal.cs
- ProjectionAnalyzer.cs
- FastEncoder.cs
- PrintPageEvent.cs
- BaseCollection.cs
- WindowsNonControl.cs
- TypeHelpers.cs
- translator.cs
- TypeConverterAttribute.cs
- DesignSurface.cs
- ThemeConfigurationDialog.cs
- CacheModeConverter.cs
- DictionaryBase.cs
- StaticFileHandler.cs
- UIElement3D.cs
- NumericPagerField.cs
- TemplateInstanceAttribute.cs
- EllipseGeometry.cs
- Perspective.cs
- PrintController.cs
- IntegerValidator.cs
- _DynamicWinsockMethods.cs
- LinkLabel.cs
- Inflater.cs
- DataColumnMappingCollection.cs
- DynamicRendererThreadManager.cs
- SystemColors.cs
- RenderingEventArgs.cs
- Serializer.cs
- DebugManager.cs
- ThumbAutomationPeer.cs
- ByValueEqualityComparer.cs
- PriorityItem.cs
- BasePropertyDescriptor.cs
- AssemblyCache.cs
- ViewStateModeByIdAttribute.cs
- DrawingState.cs
- ScriptModule.cs
- TextEmbeddedObject.cs
- AutoFocusStyle.xaml.cs
- StringFormat.cs
- TreeNode.cs
- IssuerInformation.cs
- SimpleHandlerFactory.cs
- CacheEntry.cs
- ApplicationServiceManager.cs
- GroupBox.cs
- SchemaMerger.cs
- TabControlDesigner.cs
- IdnElement.cs
- InvalidAsynchronousStateException.cs
- GlyphShapingProperties.cs
- AppModelKnownContentFactory.cs
- WebControlsSection.cs
- Restrictions.cs
- InvalidComObjectException.cs
- SelectedGridItemChangedEvent.cs
- RadioButtonBaseAdapter.cs
- BinaryMessageFormatter.cs