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
- FormatVersion.cs
- ImageMap.cs
- RootBuilder.cs
- TemplateComponentConnector.cs
- Header.cs
- Size3D.cs
- BidOverLoads.cs
- RuleElement.cs
- SettingsPropertyCollection.cs
- DocumentOrderQuery.cs
- PropertyDescriptorComparer.cs
- FormViewCommandEventArgs.cs
- SimpleType.cs
- SqlServices.cs
- OrderedDictionaryStateHelper.cs
- PenThread.cs
- OleDbParameterCollection.cs
- SerializableAttribute.cs
- DbConnectionPoolGroupProviderInfo.cs
- ProviderUtil.cs
- Pen.cs
- AtomServiceDocumentSerializer.cs
- storepermission.cs
- RC2CryptoServiceProvider.cs
- VScrollProperties.cs
- Latin1Encoding.cs
- FixedNode.cs
- MLangCodePageEncoding.cs
- WebConfigurationHostFileChange.cs
- WebPartConnectionsEventArgs.cs
- XmlSchemaImport.cs
- SplitterPanel.cs
- TdsParserStateObject.cs
- SrgsElementList.cs
- CursorConverter.cs
- sqlmetadatafactory.cs
- StandardCommandToolStripMenuItem.cs
- PeerEndPoint.cs
- X509PeerCertificateAuthentication.cs
- ThemeDirectoryCompiler.cs
- MultiTrigger.cs
- TreeViewBindingsEditor.cs
- InputScope.cs
- _UncName.cs
- SessionStateUtil.cs
- HTMLTagNameToTypeMapper.cs
- ObservableDictionary.cs
- HealthMonitoringSectionHelper.cs
- ReadOnlyNameValueCollection.cs
- SoundPlayerAction.cs
- CodeSnippetStatement.cs
- FormViewDeletedEventArgs.cs
- XPathNodeInfoAtom.cs
- CompModSwitches.cs
- StreamUpgradeProvider.cs
- AsyncCompletedEventArgs.cs
- SpeechSynthesizer.cs
- CodeConditionStatement.cs
- HybridDictionary.cs
- ListItemCollection.cs
- TreeNode.cs
- CodeLabeledStatement.cs
- NavigationPropertyEmitter.cs
- ClientSettingsSection.cs
- TableTextElementCollectionInternal.cs
- MultiSelector.cs
- ReadOnlyHierarchicalDataSourceView.cs
- OdbcInfoMessageEvent.cs
- NativeObjectSecurity.cs
- DocumentPaginator.cs
- WbmpConverter.cs
- ListViewUpdateEventArgs.cs
- XPathParser.cs
- OleDbConnectionInternal.cs
- TemplateNameScope.cs
- ResourceAssociationTypeEnd.cs
- PageThemeBuildProvider.cs
- BackStopAuthenticationModule.cs
- RestClientProxyHandler.cs
- PersistNameAttribute.cs
- ServiceBehaviorAttribute.cs
- AllMembershipCondition.cs
- ReflectionServiceProvider.cs
- ColumnWidthChangingEvent.cs
- FontUnit.cs
- SecureStringHasher.cs
- DataListItemCollection.cs
- HtmlElement.cs
- GatewayDefinition.cs
- embossbitmapeffect.cs
- EntityDataSourceUtil.cs
- ShapingWorkspace.cs
- ExtendedProtectionPolicyElement.cs
- Debug.cs
- EntityClassGenerator.cs
- SoundPlayerAction.cs
- CellCreator.cs
- CommandLineParser.cs
- TypedDataSetSchemaImporterExtension.cs
- ActiveDesignSurfaceEvent.cs