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
- SortKey.cs
- ByteStreamBufferedMessageData.cs
- ProfileModule.cs
- PathGradientBrush.cs
- _AcceptOverlappedAsyncResult.cs
- LongSumAggregationOperator.cs
- CompilerInfo.cs
- RemotingAttributes.cs
- DataGridCellItemAutomationPeer.cs
- _IPv6Address.cs
- _FtpDataStream.cs
- TemplateBaseAction.cs
- SecurityKeyIdentifierClause.cs
- ToolStripItem.cs
- PropertyToken.cs
- Profiler.cs
- FindRequestContext.cs
- IdentityManager.cs
- XmlTextAttribute.cs
- SafeHGlobalHandleCritical.cs
- SyndicationCategory.cs
- MailWebEventProvider.cs
- LoginCancelEventArgs.cs
- NetCodeGroup.cs
- SQLMoneyStorage.cs
- GeneralTransformCollection.cs
- QuinticEase.cs
- ControlCachePolicy.cs
- EntityCommandDefinition.cs
- XmlQuerySequence.cs
- OptimisticConcurrencyException.cs
- DesignerActionVerbItem.cs
- StopStoryboard.cs
- TimeSpanMinutesConverter.cs
- SqlDataSourceFilteringEventArgs.cs
- CodeAttributeArgumentCollection.cs
- DispatcherHooks.cs
- OdbcDataReader.cs
- ElementInit.cs
- Button.cs
- DesignerCapabilities.cs
- DataRowCollection.cs
- RoleGroupCollection.cs
- RegisteredExpandoAttribute.cs
- ToolTipAutomationPeer.cs
- ControlOperationInvoker.cs
- Publisher.cs
- Menu.cs
- Crc32.cs
- SafeThemeHandle.cs
- _HeaderInfo.cs
- Scalars.cs
- StrokeDescriptor.cs
- DataGridViewCell.cs
- LinqDataSourceHelper.cs
- GeometryConverter.cs
- Expr.cs
- SerialErrors.cs
- ScrollChrome.cs
- InvalidComObjectException.cs
- TableLayoutColumnStyleCollection.cs
- XmlWrappingReader.cs
- CommonProperties.cs
- AsyncPostBackTrigger.cs
- DataGridItemCollection.cs
- TreeWalker.cs
- SimpleType.cs
- ProtocolViolationException.cs
- ContainsSearchOperator.cs
- ExtensibleClassFactory.cs
- RoutedUICommand.cs
- XmlWriterSettings.cs
- UInt64Converter.cs
- ChannelSinkStacks.cs
- MissingSatelliteAssemblyException.cs
- TextParaClient.cs
- CodeGotoStatement.cs
- IISUnsafeMethods.cs
- RSACryptoServiceProvider.cs
- WebPartPersonalization.cs
- RegexInterpreter.cs
- BasicHttpBindingCollectionElement.cs
- BitmapEffectInput.cs
- ImageAttributes.cs
- KoreanLunisolarCalendar.cs
- ApplicationSecurityInfo.cs
- XMLUtil.cs
- DbConnectionPoolCounters.cs
- SelectionPatternIdentifiers.cs
- DateBoldEvent.cs
- WebPartConnectionsCancelVerb.cs
- AspCompat.cs
- OpenFileDialog.cs
- TextServicesLoader.cs
- FixedSOMLineCollection.cs
- EditorPartChrome.cs
- Socket.cs
- CollectionViewGroupRoot.cs
- LogSwitch.cs
- Freezable.cs