Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantBaseQuery.cs / 1 / DescendantBaseQuery.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; internal abstract class DescendantBaseQuery : BaseAxisQuery { protected bool matchSelf; protected bool abbrAxis; public DescendantBaseQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis) : base(qyParent, Name, Prefix, Type) { this.matchSelf = matchSelf; this.abbrAxis = abbrAxis; } public DescendantBaseQuery(DescendantBaseQuery other) : base(other) { this.matchSelf = other.matchSelf; this.abbrAxis = other.abbrAxis; } public override XPathNavigator MatchNode(XPathNavigator context) { if (context != null) { if (!abbrAxis) { throw XPathException.Create(Res.Xp_InvalidPattern); } XPathNavigator result = null; if (matches(context)) { if (matchSelf) { if ((result = qyInput.MatchNode(context)) != null) { return result; } } XPathNavigator anc = context.Clone(); while (anc.MoveToParent()) { if ((result = qyInput.MatchNode(anc)) != null) { return result; } } } } return null; } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); if (matchSelf) { w.WriteAttributeString("self", "yes"); } if (NameTest) { w.WriteAttributeString("name", Prefix.Length != 0 ? Prefix + ':' + Name : Name); } if (TypeTest != XPathNodeType.Element) { w.WriteAttributeString("nodeType", TypeTest.ToString()); } qyInput.PrintQuery(w); w.WriteEndElement(); } } } // 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
- XmlStreamStore.cs
- WinFormsUtils.cs
- IntegrationExceptionEventArgs.cs
- StringCollectionMarkupSerializer.cs
- LocalValueEnumerator.cs
- EnumValAlphaComparer.cs
- UnionExpr.cs
- TypeCodeDomSerializer.cs
- MappingMetadataHelper.cs
- KerberosSecurityTokenAuthenticator.cs
- GridViewSelectEventArgs.cs
- Win32.cs
- MenuItem.cs
- TreeNode.cs
- DeferrableContentConverter.cs
- RangeValidator.cs
- DefaultValueConverter.cs
- wgx_commands.cs
- UserUseLicenseDictionaryLoader.cs
- RegexGroup.cs
- DataGridViewCellStyleConverter.cs
- Crc32Helper.cs
- EntityDataSourceSelectingEventArgs.cs
- _LazyAsyncResult.cs
- SiteMapNodeItemEventArgs.cs
- _FtpDataStream.cs
- CombinedHttpChannel.cs
- HttpApplicationStateBase.cs
- OperationContextScope.cs
- Transform.cs
- WebPartCatalogCloseVerb.cs
- StoreContentChangedEventArgs.cs
- DiscardableAttribute.cs
- _NestedSingleAsyncResult.cs
- VBCodeProvider.cs
- SharedPersonalizationStateInfo.cs
- AggregationMinMaxHelpers.cs
- StyleTypedPropertyAttribute.cs
- CustomSignedXml.cs
- InsufficientMemoryException.cs
- CodeCatchClauseCollection.cs
- ReflectPropertyDescriptor.cs
- SoapSchemaExporter.cs
- CellParaClient.cs
- X509ServiceCertificateAuthentication.cs
- InvalidCastException.cs
- StringInfo.cs
- JapaneseLunisolarCalendar.cs
- _UriSyntax.cs
- SqlVisitor.cs
- WebUtil.cs
- QilSortKey.cs
- DocumentViewerConstants.cs
- BindingListCollectionView.cs
- Pointer.cs
- SafeRightsManagementHandle.cs
- QilChoice.cs
- ILGen.cs
- ButtonBaseAdapter.cs
- SqlCachedBuffer.cs
- ApplicationCommands.cs
- MimeParameter.cs
- ListViewDeletedEventArgs.cs
- PreProcessor.cs
- EdmEntityTypeAttribute.cs
- Component.cs
- GridViewCommandEventArgs.cs
- ObjectParameter.cs
- CacheEntry.cs
- SqlDataSourceFilteringEventArgs.cs
- FileUtil.cs
- DataGridPageChangedEventArgs.cs
- BuildResult.cs
- NamespaceExpr.cs
- PerformanceCountersElement.cs
- XmlSortKeyAccumulator.cs
- Size3D.cs
- HandledMouseEvent.cs
- Zone.cs
- GC.cs
- GeometryConverter.cs
- HostedHttpContext.cs
- WindowsServiceCredential.cs
- TrustSection.cs
- PointLightBase.cs
- TextEditorContextMenu.cs
- KerberosSecurityTokenProvider.cs
- RemotingAttributes.cs
- ShaderEffect.cs
- XmlTextReaderImplHelpers.cs
- ListControl.cs
- DataGridPagerStyle.cs
- WsdlParser.cs
- IPHostEntry.cs
- ImmutableCollection.cs
- ExpandSegmentCollection.cs
- ConnectionOrientedTransportElement.cs
- DbConnectionClosed.cs
- XmlLoader.cs
- OdbcConnectionFactory.cs