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
- FrameworkElementFactory.cs
- MSAAWinEventWrap.cs
- HttpCapabilitiesSectionHandler.cs
- MainMenu.cs
- DeleteIndexBinder.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SuppressMessageAttribute.cs
- RedirectionProxy.cs
- ChtmlCommandAdapter.cs
- DesigntimeLicenseContextSerializer.cs
- TextHintingModeValidation.cs
- CompensationHandlingFilter.cs
- DataViewSetting.cs
- MimeParameters.cs
- LinkConverter.cs
- GridViewColumnCollection.cs
- _NestedSingleAsyncResult.cs
- DependencyPropertyChangedEventArgs.cs
- StringResourceManager.cs
- CalendarDesigner.cs
- ZoneIdentityPermission.cs
- MaskedTextProvider.cs
- ToolStripOverflowButton.cs
- MulticastOption.cs
- SizeChangedEventArgs.cs
- BasePattern.cs
- PeerNearMe.cs
- ToolStripRenderEventArgs.cs
- OdbcException.cs
- cookiecontainer.cs
- SafeEventLogWriteHandle.cs
- BitmapEffectDrawing.cs
- MenuAutomationPeer.cs
- SqlRecordBuffer.cs
- SchemaImporterExtension.cs
- DesignTimeData.cs
- FontFamily.cs
- BamlBinaryWriter.cs
- ToolBarPanel.cs
- VBIdentifierDesigner.xaml.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- EncodingNLS.cs
- XmlSchemaExporter.cs
- ToolStripPanelCell.cs
- TransactionProtocolConverter.cs
- SystemIPAddressInformation.cs
- CodeIdentifier.cs
- ServiceOperation.cs
- SessionSwitchEventArgs.cs
- XmlSchemaChoice.cs
- CallTemplateAction.cs
- TransmissionStrategy.cs
- _SafeNetHandles.cs
- StringFunctions.cs
- ListBoxItemAutomationPeer.cs
- StringPropertyBuilder.cs
- OdbcErrorCollection.cs
- XmlBoundElement.cs
- UInt16Storage.cs
- StreamWithDictionary.cs
- RestHandlerFactory.cs
- BinaryExpression.cs
- DataBindingCollection.cs
- __Filters.cs
- StorageMappingFragment.cs
- PathNode.cs
- RuntimeResourceSet.cs
- HotSpotCollection.cs
- EventOpcode.cs
- MsmqTransportElement.cs
- TextSearch.cs
- WebPartHelpVerb.cs
- SystemTcpStatistics.cs
- ZipIOModeEnforcingStream.cs
- NetworkInterface.cs
- WebPartDeleteVerb.cs
- FormsAuthenticationModule.cs
- IpcClientManager.cs
- UnauthorizedAccessException.cs
- Operators.cs
- DPAPIProtectedConfigurationProvider.cs
- ForwardPositionQuery.cs
- BuildProvidersCompiler.cs
- SpellCheck.cs
- DeviceContexts.cs
- ICollection.cs
- ContextMenuStripGroupCollection.cs
- MouseDevice.cs
- ErrorHandler.cs
- NullableConverter.cs
- TextEditorLists.cs
- Timeline.cs
- SqlBulkCopy.cs
- SystemEvents.cs
- PropertyMetadata.cs
- DataProtection.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- XomlCompilerParameters.cs
- DispatchChannelSink.cs
- Vector3DAnimationUsingKeyFrames.cs