Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- SessionStateUtil.cs
- TemplateXamlParser.cs
- CounterCreationDataCollection.cs
- BitmapEffectDrawingContextWalker.cs
- DelimitedListTraceListener.cs
- HttpContext.cs
- ScriptReferenceEventArgs.cs
- DoubleCollection.cs
- IntSecurity.cs
- Dynamic.cs
- PhysicalOps.cs
- MaskedTextBox.cs
- PrintDialog.cs
- PromptEventArgs.cs
- UndoEngine.cs
- CollectionViewGroupInternal.cs
- DataConnectionHelper.cs
- TimeSpan.cs
- WebRequestModulesSection.cs
- HttpException.cs
- InternalEnumValidatorAttribute.cs
- Opcode.cs
- ButtonFlatAdapter.cs
- RowToParametersTransformer.cs
- DataGridCellClipboardEventArgs.cs
- InkPresenter.cs
- SafeFileMappingHandle.cs
- TextElementEnumerator.cs
- DataControlField.cs
- PinnedBufferMemoryStream.cs
- MetafileHeaderWmf.cs
- ReadOnlyCollectionBase.cs
- NullableDoubleSumAggregationOperator.cs
- Vector3D.cs
- DetailsViewPageEventArgs.cs
- RtfControls.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- Model3DCollection.cs
- MediaTimeline.cs
- PropertyCondition.cs
- TransactionScopeDesigner.cs
- UseLicense.cs
- Emitter.cs
- FormatterServices.cs
- ControlValuePropertyAttribute.cs
- UniqueConstraint.cs
- DataGridCell.cs
- ToolStripDropDownClosingEventArgs.cs
- XmlSerializerOperationFormatter.cs
- XPathArrayIterator.cs
- DrawingCollection.cs
- ListViewUpdatedEventArgs.cs
- PathHelper.cs
- ClientTargetCollection.cs
- ApplicationServicesHostFactory.cs
- ToolStripSeparatorRenderEventArgs.cs
- SpellerStatusTable.cs
- SqlColumnizer.cs
- ThaiBuddhistCalendar.cs
- TrackingLocation.cs
- ProcessModule.cs
- ExtensionQuery.cs
- QilChoice.cs
- SHA512Managed.cs
- OleDbParameter.cs
- AutoCompleteStringCollection.cs
- FileLogRecordHeader.cs
- activationcontext.cs
- WindowsFont.cs
- BrowsableAttribute.cs
- ToolStripPanelCell.cs
- BuildProviderAppliesToAttribute.cs
- SqlTrackingQuery.cs
- RtType.cs
- ConfigurationPropertyCollection.cs
- CounterCreationData.cs
- CodeGenerator.cs
- HttpHeaderCollection.cs
- TypeToArgumentTypeConverter.cs
- WebServiceFault.cs
- OdbcError.cs
- RenderData.cs
- EncodingTable.cs
- DbException.cs
- _FixedSizeReader.cs
- InlineCategoriesDocument.cs
- DBNull.cs
- PathGradientBrush.cs
- SqlVisitor.cs
- JulianCalendar.cs
- MetaModel.cs
- OAVariantLib.cs
- PerfCounters.cs
- InputBuffer.cs
- TypeConstant.cs
- SqlCacheDependency.cs
- Assembly.cs
- TraceListeners.cs
- TypeSystemHelpers.cs