Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- TreeViewDesigner.cs
- PartialCachingAttribute.cs
- DefaultEventAttribute.cs
- X509ChainPolicy.cs
- NameValueSectionHandler.cs
- SQLGuid.cs
- ContextBase.cs
- securitymgrsite.cs
- ImageAttributes.cs
- VarRemapper.cs
- HitTestDrawingContextWalker.cs
- InputChannel.cs
- CryptographicAttribute.cs
- ProgressBar.cs
- Logging.cs
- Empty.cs
- NameValueSectionHandler.cs
- UnsafeNativeMethods.cs
- Number.cs
- ReverseInheritProperty.cs
- CellTreeNode.cs
- BitmapEffect.cs
- ConfigurationCollectionAttribute.cs
- Int32Storage.cs
- WindowsSecurityToken.cs
- QueryContinueDragEvent.cs
- DbMetaDataFactory.cs
- WebPartConnectionCollection.cs
- EntityDataSourceColumn.cs
- ConsumerConnectionPoint.cs
- AdvancedBindingPropertyDescriptor.cs
- UndoUnit.cs
- HwndStylusInputProvider.cs
- OdbcUtils.cs
- ComponentCommands.cs
- PropertyValue.cs
- SamlDelegatingWriter.cs
- EntityDataSourceColumn.cs
- QuadraticBezierSegment.cs
- GenericAuthenticationEventArgs.cs
- ChannelTokenTypeConverter.cs
- MethodCallConverter.cs
- GeneralTransform2DTo3D.cs
- PerformanceCounterManager.cs
- TableStyle.cs
- WpfSharedXamlSchemaContext.cs
- HttpVersion.cs
- RowVisual.cs
- TextBox.cs
- SqlComparer.cs
- DataStreams.cs
- TextElementEnumerator.cs
- CompressionTransform.cs
- FastEncoderWindow.cs
- FlowDocumentScrollViewer.cs
- OpacityConverter.cs
- TextEditorCharacters.cs
- StylusCollection.cs
- GridLengthConverter.cs
- BaseDataBoundControl.cs
- SyndicationFeed.cs
- BufferedWebEventProvider.cs
- SetterBaseCollection.cs
- CompositionDesigner.cs
- Tile.cs
- ResourceDescriptionAttribute.cs
- DocumentsTrace.cs
- TextEditorSpelling.cs
- XamlSerializerUtil.cs
- SplineKeyFrames.cs
- SerializationHelper.cs
- EventMetadata.cs
- DynamicDataRoute.cs
- List.cs
- CompressStream.cs
- XmlSchemaGroup.cs
- ImageField.cs
- DataSvcMapFile.cs
- VisualBrush.cs
- MaterialCollection.cs
- AdministrationHelpers.cs
- XmlDataImplementation.cs
- RayHitTestParameters.cs
- FlowDecisionDesigner.xaml.cs
- FixedNode.cs
- ReadOnlyPropertyMetadata.cs
- StreamWriter.cs
- Token.cs
- AnalyzedTree.cs
- CompressionTransform.cs
- MsmqInputChannelBase.cs
- CompositeActivityTypeDescriptor.cs
- DelegatedStream.cs
- DataChangedEventManager.cs
- ISAPIApplicationHost.cs
- AppSettings.cs
- PointCollection.cs
- EntityContainerEntitySetDefiningQuery.cs
- PartialTrustValidationBehavior.cs
- SerializationSectionGroup.cs