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
- EntityReference.cs
- DbException.cs
- ComboBoxRenderer.cs
- RuntimeConfigurationRecord.cs
- UserControlAutomationPeer.cs
- PointF.cs
- CqlLexerHelpers.cs
- COM2ExtendedUITypeEditor.cs
- WebEventCodes.cs
- RuntimeConfigurationRecord.cs
- InfoCardTrace.cs
- AutomationPatternInfo.cs
- ResolveMatches11.cs
- ContextMenuStrip.cs
- DesignerAttribute.cs
- TdsParserSessionPool.cs
- MetafileHeaderEmf.cs
- RegexMatch.cs
- TogglePattern.cs
- BaseEntityWrapper.cs
- ObjectDataSourceStatusEventArgs.cs
- Parameter.cs
- DoubleAnimationClockResource.cs
- DirectionalLight.cs
- XmlnsPrefixAttribute.cs
- QuaternionValueSerializer.cs
- Automation.cs
- QueryContinueDragEventArgs.cs
- DeviceContexts.cs
- RegexInterpreter.cs
- EllipticalNodeOperations.cs
- IMembershipProvider.cs
- NewArray.cs
- DataTableExtensions.cs
- ModelUIElement3D.cs
- CaseExpr.cs
- PromptEventArgs.cs
- InputGestureCollection.cs
- safesecurityhelperavalon.cs
- XmlSchemaValidationException.cs
- SizeChangedInfo.cs
- DelayedRegex.cs
- CodeEntryPointMethod.cs
- DWriteFactory.cs
- Merger.cs
- XmlDictionaryWriter.cs
- TextOnlyOutput.cs
- SafeSystemMetrics.cs
- PageTheme.cs
- ConnectivityStatus.cs
- XslTransform.cs
- TextTreeText.cs
- EditCommandColumn.cs
- AtomServiceDocumentSerializer.cs
- ProgressBarBrushConverter.cs
- FamilyTypefaceCollection.cs
- isolationinterop.cs
- ToolBarButtonDesigner.cs
- Lazy.cs
- CoTaskMemHandle.cs
- CustomValidator.cs
- smtpconnection.cs
- FunctionDescription.cs
- DockProviderWrapper.cs
- Quaternion.cs
- TaiwanLunisolarCalendar.cs
- AutoGeneratedField.cs
- ComponentChangingEvent.cs
- ToolboxItemAttribute.cs
- DataErrorValidationRule.cs
- NamedObjectList.cs
- ContentElement.cs
- DesignerView.xaml.cs
- CodeRemoveEventStatement.cs
- ManagedFilter.cs
- SecurityRuntime.cs
- BlockUIContainer.cs
- FileDialog_Vista_Interop.cs
- DynamicRenderer.cs
- Model3DCollection.cs
- WebPartConnectionsConfigureVerb.cs
- JoinGraph.cs
- TextBoxBase.cs
- SiteMapSection.cs
- StrongNameUtility.cs
- Section.cs
- RightsManagementEncryptedStream.cs
- PageContentAsyncResult.cs
- IncrementalReadDecoders.cs
- GetKeyedHashRequest.cs
- XPathNodeInfoAtom.cs
- RegexRunner.cs
- CompareInfo.cs
- TextBlock.cs
- CommonObjectSecurity.cs
- VBIdentifierDesigner.xaml.cs
- SizeIndependentAnimationStorage.cs
- ZoomingMessageFilter.cs
- ComponentEvent.cs
- DynamicDataRouteHandler.cs