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
- ScriptResourceAttribute.cs
- CellQuery.cs
- PathSegment.cs
- clipboard.cs
- ListViewGroupConverter.cs
- BooleanExpr.cs
- NamespaceCollection.cs
- XmlWellformedWriter.cs
- QilFactory.cs
- sqlstateclientmanager.cs
- CodeMemberEvent.cs
- UInt16Storage.cs
- SoapCodeExporter.cs
- SchemaImporterExtensionsSection.cs
- UpdateExpressionVisitor.cs
- NextPreviousPagerField.cs
- ListView.cs
- DataMisalignedException.cs
- EntityDataSourceViewSchema.cs
- WindowsProgressbar.cs
- BitmapImage.cs
- CryptographicAttribute.cs
- SecurityContext.cs
- ToolstripProfessionalRenderer.cs
- UrlEncodedParameterWriter.cs
- AutoFocusStyle.xaml.cs
- WindowsClaimSet.cs
- XmlSiteMapProvider.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- WebExceptionStatus.cs
- ClientUrlResolverWrapper.cs
- SplitContainer.cs
- CellParaClient.cs
- OracleLob.cs
- TextFormatterImp.cs
- ManagedFilter.cs
- SubMenuStyleCollection.cs
- XamlUtilities.cs
- PersonalizablePropertyEntry.cs
- WebFormsRootDesigner.cs
- Symbol.cs
- ContractsBCL.cs
- NativeMethods.cs
- recordstatefactory.cs
- XMLUtil.cs
- ClockGroup.cs
- DSASignatureFormatter.cs
- PixelFormat.cs
- InvalidateEvent.cs
- ClientEventManager.cs
- WebExceptionStatus.cs
- MobileControlPersister.cs
- ReferencedAssembly.cs
- MarkupCompilePass1.cs
- PeerContact.cs
- ProcessHost.cs
- DecimalConstantAttribute.cs
- JsonDataContract.cs
- OleDbWrapper.cs
- TileBrush.cs
- DataPagerCommandEventArgs.cs
- CustomError.cs
- RelatedCurrencyManager.cs
- CommonServiceBehaviorElement.cs
- CriticalHandle.cs
- SplitterEvent.cs
- CoreSwitches.cs
- LinqDataSourceSelectEventArgs.cs
- FlowLayoutPanelDesigner.cs
- FixedSOMPage.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- OleDbParameter.cs
- CellLabel.cs
- ReferenceEqualityComparer.cs
- MessageBox.cs
- CheckBoxBaseAdapter.cs
- ConditionCollection.cs
- DirectionalLight.cs
- BamlLocalizationDictionary.cs
- AttributeData.cs
- ResourceManagerWrapper.cs
- Input.cs
- SspiSecurityTokenProvider.cs
- MenuItemStyle.cs
- PtsContext.cs
- EUCJPEncoding.cs
- LiteralSubsegment.cs
- ScriptRegistrationManager.cs
- CompilerCollection.cs
- SQLMoney.cs
- XmlCountingReader.cs
- TraceHandler.cs
- XmlSerializerAssemblyAttribute.cs
- Comparer.cs
- CodeAttachEventStatement.cs
- ChannelDispatcher.cs
- CatalogZoneBase.cs
- CellParagraph.cs
- PrintingPermissionAttribute.cs
- manifestimages.cs