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
- TypedServiceOperationListItem.cs
- SamlAuthorizationDecisionStatement.cs
- SendMailErrorEventArgs.cs
- TriggerBase.cs
- DSASignatureFormatter.cs
- SHA512Managed.cs
- CapabilitiesSection.cs
- BasicViewGenerator.cs
- ResXBuildProvider.cs
- BitVec.cs
- NodeCounter.cs
- FilterQuery.cs
- PageCatalogPart.cs
- HttpApplicationFactory.cs
- XamlBrushSerializer.cs
- TemplateKeyConverter.cs
- FixedSOMLineRanges.cs
- FormViewDeletedEventArgs.cs
- RegexBoyerMoore.cs
- ContentIterators.cs
- DataPagerFieldCommandEventArgs.cs
- smtppermission.cs
- GrammarBuilderBase.cs
- Visitor.cs
- RoleServiceManager.cs
- _DomainName.cs
- MyContact.cs
- CounterCreationData.cs
- Vertex.cs
- SvcMapFileSerializer.cs
- TakeQueryOptionExpression.cs
- StartUpEventArgs.cs
- FileDialog.cs
- ZipIOExtraField.cs
- PeerEndPoint.cs
- IconConverter.cs
- DependencyPropertyKind.cs
- TypedTableHandler.cs
- XmlCustomFormatter.cs
- MailWriter.cs
- XmlSchemaComplexType.cs
- RegexCaptureCollection.cs
- UnsafeNativeMethods.cs
- SmtpNetworkElement.cs
- PrintDialog.cs
- MimePart.cs
- VideoDrawing.cs
- OuterGlowBitmapEffect.cs
- XhtmlBasicLinkAdapter.cs
- SubpageParagraph.cs
- PointKeyFrameCollection.cs
- ACL.cs
- SafeCryptContextHandle.cs
- UpdateTranslator.cs
- DataListComponentEditor.cs
- BinaryObjectWriter.cs
- EntitySqlQueryCacheEntry.cs
- FontNameEditor.cs
- BitmapCodecInfoInternal.cs
- TypeGeneratedEventArgs.cs
- DummyDataSource.cs
- XmlEncApr2001.cs
- CompositionDesigner.cs
- AccessKeyManager.cs
- WebPartDisplayModeEventArgs.cs
- XpsFilter.cs
- StartUpEventArgs.cs
- ParsedAttributeCollection.cs
- Token.cs
- EntityViewGenerator.cs
- Span.cs
- SizeConverter.cs
- DbModificationCommandTree.cs
- xsdvalidator.cs
- Propagator.ExtentPlaceholderCreator.cs
- BoolExpressionVisitors.cs
- RadioButtonStandardAdapter.cs
- Vector3DValueSerializer.cs
- Point3DKeyFrameCollection.cs
- Send.cs
- HashHelper.cs
- OciLobLocator.cs
- CustomErrorCollection.cs
- DrawingImage.cs
- XamlSerializerUtil.cs
- InstallerTypeAttribute.cs
- WebServicesSection.cs
- TreeIterator.cs
- AssemblyBuilder.cs
- PrePrepareMethodAttribute.cs
- EntryIndex.cs
- DesignTimeParseData.cs
- SystemIcmpV6Statistics.cs
- Function.cs
- UniqueSet.cs
- Queue.cs
- CachedRequestParams.cs
- MediaElement.cs
- NetworkAddressChange.cs
- ResourceDefaultValueAttribute.cs