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
- BamlTreeNode.cs
- ProviderCollection.cs
- SqlError.cs
- BitArray.cs
- RemotingException.cs
- _HeaderInfoTable.cs
- SafeNativeMethods.cs
- RenderDataDrawingContext.cs
- DetailsViewInsertedEventArgs.cs
- QilInvokeLateBound.cs
- MatrixCamera.cs
- ContractComponent.cs
- TagPrefixInfo.cs
- ExpressionBindingCollection.cs
- future.cs
- DurationConverter.cs
- WindowsListViewGroupSubsetLink.cs
- ListParaClient.cs
- WebBrowsableAttribute.cs
- QueuePathDialog.cs
- RemotingConfiguration.cs
- RelatedPropertyManager.cs
- AddInServer.cs
- QueryStringParameter.cs
- IndexerNameAttribute.cs
- cryptoapiTransform.cs
- GreenMethods.cs
- ResourceDictionaryCollection.cs
- ThreadStateException.cs
- DataSourceControlBuilder.cs
- KeyFrames.cs
- EntityDataSourceChangedEventArgs.cs
- unitconverter.cs
- ListViewItem.cs
- WinEventQueueItem.cs
- IdleTimeoutMonitor.cs
- XDeferredAxisSource.cs
- TextServicesHost.cs
- BaseUriHelper.cs
- GeometryHitTestResult.cs
- SecurityPolicySection.cs
- AvTrace.cs
- ServiceOperation.cs
- CollectionConverter.cs
- CellCreator.cs
- Exceptions.cs
- RewritingValidator.cs
- SignatureGenerator.cs
- XmlSchemaGroupRef.cs
- WorkflowServiceHost.cs
- DataBindingHandlerAttribute.cs
- SecurityTokenSpecification.cs
- OnOperation.cs
- WriterOutput.cs
- BooleanAnimationUsingKeyFrames.cs
- EntityTypeEmitter.cs
- SerializationTrace.cs
- _SslState.cs
- securitymgrsite.cs
- WebPartDisplayModeCancelEventArgs.cs
- DataList.cs
- InternalConfigConfigurationFactory.cs
- EventSourceCreationData.cs
- CommandBindingCollection.cs
- KnownIds.cs
- SymLanguageType.cs
- NamespaceCollection.cs
- DetailsViewDeletedEventArgs.cs
- DataBindingHandlerAttribute.cs
- PageThemeParser.cs
- MimeBasePart.cs
- TransformedBitmap.cs
- AnnotationAdorner.cs
- RolePrincipal.cs
- StatusStrip.cs
- DataSourceListEditor.cs
- XmlNamespaceManager.cs
- DragDeltaEventArgs.cs
- Bidi.cs
- DictionarySectionHandler.cs
- HttpCachePolicy.cs
- StoragePropertyMapping.cs
- MethodAccessException.cs
- IndentedWriter.cs
- ResolveNameEventArgs.cs
- BaseCodeDomTreeGenerator.cs
- IIS7WorkerRequest.cs
- EndOfStreamException.cs
- PopOutPanel.cs
- XPathSelfQuery.cs
- XmlIncludeAttribute.cs
- SeverityFilter.cs
- DataGridCell.cs
- NotifyIcon.cs
- InputLangChangeRequestEvent.cs
- PathFigure.cs
- XamlToRtfParser.cs
- HttpFileCollection.cs
- GridLength.cs
- OciLobLocator.cs