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
- Utils.cs
- XmlDataSourceDesigner.cs
- Journaling.cs
- SqlRowUpdatingEvent.cs
- ResolveNextArgumentWorkItem.cs
- DataObjectEventArgs.cs
- MeasurementDCInfo.cs
- BasicCellRelation.cs
- OrderedEnumerableRowCollection.cs
- ComplexBindingPropertiesAttribute.cs
- EditorPart.cs
- SrgsNameValueTag.cs
- TraceData.cs
- GuidConverter.cs
- VariantWrapper.cs
- MenuItem.cs
- BaseDataBoundControlDesigner.cs
- PermissionRequestEvidence.cs
- ControlBindingsCollection.cs
- LayoutEngine.cs
- VirtualPathUtility.cs
- RelationshipDetailsCollection.cs
- PtsContext.cs
- ClientBuildManager.cs
- SchemaCollectionPreprocessor.cs
- CommonDialog.cs
- ScriptResourceAttribute.cs
- Guid.cs
- Expressions.cs
- XamlRtfConverter.cs
- DataGridPageChangedEventArgs.cs
- OledbConnectionStringbuilder.cs
- PrimitiveXmlSerializers.cs
- RegexTree.cs
- HighlightVisual.cs
- TimersDescriptionAttribute.cs
- ClientConvert.cs
- FlagsAttribute.cs
- UnsafeNativeMethodsCLR.cs
- InternalPermissions.cs
- TableCellCollection.cs
- ProfileManager.cs
- BmpBitmapEncoder.cs
- JsonWriterDelegator.cs
- DefaultWorkflowSchedulerService.cs
- ConfigurationValue.cs
- SubMenuStyle.cs
- ToolStripArrowRenderEventArgs.cs
- XmlFormatReaderGenerator.cs
- FontFamily.cs
- TableAdapterManagerGenerator.cs
- ApplicationSecurityManager.cs
- HelpProvider.cs
- InvokeMethod.cs
- VectorAnimationBase.cs
- DtdParser.cs
- DesignerActionItemCollection.cs
- SqlDataSource.cs
- XmlIlTypeHelper.cs
- MessageSecurityTokenVersion.cs
- ResourcePermissionBase.cs
- Operators.cs
- InstanceDescriptor.cs
- ServiceHostingEnvironmentSection.cs
- DataTableClearEvent.cs
- FixedStringLookup.cs
- XmlNodeList.cs
- MediaScriptCommandRoutedEventArgs.cs
- NativeMethods.cs
- PackagePartCollection.cs
- Hashtable.cs
- Transform.cs
- ConsumerConnectionPoint.cs
- SqlPersonalizationProvider.cs
- DataGridViewDesigner.cs
- SurrogateSelector.cs
- ViewStateException.cs
- FloaterBaseParagraph.cs
- AudioFormatConverter.cs
- ArcSegment.cs
- ToolStripRenderEventArgs.cs
- SqlTypeSystemProvider.cs
- WindowsSolidBrush.cs
- Parameter.cs
- assemblycache.cs
- Underline.cs
- SqlNodeTypeOperators.cs
- HtmlFormAdapter.cs
- GenericPrincipal.cs
- CallTemplateAction.cs
- ErrorLog.cs
- GenerateScriptTypeAttribute.cs
- IntSecurity.cs
- RawStylusInputReport.cs
- RegexCapture.cs
- GridItemPattern.cs
- StreamWithDictionary.cs
- CollaborationHelperFunctions.cs
- TraceXPathNavigator.cs
- TrackingMemoryStream.cs