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
- PixelFormat.cs
- SqlDataReaderSmi.cs
- ConstrainedGroup.cs
- BadImageFormatException.cs
- InstanceHandleReference.cs
- RolePrincipal.cs
- TableParagraph.cs
- UnionCodeGroup.cs
- CoTaskMemUnicodeSafeHandle.cs
- Message.cs
- UserValidatedEventArgs.cs
- SubpageParaClient.cs
- DebuggerAttributes.cs
- ResourceContainer.cs
- StrokeCollectionConverter.cs
- PngBitmapDecoder.cs
- AssociationSetEnd.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- MimeTypeAttribute.cs
- EmbeddedMailObject.cs
- ComNativeDescriptor.cs
- ConcurrentQueue.cs
- _CacheStreams.cs
- ManipulationVelocities.cs
- DataGridViewColumnCollection.cs
- InfoCardSymmetricCrypto.cs
- _IPv4Address.cs
- Helpers.cs
- Vector3D.cs
- ThrowHelper.cs
- WebPartConnectionsDisconnectVerb.cs
- ThreadStartException.cs
- AssertFilter.cs
- FigureParaClient.cs
- CachedFontFamily.cs
- Marshal.cs
- Literal.cs
- XmlBinaryReaderSession.cs
- SoapEnumAttribute.cs
- PathFigureCollection.cs
- Listbox.cs
- HttpsHostedTransportConfiguration.cs
- DecoderNLS.cs
- XPathDocumentIterator.cs
- SingleTagSectionHandler.cs
- SettingsSavedEventArgs.cs
- ModuleConfigurationInfo.cs
- RenderOptions.cs
- GeneralTransform3DCollection.cs
- FontInfo.cs
- DeclarativeCatalogPart.cs
- ExpressionList.cs
- InputLangChangeRequestEvent.cs
- MasterPageCodeDomTreeGenerator.cs
- ProxyHelper.cs
- DataGridViewEditingControlShowingEventArgs.cs
- BindableTemplateBuilder.cs
- Function.cs
- XmlMapping.cs
- TreeNodeEventArgs.cs
- UniformGrid.cs
- BulletedList.cs
- BindingListCollectionView.cs
- XmlWriterSettings.cs
- DbProviderFactoriesConfigurationHandler.cs
- TableColumn.cs
- APCustomTypeDescriptor.cs
- ListViewTableRow.cs
- DetailsView.cs
- DataColumnCollection.cs
- CategoryGridEntry.cs
- FormViewDeletedEventArgs.cs
- AuthenticationManager.cs
- OleDbTransaction.cs
- TypeDescriptor.cs
- TextFindEngine.cs
- Base64WriteStateInfo.cs
- PageBuildProvider.cs
- KoreanLunisolarCalendar.cs
- BitmapEffectInput.cs
- RequestResponse.cs
- PeerObject.cs
- ColorMap.cs
- ReadOnlyObservableCollection.cs
- AuthenticationModuleElement.cs
- NullableBoolConverter.cs
- EventHandlersStore.cs
- CodeDelegateInvokeExpression.cs
- MetaModel.cs
- FormatSettings.cs
- XPathNodeInfoAtom.cs
- SRGSCompiler.cs
- EntityContainerEntitySet.cs
- ResourcesBuildProvider.cs
- WsdlBuildProvider.cs
- Pens.cs
- BitStream.cs
- EntityConnection.cs
- WindowsTitleBar.cs
- AssertHelper.cs