Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- WebPartConnectVerb.cs
- CodeEventReferenceExpression.cs
- SoapCodeExporter.cs
- SafeNativeMethods.cs
- LineBreakRecord.cs
- CustomCredentialPolicy.cs
- TrackingMemoryStreamFactory.cs
- XmlDocumentFragment.cs
- ProgressBarHighlightConverter.cs
- XPathSelectionIterator.cs
- ValidationPropertyAttribute.cs
- DisableDpiAwarenessAttribute.cs
- HtmlTextArea.cs
- SemanticBasicElement.cs
- UrlMapping.cs
- RegionInfo.cs
- SqlNotificationRequest.cs
- FaultBookmark.cs
- QilPatternVisitor.cs
- VersionedStreamOwner.cs
- Base64Encoder.cs
- Triangle.cs
- ModelVisual3D.cs
- AuthenticationSection.cs
- ApplicationSecurityInfo.cs
- InfoCardBaseException.cs
- DataGridTemplateColumn.cs
- FixedSOMTableCell.cs
- HashStream.cs
- TaskSchedulerException.cs
- BuilderPropertyEntry.cs
- DispatcherProcessingDisabled.cs
- ClientSettings.cs
- LinkLabel.cs
- DiagnosticsConfigurationHandler.cs
- EditorBrowsableAttribute.cs
- _SSPISessionCache.cs
- TempFiles.cs
- LinqDataSourceValidationException.cs
- RestHandler.cs
- HtmlInputButton.cs
- BamlBinaryReader.cs
- XmlEnumAttribute.cs
- Int16Animation.cs
- ListenerAdaptersInstallComponent.cs
- BevelBitmapEffect.cs
- DocumentScope.cs
- WebPartManager.cs
- ControlTemplate.cs
- RewritingProcessor.cs
- WsdlImporterElement.cs
- XmlText.cs
- InitializationEventAttribute.cs
- SetStateEventArgs.cs
- ProfileParameter.cs
- TypeDescriptionProviderAttribute.cs
- Task.cs
- HttpRequestTraceRecord.cs
- DbConnectionFactory.cs
- Quaternion.cs
- DataListItem.cs
- SqlParameterCollection.cs
- ModelItemCollectionImpl.cs
- ToolStripLabel.cs
- OperatorExpressions.cs
- SecureUICommand.cs
- AddDataControlFieldDialog.cs
- WindowsListViewItem.cs
- WindowsToolbarAsMenu.cs
- NamespaceQuery.cs
- CallContext.cs
- ProgressBarBrushConverter.cs
- PolygonHotSpot.cs
- Binding.cs
- AuthenticationConfig.cs
- VisualBrush.cs
- TraceSwitch.cs
- PropertyRef.cs
- DesignerActionService.cs
- SqlProvider.cs
- WindowsTitleBar.cs
- XmlIncludeAttribute.cs
- DataServiceQueryException.cs
- StatusBarDrawItemEvent.cs
- ServiceRoute.cs
- DiscardableAttribute.cs
- PageThemeParser.cs
- CodeTypeReference.cs
- ManagementDateTime.cs
- TdsValueSetter.cs
- MsmqIntegrationChannelListener.cs
- IntSecurity.cs
- SoapAttributeAttribute.cs
- BitmapEffectInputData.cs
- NotifyIcon.cs
- Model3DGroup.cs
- CookieParameter.cs
- RequestCacheEntry.cs
- LinqDataSourceSelectEventArgs.cs
- OperationCanceledException.cs