Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //----------------------------------------------------------------------------- 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
- documentsequencetextview.cs
- SrgsNameValueTag.cs
- EdgeModeValidation.cs
- NoneExcludedImageIndexConverter.cs
- SessionIDManager.cs
- BamlReader.cs
- SendActivityDesignerTheme.cs
- SmiConnection.cs
- CategoryAttribute.cs
- FloaterParaClient.cs
- CookielessHelper.cs
- GlobalizationAssembly.cs
- BooleanSwitch.cs
- DrawItemEvent.cs
- TargetControlTypeCache.cs
- MimeTypeAttribute.cs
- IndexObject.cs
- ActivityCodeDomReferenceService.cs
- TableHeaderCell.cs
- MemoryMappedView.cs
- UriExt.cs
- Visitors.cs
- PrinterResolution.cs
- ConnectionPoolManager.cs
- CodeLinePragma.cs
- BitmapMetadata.cs
- SmtpLoginAuthenticationModule.cs
- HttpDebugHandler.cs
- RowParagraph.cs
- ListControlActionList.cs
- AssemblyHash.cs
- QueryContinueDragEventArgs.cs
- SchemaElement.cs
- EndEvent.cs
- QueryContinueDragEvent.cs
- ErrorStyle.cs
- XmlJsonWriter.cs
- RadioButton.cs
- ParallelTimeline.cs
- WebPartVerbsEventArgs.cs
- mansign.cs
- RuntimeArgumentHandle.cs
- SoapIncludeAttribute.cs
- ConfigurationStrings.cs
- CodeStatementCollection.cs
- UiaCoreApi.cs
- IMembershipProvider.cs
- ColorTranslator.cs
- IndicCharClassifier.cs
- Package.cs
- DoubleAnimationUsingPath.cs
- ShapeTypeface.cs
- ReferencedCollectionType.cs
- RotationValidation.cs
- ColorInterpolationModeValidation.cs
- SamlDelegatingWriter.cs
- CommandExpr.cs
- ResolveResponse.cs
- EpmContentSerializer.cs
- RangeValuePattern.cs
- XsdBuilder.cs
- ParseNumbers.cs
- WeakHashtable.cs
- DoubleLink.cs
- HttpRequest.cs
- XmlUtilWriter.cs
- ExpandCollapsePatternIdentifiers.cs
- DependencyPropertyKind.cs
- DataGridViewCellParsingEventArgs.cs
- CurrencyWrapper.cs
- PropertyGeneratedEventArgs.cs
- XPathDescendantIterator.cs
- UpdateCompiler.cs
- PersonalizablePropertyEntry.cs
- ContainerFilterService.cs
- BamlTreeMap.cs
- SessionParameter.cs
- RightsManagementEncryptionTransform.cs
- ProfilePropertyMetadata.cs
- SoapFault.cs
- NullExtension.cs
- XNameTypeConverter.cs
- Separator.cs
- RadioButtonList.cs
- RequestQueryParser.cs
- StrokeCollectionConverter.cs
- _OverlappedAsyncResult.cs
- DesignOnlyAttribute.cs
- Vector3dCollection.cs
- SqlInternalConnectionSmi.cs
- XmlILModule.cs
- SnapLine.cs
- CodeIndexerExpression.cs
- RequestCachingSection.cs
- HtmlContainerControl.cs
- TypeInfo.cs
- DetailsViewModeEventArgs.cs
- StringSorter.cs
- RoleManagerModule.cs
- ImageSourceTypeConverter.cs