Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AsynchronousChannelMergeEnumerator.cs
- SmtpAuthenticationManager.cs
- DataListCommandEventArgs.cs
- IndexedString.cs
- TypeReference.cs
- StatusBar.cs
- COM2Properties.cs
- WinEventHandler.cs
- CompoundFileIOPermission.cs
- NonClientArea.cs
- SystemResources.cs
- ReadOnlyHierarchicalDataSource.cs
- DbParameterHelper.cs
- BitmapCache.cs
- QilStrConcat.cs
- Random.cs
- RedirectionProxy.cs
- ReaderWriterLockWrapper.cs
- ReceiveActivityValidator.cs
- DrawingContext.cs
- PartialArray.cs
- HttpServerVarsCollection.cs
- TargetPerspective.cs
- SupportingTokenChannel.cs
- AlternationConverter.cs
- SqlGenericUtil.cs
- TargetException.cs
- AsyncPostBackErrorEventArgs.cs
- RawStylusActions.cs
- UnionQueryOperator.cs
- StrokeCollectionConverter.cs
- DataKeyCollection.cs
- DropShadowBitmapEffect.cs
- TextTreeUndoUnit.cs
- DataFormat.cs
- BindingGroup.cs
- EnumerableValidator.cs
- _LocalDataStore.cs
- Cursor.cs
- InputLanguageProfileNotifySink.cs
- Cursors.cs
- EmissiveMaterial.cs
- DotAtomReader.cs
- NetworkAddressChange.cs
- IdleTimeoutMonitor.cs
- HttpWebRequest.cs
- TimeSpanFormat.cs
- GridView.cs
- BrushMappingModeValidation.cs
- PointF.cs
- ObjectContextServiceProvider.cs
- CriticalHandle.cs
- QilFactory.cs
- ResXBuildProvider.cs
- HotCommands.cs
- StringValueSerializer.cs
- PartialTrustVisibleAssemblyCollection.cs
- PreparingEnlistment.cs
- ContainerFilterService.cs
- WmlImageAdapter.cs
- BufferAllocator.cs
- BufferedGraphics.cs
- StringArrayConverter.cs
- BinaryObjectWriter.cs
- FunctionDefinition.cs
- DrawingBrush.cs
- NoPersistScope.cs
- DynamicExpression.cs
- ComponentCollection.cs
- MessageAction.cs
- Double.cs
- DetailsViewPageEventArgs.cs
- EntityTypeEmitter.cs
- ModelItemKeyValuePair.cs
- InfoCardSymmetricAlgorithm.cs
- securitycriticaldataClass.cs
- Expr.cs
- CallbackCorrelationInitializer.cs
- TableLayoutPanelBehavior.cs
- SmiContext.cs
- LocatorManager.cs
- IDReferencePropertyAttribute.cs
- WebPartCatalogAddVerb.cs
- ProgressChangedEventArgs.cs
- InheritablePropertyChangeInfo.cs
- DataSet.cs
- RegisteredScript.cs
- SQLRoleProvider.cs
- SecurityTokenResolver.cs
- InfoCardSchemas.cs
- XmlSigningNodeWriter.cs
- BindingFormattingDialog.cs
- Fonts.cs
- ProxyAttribute.cs
- WindowsListViewScroll.cs
- CodeDirectiveCollection.cs
- DbDataAdapter.cs
- ItemsControlAutomationPeer.cs
- TraceContextRecord.cs
- SQLInt32Storage.cs