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
- ExtendedTransformFactory.cs
- RunInstallerAttribute.cs
- RepeatBehaviorConverter.cs
- XamlHostingConfiguration.cs
- ReceiveSecurityHeaderEntry.cs
- Point3DValueSerializer.cs
- WmpBitmapDecoder.cs
- PriorityChain.cs
- PhonemeEventArgs.cs
- OleDbWrapper.cs
- DrawTreeNodeEventArgs.cs
- JsonClassDataContract.cs
- InputScopeConverter.cs
- ScriptIgnoreAttribute.cs
- NameValueConfigurationCollection.cs
- HierarchicalDataBoundControl.cs
- KeyConstraint.cs
- Native.cs
- EventHandlerList.cs
- Timer.cs
- PointUtil.cs
- ItemList.cs
- WebPartExportVerb.cs
- ArglessEventHandlerProxy.cs
- DropDownList.cs
- InheritablePropertyChangeInfo.cs
- AccessDataSource.cs
- GenericWebPart.cs
- PermissionSet.cs
- Cursors.cs
- WebPartPersonalization.cs
- UnescapedXmlDiagnosticData.cs
- WebPartConnectionsConfigureVerb.cs
- xmlsaver.cs
- TimeBoundedCache.cs
- XmlSchemaParticle.cs
- ReadOnlyCollectionBase.cs
- DataPagerFieldCommandEventArgs.cs
- MetadataUtilsSmi.cs
- ProtocolReflector.cs
- KnownColorTable.cs
- UnmanagedMemoryStream.cs
- DetailsViewUpdateEventArgs.cs
- UnsafeNativeMethodsPenimc.cs
- AccessibleObject.cs
- HandoffBehavior.cs
- PhonemeConverter.cs
- XmlTextWriter.cs
- WebPartAuthorizationEventArgs.cs
- DocComment.cs
- OdbcParameterCollection.cs
- ExpressionBindingCollection.cs
- LabelDesigner.cs
- GrabHandleGlyph.cs
- ImageCodecInfo.cs
- StylusLogic.cs
- DesignerActionListCollection.cs
- DrawingCollection.cs
- DataObjectPastingEventArgs.cs
- MetricEntry.cs
- SystemTcpConnection.cs
- PerformanceCounterManager.cs
- InternalConfigRoot.cs
- ToolStripItemImageRenderEventArgs.cs
- ClientConfigurationHost.cs
- ScriptReferenceBase.cs
- HttpSysSettings.cs
- AsymmetricSignatureDeformatter.cs
- WebEvents.cs
- SQLInt32Storage.cs
- RadioButton.cs
- FrameworkObject.cs
- ACL.cs
- QueueProcessor.cs
- versioninfo.cs
- CodeBlockBuilder.cs
- ActivityCodeGenerator.cs
- ItemCollection.cs
- ProtectedProviderSettings.cs
- CodeCatchClause.cs
- DeclarativeCatalogPart.cs
- LinqDataSourceView.cs
- FileEnumerator.cs
- KeyValuePair.cs
- FeatureSupport.cs
- MasterPageParser.cs
- ProxyElement.cs
- _AutoWebProxyScriptHelper.cs
- TypefaceMetricsCache.cs
- querybuilder.cs
- VisualBrush.cs
- SignatureTargetIdManager.cs
- XmlSchemaExternal.cs
- HebrewCalendar.cs
- HttpApplicationStateBase.cs
- PeerApplication.cs
- BitStack.cs
- ScalarConstant.cs
- EncodingNLS.cs
- BitmapEffectDrawing.cs