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
- TransactionException.cs
- FileUtil.cs
- PanelDesigner.cs
- DocumentScope.cs
- _DomainName.cs
- WsdlInspector.cs
- AnimatedTypeHelpers.cs
- _LocalDataStore.cs
- TextServicesHost.cs
- OdbcConnectionOpen.cs
- CompoundFileReference.cs
- NavigationProgressEventArgs.cs
- TimeSpanMinutesConverter.cs
- _ScatterGatherBuffers.cs
- ReadOnlyCollection.cs
- EventArgs.cs
- InfoCardSymmetricAlgorithm.cs
- RenderData.cs
- SimpleFileLog.cs
- UniqueConstraint.cs
- InfoCardArgumentException.cs
- Header.cs
- InkCanvasSelectionAdorner.cs
- HtmlTableCellCollection.cs
- FormsAuthenticationUserCollection.cs
- XmlSerializerAssemblyAttribute.cs
- TextWriterTraceListener.cs
- WorkflowDataContext.cs
- DesignTimeVisibleAttribute.cs
- SymLanguageVendor.cs
- MetadataItemSerializer.cs
- ActivityXRefConverter.cs
- Canvas.cs
- MatrixAnimationUsingKeyFrames.cs
- DirectoryObjectSecurity.cs
- ViewManager.cs
- DataView.cs
- RecognizerBase.cs
- DynamicDataResources.Designer.cs
- AnnouncementEventArgs.cs
- XmlWrappingReader.cs
- MenuItemAutomationPeer.cs
- TimeStampChecker.cs
- X509CertificateInitiatorServiceCredential.cs
- CodeDOMUtility.cs
- SBCSCodePageEncoding.cs
- SerTrace.cs
- DesignerSerializationVisibilityAttribute.cs
- FormsIdentity.cs
- InkCanvasAutomationPeer.cs
- DataGridViewRowConverter.cs
- AlgoModule.cs
- SqlVersion.cs
- DesignerSelectionListAdapter.cs
- ItemType.cs
- StringArrayConverter.cs
- OracleConnectionFactory.cs
- AspNetPartialTrustHelpers.cs
- SmiEventSink_Default.cs
- Site.cs
- RemotingConfigParser.cs
- ConsoleKeyInfo.cs
- PrivilegeNotHeldException.cs
- VectorValueSerializer.cs
- datacache.cs
- MonthCalendar.cs
- XmlAnyElementAttribute.cs
- TypedColumnHandler.cs
- InstanceContext.cs
- AssociatedControlConverter.cs
- TagPrefixCollection.cs
- COM2TypeInfoProcessor.cs
- ModelPropertyImpl.cs
- IgnoreSectionHandler.cs
- XmlValidatingReaderImpl.cs
- WebServiceClientProxyGenerator.cs
- ApplicationHost.cs
- BatchStream.cs
- AssociationTypeEmitter.cs
- QueryAccessibilityHelpEvent.cs
- ScrollProviderWrapper.cs
- GeneratedView.cs
- AsymmetricSignatureFormatter.cs
- KeyBinding.cs
- MemoryRecordBuffer.cs
- ConsoleEntryPoint.cs
- Soap12FormatExtensions.cs
- XmlAtomicValue.cs
- CLRBindingWorker.cs
- SafeCancelMibChangeNotify.cs
- DependencyPropertyChangedEventArgs.cs
- SaveFileDialog.cs
- EventDriven.cs
- CanonicalXml.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SqlBulkCopyColumnMappingCollection.cs
- _HeaderInfo.cs
- ProfileParameter.cs
- DecoderNLS.cs
- DescendantBaseQuery.cs