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
- FrameworkElement.cs
- ContractComponent.cs
- KeyValuePairs.cs
- TransportDefaults.cs
- LineGeometry.cs
- RegexCapture.cs
- UnsafeNativeMethods.cs
- SoapTypeAttribute.cs
- AutomationElementCollection.cs
- Gdiplus.cs
- SelectionItemPattern.cs
- HtmlSelect.cs
- ConditionValidator.cs
- WarningException.cs
- SecurityContext.cs
- OutputCacheSection.cs
- CachedPathData.cs
- XmlNode.cs
- PagedDataSource.cs
- ProjectionPruner.cs
- ExportException.cs
- HttpListenerException.cs
- Matrix3DConverter.cs
- PageThemeCodeDomTreeGenerator.cs
- DetailsView.cs
- ConsumerConnectionPointCollection.cs
- FlowDocumentScrollViewer.cs
- PerformanceCounterCategory.cs
- QuerySettings.cs
- Exceptions.cs
- AuthenticationException.cs
- SmiConnection.cs
- OdbcException.cs
- ObjectNavigationPropertyMapping.cs
- TdsEnums.cs
- EmptyReadOnlyDictionaryInternal.cs
- BufferedResponseStream.cs
- SqlTypesSchemaImporter.cs
- NameNode.cs
- CompiledIdentityConstraint.cs
- PagerSettings.cs
- DataGridViewCellStateChangedEventArgs.cs
- AuthenticateEventArgs.cs
- DataControlFieldCell.cs
- ManifestResourceInfo.cs
- CapabilitiesUse.cs
- CodeRemoveEventStatement.cs
- CheckBox.cs
- GlyphCache.cs
- EntityViewGenerator.cs
- WindowsFormsSynchronizationContext.cs
- LifetimeMonitor.cs
- BrowserCapabilitiesCodeGenerator.cs
- EndpointConfigContainer.cs
- QuaternionKeyFrameCollection.cs
- Int32Storage.cs
- SqlGenericUtil.cs
- RSACryptoServiceProvider.cs
- SoapHelper.cs
- StringFunctions.cs
- XmlReflectionImporter.cs
- VirtualDirectoryMappingCollection.cs
- DataViewManager.cs
- ValueProviderWrapper.cs
- ContainerVisual.cs
- DomNameTable.cs
- PersonalizationStateQuery.cs
- DbConnectionStringBuilder.cs
- HttpCookiesSection.cs
- ConsoleTraceListener.cs
- SchemaNamespaceManager.cs
- HebrewNumber.cs
- BuildProvider.cs
- JavaScriptSerializer.cs
- MD5.cs
- ExpandSegmentCollection.cs
- RepeatButton.cs
- ConfigurationException.cs
- OneOf.cs
- PerfCounterSection.cs
- ImageBrush.cs
- SignerInfo.cs
- CompilationRelaxations.cs
- ISO2022Encoding.cs
- DataGridState.cs
- AnchorEditor.cs
- XmlQueryCardinality.cs
- MultiPageTextView.cs
- StringSorter.cs
- RowSpanVector.cs
- XNodeSchemaApplier.cs
- UmAlQuraCalendar.cs
- RemotingService.cs
- RoutedUICommand.cs
- AddInContractAttribute.cs
- TransactionTable.cs
- CodeCatchClause.cs
- ControlEvent.cs
- SystemIPGlobalProperties.cs
- OracleException.cs