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
- SerializationStore.cs
- EventRecord.cs
- designeractionlistschangedeventargs.cs
- DbConnectionOptions.cs
- DataControlHelper.cs
- SafeHandles.cs
- ReferenceConverter.cs
- DataRowChangeEvent.cs
- BadImageFormatException.cs
- MarkerProperties.cs
- Scanner.cs
- Message.cs
- ComponentResourceKeyConverter.cs
- MergeLocalizationDirectives.cs
- XmlIterators.cs
- XmlConvert.cs
- PkcsUtils.cs
- EditorAttributeInfo.cs
- DataRow.cs
- MenuItemStyle.cs
- DataGridViewAccessibleObject.cs
- DataGridViewCellFormattingEventArgs.cs
- _ListenerResponseStream.cs
- EntityCollection.cs
- SchemaInfo.cs
- StringConverter.cs
- WindowsGraphicsWrapper.cs
- MultilineStringConverter.cs
- XmlCodeExporter.cs
- DelegateTypeInfo.cs
- BitmapEffectOutputConnector.cs
- ISCIIEncoding.cs
- PropertyValueChangedEvent.cs
- safelink.cs
- ColumnCollectionEditor.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- CodeStatementCollection.cs
- DispatcherTimer.cs
- DataGridViewSelectedColumnCollection.cs
- RepeaterDataBoundAdapter.cs
- EmbeddedMailObjectsCollection.cs
- SchemaDeclBase.cs
- FilterQuery.cs
- AssociationSet.cs
- assertwrapper.cs
- SafeProcessHandle.cs
- IPCCacheManager.cs
- DateTimeConverter.cs
- XPathExpr.cs
- SecUtil.cs
- ContentDisposition.cs
- SerializationEventsCache.cs
- SqlClientFactory.cs
- _NegoStream.cs
- SynchronizedInputHelper.cs
- NamespaceQuery.cs
- MenuItemCollectionEditorDialog.cs
- FilePresentation.cs
- MessageEventSubscriptionService.cs
- WaitHandle.cs
- DataSetMappper.cs
- JsonFormatReaderGenerator.cs
- ProcessModuleCollection.cs
- TokenCreationException.cs
- InterleavedZipPartStream.cs
- SqlReorderer.cs
- TemplatedMailWebEventProvider.cs
- Matrix3D.cs
- WorkflowDefinitionDispenser.cs
- FutureFactory.cs
- BrowserDefinitionCollection.cs
- XmlLanguage.cs
- TreeWalkHelper.cs
- Convert.cs
- WebScriptMetadataInstanceContextProvider.cs
- HtmlInputSubmit.cs
- AxDesigner.cs
- GifBitmapEncoder.cs
- AuthenticationConfig.cs
- StringAnimationBase.cs
- SmtpReplyReaderFactory.cs
- OperationDescription.cs
- AssociationEndMember.cs
- PackageRelationshipSelector.cs
- AudioFileOut.cs
- TypedDatasetGenerator.cs
- XomlDesignerLoader.cs
- SurrogateChar.cs
- SqlOuterApplyReducer.cs
- StatusStrip.cs
- XmlSchemaComplexType.cs
- SecurityException.cs
- SchemaCompiler.cs
- VectorAnimationUsingKeyFrames.cs
- TranslateTransform3D.cs
- DetailsViewInsertedEventArgs.cs
- WindowCollection.cs
- PageSetupDialog.cs
- IIS7WorkerRequest.cs
- SignatureHelper.cs