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
- ConnectionManagementElementCollection.cs
- BindingBase.cs
- AngleUtil.cs
- XmlSchemaValidationException.cs
- NotifyParentPropertyAttribute.cs
- BitStream.cs
- ClaimTypeRequirement.cs
- DeobfuscatingStream.cs
- TemplateLookupAction.cs
- VisualStyleElement.cs
- TextBlockAutomationPeer.cs
- StrokeSerializer.cs
- InternalBufferOverflowException.cs
- ProcessHostConfigUtils.cs
- FixedTextContainer.cs
- HtmlToClrEventProxy.cs
- Types.cs
- XamlTreeBuilderBamlRecordWriter.cs
- BindableTemplateBuilder.cs
- EventRoute.cs
- QilTypeChecker.cs
- PlatformCulture.cs
- DeploymentSectionCache.cs
- FacetValues.cs
- EncoderBestFitFallback.cs
- TheQuery.cs
- ListControl.cs
- RequestCacheValidator.cs
- SQLBinary.cs
- MethodBuilder.cs
- ThreadExceptionDialog.cs
- CommandBindingCollection.cs
- PasswordPropertyTextAttribute.cs
- SmtpClient.cs
- SkipStoryboardToFill.cs
- SByteConverter.cs
- ListControl.cs
- ValueExpressions.cs
- QueryResultOp.cs
- ExpandSegmentCollection.cs
- QuaternionIndependentAnimationStorage.cs
- DataGridColumnsPage.cs
- DataGridLength.cs
- PropertyInfo.cs
- EventBuilder.cs
- Timer.cs
- SqlTypeConverter.cs
- FilteredDataSetHelper.cs
- MenuCommand.cs
- RemoteWebConfigurationHost.cs
- Ticks.cs
- UnhandledExceptionEventArgs.cs
- InheritanceContextHelper.cs
- Command.cs
- XmlSerializerSection.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- RuleInfoComparer.cs
- ImmutableObjectAttribute.cs
- ListViewDesigner.cs
- KeyManager.cs
- RelativeSource.cs
- DescendantBaseQuery.cs
- WaitHandleCannotBeOpenedException.cs
- RangeBase.cs
- ElementInit.cs
- NamedServiceModelExtensionCollectionElement.cs
- AudioDeviceOut.cs
- Convert.cs
- Mappings.cs
- RoleManagerEventArgs.cs
- InputLanguageSource.cs
- ColorConverter.cs
- XamlSerializerUtil.cs
- TraceXPathNavigator.cs
- ProviderConnectionPoint.cs
- StartUpEventArgs.cs
- RecordConverter.cs
- DetailsViewUpdateEventArgs.cs
- XmlSchemaSimpleContentRestriction.cs
- QueryOutputWriter.cs
- StorageMappingFragment.cs
- XmlLanguage.cs
- SerializationHelper.cs
- XmlSchemaAttribute.cs
- NetMsmqBindingElement.cs
- ImageSourceConverter.cs
- CachedPathData.cs
- PerspectiveCamera.cs
- RuntimeConfig.cs
- XamlTemplateSerializer.cs
- ParameterEditorUserControl.cs
- SectionVisual.cs
- PropertyCollection.cs
- WindowsIPAddress.cs
- PassportAuthenticationModule.cs
- EventSourceCreationData.cs
- InstanceData.cs
- DesignTimeParseData.cs
- FolderBrowserDialog.cs
- PersistencePipeline.cs