Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- OleDbDataAdapter.cs
- GridViewRowPresenter.cs
- XslAst.cs
- DesignerSerializationOptionsAttribute.cs
- InvokePattern.cs
- Duration.cs
- UpdateRecord.cs
- StatusBarItem.cs
- FormConverter.cs
- QueryExtender.cs
- ToolStripRendererSwitcher.cs
- EpmContentDeSerializer.cs
- ControlPropertyNameConverter.cs
- exports.cs
- XslAst.cs
- AuthenticationSection.cs
- TextTreeTextElementNode.cs
- KeyPressEvent.cs
- AuthenticationService.cs
- XmlEncoding.cs
- DataColumnChangeEvent.cs
- IntegerValidator.cs
- DefaultValidator.cs
- ControlAdapter.cs
- SingleConverter.cs
- PartitionedDataSource.cs
- FixedTextSelectionProcessor.cs
- UriSection.cs
- SQLRoleProvider.cs
- ProfileSettingsCollection.cs
- ConstantExpression.cs
- TypeValidationEventArgs.cs
- UncommonField.cs
- WpfKnownType.cs
- SuppressMergeCheckAttribute.cs
- UnauthorizedAccessException.cs
- PropertyGridCommands.cs
- RightsManagementInformation.cs
- SimpleWebHandlerParser.cs
- IsolatedStorageFileStream.cs
- GridViewDeleteEventArgs.cs
- PackWebRequestFactory.cs
- WebFaultException.cs
- MetadataPropertyCollection.cs
- DesignerProperties.cs
- AliasedSlot.cs
- MenuItemStyle.cs
- PageStatePersister.cs
- ProxyAttribute.cs
- ToolStripPanelCell.cs
- ArcSegment.cs
- SQLInt32Storage.cs
- ToolStripItemTextRenderEventArgs.cs
- PointCollection.cs
- WebBrowserUriTypeConverter.cs
- SchemaImporterExtensionElementCollection.cs
- DataColumnSelectionConverter.cs
- HtmlInputReset.cs
- WebConvert.cs
- MultiDataTrigger.cs
- DeviceFilterDictionary.cs
- SQLStringStorage.cs
- Condition.cs
- UnsafePeerToPeerMethods.cs
- InputBinder.cs
- WeakReference.cs
- SatelliteContractVersionAttribute.cs
- XmlElementAttributes.cs
- StringFormat.cs
- DataGridViewCellStyleConverter.cs
- CodeLinePragma.cs
- DecimalConverter.cs
- XmlAttributeOverrides.cs
- SQLBoolean.cs
- ServicesUtilities.cs
- UIElementParagraph.cs
- ValidatedControlConverter.cs
- CodeTypeParameterCollection.cs
- CompilerError.cs
- RedistVersionInfo.cs
- XpsS0ValidatingLoader.cs
- RoutedEventHandlerInfo.cs
- OdbcConnection.cs
- DataGridCellAutomationPeer.cs
- InvalidCommandTreeException.cs
- WaitHandleCannotBeOpenedException.cs
- DocComment.cs
- QueryStringParameter.cs
- UInt16.cs
- StringValidatorAttribute.cs
- IfAction.cs
- WindowsTab.cs
- Predicate.cs
- ISAPIWorkerRequest.cs
- TypeDescriptionProvider.cs
- ProgressBarHighlightConverter.cs
- GenericsInstances.cs
- StagingAreaInputItem.cs
- EditorPart.cs
- MarkerProperties.cs