Code:
/ DotNET / DotNET / 8.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
- CodeChecksumPragma.cs
- OdbcTransaction.cs
- ChannelFactoryBase.cs
- ButtonFieldBase.cs
- ListItemConverter.cs
- XmlUtil.cs
- DefaultProxySection.cs
- ActiveXContainer.cs
- DashStyle.cs
- WebPartConnectionsEventArgs.cs
- AppSettingsExpressionBuilder.cs
- WindowsFormsHostPropertyMap.cs
- DbParameterCollectionHelper.cs
- PartialCachingAttribute.cs
- BooleanToVisibilityConverter.cs
- Button.cs
- TemplateBindingExtensionConverter.cs
- XsltException.cs
- ToolBarButton.cs
- XamlReaderHelper.cs
- PageCatalogPart.cs
- ZoneIdentityPermission.cs
- TableColumn.cs
- ExpandCollapsePattern.cs
- PathSegment.cs
- MappingModelBuildProvider.cs
- RtfToken.cs
- SqlLiftWhereClauses.cs
- UIElementPropertyUndoUnit.cs
- SafeCryptoKeyHandle.cs
- StateItem.cs
- PropertyReferenceExtension.cs
- AuthenticateEventArgs.cs
- WebPartActionVerb.cs
- cookie.cs
- ListMarkerLine.cs
- SemanticValue.cs
- CharStorage.cs
- FrameworkPropertyMetadata.cs
- srgsitem.cs
- TemplateNodeContextMenu.cs
- PasswordDeriveBytes.cs
- EntityParameterCollection.cs
- CollectionTraceRecord.cs
- StrokeCollectionConverter.cs
- SqlBulkCopy.cs
- RelationshipEndMember.cs
- ButtonField.cs
- XsltLibrary.cs
- Drawing.cs
- MgmtConfigurationRecord.cs
- DataSpaceManager.cs
- Attributes.cs
- CatalogPartChrome.cs
- FilteredReadOnlyMetadataCollection.cs
- ItemCheckedEvent.cs
- OrderByQueryOptionExpression.cs
- QueryTask.cs
- ClonableStack.cs
- dsa.cs
- UniqueIdentifierService.cs
- MailWebEventProvider.cs
- ParameterToken.cs
- TypefaceMap.cs
- COM2ExtendedTypeConverter.cs
- Int64Storage.cs
- XmlSignatureProperties.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- ProxyWebPart.cs
- FormViewInsertedEventArgs.cs
- ObjectCacheSettings.cs
- SHA512.cs
- QilPatternVisitor.cs
- Utils.cs
- DoWorkEventArgs.cs
- SqlFactory.cs
- CodeIdentifier.cs
- InputReportEventArgs.cs
- WhiteSpaceTrimStringConverter.cs
- DependencyPropertyKind.cs
- TableRow.cs
- ComponentResourceKey.cs
- Ppl.cs
- NativeBuffer.cs
- IList.cs
- SiteMapProvider.cs
- ArrangedElement.cs
- MeasureData.cs
- BezierSegment.cs
- ToolStripGrip.cs
- StateRuntime.cs
- FormDocumentDesigner.cs
- EntityWithKeyStrategy.cs
- PathData.cs
- HostingEnvironment.cs
- BoolExpr.cs
- PreviewPageInfo.cs
- AttributeEmitter.cs
- GetPageCompletedEventArgs.cs
- BitVector32.cs