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
- CompoundFileStorageReference.cs
- ImageList.cs
- DockAndAnchorLayout.cs
- ThreadAttributes.cs
- SqlDuplicator.cs
- ActivityBuilderXamlWriter.cs
- GridView.cs
- UnsafeNativeMethods.cs
- CodeCatchClauseCollection.cs
- WebProxyScriptElement.cs
- InstallerTypeAttribute.cs
- ScrollEvent.cs
- GcHandle.cs
- IntegerValidator.cs
- WbemException.cs
- EntityDataSourceDesigner.cs
- ToolStripSplitStackLayout.cs
- ClaimTypeElementCollection.cs
- SQLInt32.cs
- SqlDependency.cs
- ScriptHandlerFactory.cs
- AdvancedBindingPropertyDescriptor.cs
- TypeLibConverter.cs
- DocumentSequence.cs
- Wizard.cs
- AlternateViewCollection.cs
- DayRenderEvent.cs
- BufferedReadStream.cs
- DataServiceResponse.cs
- WebPartConnectionsConfigureVerb.cs
- PagePropertiesChangingEventArgs.cs
- _TimerThread.cs
- DataSourceDesigner.cs
- WorkflowDesignerColors.cs
- SpeechRecognizer.cs
- SelectedCellsCollection.cs
- GrammarBuilderBase.cs
- WindowsHyperlink.cs
- Content.cs
- DispatchWrapper.cs
- LiteralControl.cs
- TextOnlyOutput.cs
- Line.cs
- ReadOnlyTernaryTree.cs
- SettingsProperty.cs
- ErrorInfoXmlDocument.cs
- ConnectionInterfaceCollection.cs
- InvokePattern.cs
- FontFaceLayoutInfo.cs
- DataMisalignedException.cs
- XmlWellformedWriter.cs
- ToolZoneDesigner.cs
- SapiAttributeParser.cs
- SharedPerformanceCounter.cs
- XmlSerializer.cs
- BuilderPropertyEntry.cs
- AdornerDecorator.cs
- RtfToken.cs
- WebPartCatalogCloseVerb.cs
- DynamicQueryableWrapper.cs
- __Error.cs
- OleDbSchemaGuid.cs
- EntityModelSchemaGenerator.cs
- XhtmlBasicCalendarAdapter.cs
- WebScriptServiceHostFactory.cs
- UseLicense.cs
- DrawingState.cs
- CharacterMetricsDictionary.cs
- FastPropertyAccessor.cs
- GridViewCancelEditEventArgs.cs
- EmptyReadOnlyDictionaryInternal.cs
- XPathNode.cs
- ReplyChannelBinder.cs
- OperationCanceledException.cs
- PerformanceCounterCategory.cs
- XmlKeywords.cs
- InlineCollection.cs
- HttpWebRequestElement.cs
- TreeBuilderXamlTranslator.cs
- keycontainerpermission.cs
- CatalogPart.cs
- RestHandler.cs
- NativeObjectSecurity.cs
- NamedPipeAppDomainProtocolHandler.cs
- GatewayDefinition.cs
- COM2PictureConverter.cs
- TreeBuilderBamlTranslator.cs
- CommonDialog.cs
- Geometry3D.cs
- EndpointInfo.cs
- WebPartHelpVerb.cs
- XmlDataSourceNodeDescriptor.cs
- OracleParameterBinding.cs
- InlineObject.cs
- SystemInfo.cs
- Parsers.cs
- EntityStoreSchemaFilterEntry.cs
- EncodingDataItem.cs
- PartialList.cs
- FontEditor.cs