Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- CompressStream.cs
- WeakReferenceEnumerator.cs
- HttpTransportBindingElement.cs
- ProjectionPath.cs
- SafeSecurityHandles.cs
- LayoutTableCell.cs
- XmlValidatingReader.cs
- odbcmetadatacollectionnames.cs
- TlsnegoTokenAuthenticator.cs
- Stroke2.cs
- ADMembershipProvider.cs
- HttpCachePolicyBase.cs
- ThreadStateException.cs
- NegotiateStream.cs
- Hex.cs
- Highlights.cs
- BlurBitmapEffect.cs
- AlphabetConverter.cs
- ListViewUpdateEventArgs.cs
- ZoneMembershipCondition.cs
- _NegoStream.cs
- ValidatorCompatibilityHelper.cs
- ToolStripStatusLabel.cs
- BinaryParser.cs
- NavigationWindowAutomationPeer.cs
- LineServicesCallbacks.cs
- XamlRtfConverter.cs
- KnownAssemblyEntry.cs
- DocumentSchemaValidator.cs
- XmlDataImplementation.cs
- AssemblyBuilderData.cs
- Speller.cs
- HostingPreferredMapPath.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- OleDbConnection.cs
- Normalization.cs
- InkCanvasSelectionAdorner.cs
- GridViewSortEventArgs.cs
- XmlLoader.cs
- TrackingMemoryStreamFactory.cs
- IntPtr.cs
- StylesEditorDialog.cs
- ZoneMembershipCondition.cs
- CodeDomLocalizationProvider.cs
- AddIn.cs
- DataTrigger.cs
- RequestDescription.cs
- ObjectDataSourceView.cs
- Point.cs
- MessagePartProtectionMode.cs
- NamedPermissionSet.cs
- RepeaterItemEventArgs.cs
- ConfigurationSectionGroupCollection.cs
- RegisteredArrayDeclaration.cs
- ipaddressinformationcollection.cs
- DataAdapter.cs
- DispatcherExceptionEventArgs.cs
- GradientSpreadMethodValidation.cs
- GridItemProviderWrapper.cs
- TextFormatterContext.cs
- ErrorActivity.cs
- DescendantOverDescendantQuery.cs
- Number.cs
- Wizard.cs
- WasEndpointConfigContainer.cs
- EntityClassGenerator.cs
- TabPage.cs
- XPathExpr.cs
- XmlSchemaParticle.cs
- ColorKeyFrameCollection.cs
- StringCollectionMarkupSerializer.cs
- Helpers.cs
- HybridCollection.cs
- CompensatableTransactionScopeActivityDesigner.cs
- FeatureManager.cs
- safex509handles.cs
- MatrixTransform3D.cs
- EncoderParameter.cs
- ScaleTransform.cs
- ASCIIEncoding.cs
- Operator.cs
- ContactManager.cs
- RadioButtonList.cs
- PKCS1MaskGenerationMethod.cs
- HtmlInputPassword.cs
- GeneralTransform.cs
- XmlSchema.cs
- ZipIORawDataFileBlock.cs
- UnmanagedMemoryStreamWrapper.cs
- TextTreeUndo.cs
- DBParameter.cs
- ThicknessKeyFrameCollection.cs
- SqlSelectClauseBuilder.cs
- Constraint.cs
- COM2Properties.cs
- DbConnectionPoolIdentity.cs
- DeadCharTextComposition.cs
- XmlMemberMapping.cs
- SkipStoryboardToFill.cs