Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantBaseQuery.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SpinWait.cs
- WebPartZoneCollection.cs
- SQLDecimalStorage.cs
- TextDecorationCollection.cs
- HotSpot.cs
- NameSpaceExtractor.cs
- FontClient.cs
- TextRange.cs
- SourceFileInfo.cs
- XmlSerializerVersionAttribute.cs
- HashCryptoHandle.cs
- ActivityPreviewDesigner.cs
- PropertyValueUIItem.cs
- OpenFileDialog.cs
- DataGridLinkButton.cs
- DropTarget.cs
- EventTrigger.cs
- SchemaDeclBase.cs
- SecurityTokenValidationException.cs
- FontCacheUtil.cs
- List.cs
- DllNotFoundException.cs
- IdentityHolder.cs
- AssemblyEvidenceFactory.cs
- ResourcePermissionBaseEntry.cs
- CaseInsensitiveHashCodeProvider.cs
- PbrsForward.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- ListViewContainer.cs
- Maps.cs
- GacUtil.cs
- Accessible.cs
- StylusTip.cs
- SoapAttributeOverrides.cs
- ScrollContentPresenter.cs
- NumberFormatInfo.cs
- VisualBrush.cs
- Conditional.cs
- TreeNodeSelectionProcessor.cs
- QueryProcessor.cs
- RegexCapture.cs
- OrderPreservingPipeliningMergeHelper.cs
- MaskedTextBox.cs
- ToolboxDataAttribute.cs
- CngKeyBlobFormat.cs
- DbgUtil.cs
- EncoderBestFitFallback.cs
- ToolboxItemCollection.cs
- ColorConvertedBitmap.cs
- OdbcUtils.cs
- Control.cs
- ClassicBorderDecorator.cs
- InvalidTimeZoneException.cs
- SetStateDesigner.cs
- AnimationClock.cs
- RsaKeyIdentifierClause.cs
- Context.cs
- InternalSafeNativeMethods.cs
- GridEntryCollection.cs
- UriWriter.cs
- AstNode.cs
- PresentationTraceSources.cs
- SafeMILHandle.cs
- Semaphore.cs
- LocalizedNameDescriptionPair.cs
- SHA384.cs
- TraceLevelStore.cs
- AssociationSet.cs
- HtmlButton.cs
- CqlGenerator.cs
- TrackBarRenderer.cs
- HandlerBase.cs
- SystemException.cs
- wgx_commands.cs
- GeneralTransform3D.cs
- MouseButtonEventArgs.cs
- SoapServerMessage.cs
- SafeEventLogReadHandle.cs
- DataGridViewRowConverter.cs
- TabletCollection.cs
- Visual3DCollection.cs
- FocusWithinProperty.cs
- IncrementalHitTester.cs
- NotImplementedException.cs
- AspCompat.cs
- WindowHideOrCloseTracker.cs
- ExtenderProvidedPropertyAttribute.cs
- BlockingCollection.cs
- NameHandler.cs
- RequestQueue.cs
- FileDocument.cs
- Adorner.cs
- DataServiceResponse.cs
- CalendarDay.cs
- SeekableReadStream.cs
- CodeEntryPointMethod.cs
- ColumnReorderedEventArgs.cs
- BinaryReader.cs
- InfoCardTraceRecord.cs
- SSmlParser.cs