Code:
/ DotNET / DotNET / 8.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
- IpcClientManager.cs
- HtmlHead.cs
- FileResponseElement.cs
- AuthorizationRule.cs
- ExtensionWindowHeader.cs
- EditBehavior.cs
- ControlFilterExpression.cs
- KnownColorTable.cs
- HttpRequest.cs
- QueryCoreOp.cs
- BindUriHelper.cs
- HttpListener.cs
- XmlWriter.cs
- InvokeHandlers.cs
- Transform3D.cs
- AsyncOperationContext.cs
- PropertyEmitterBase.cs
- ClusterRegistryConfigurationProvider.cs
- StaticContext.cs
- DataGridViewRow.cs
- ActivityWithResult.cs
- URI.cs
- FrameworkElement.cs
- DrawListViewSubItemEventArgs.cs
- Shape.cs
- FrameworkTextComposition.cs
- TreeNode.cs
- SQLDateTimeStorage.cs
- DatagridviewDisplayedBandsData.cs
- RoleServiceManager.cs
- PersonalizationDictionary.cs
- PropertyPathConverter.cs
- AndCondition.cs
- GeneralTransform3DGroup.cs
- SimpleApplicationHost.cs
- VirtualDirectoryMapping.cs
- IgnoreFileBuildProvider.cs
- indexingfiltermarshaler.cs
- RowsCopiedEventArgs.cs
- NullableConverter.cs
- DiscardableAttribute.cs
- DbConnectionClosed.cs
- XmlJsonWriter.cs
- SystemResources.cs
- FontFaceLayoutInfo.cs
- ReferentialConstraintRoleElement.cs
- CheckBoxList.cs
- ServiceOperationWrapper.cs
- UpdatePanelTriggerCollection.cs
- ToolStripManager.cs
- XmlSchemaDocumentation.cs
- ZipIOLocalFileHeader.cs
- XmlSchemaSimpleContent.cs
- CodeVariableReferenceExpression.cs
- OrderPreservingPipeliningSpoolingTask.cs
- ConfigurationValidatorBase.cs
- ProgressBarAutomationPeer.cs
- PlatformCulture.cs
- NullableConverter.cs
- KoreanCalendar.cs
- EventMappingSettingsCollection.cs
- LocalizationComments.cs
- CodeVariableDeclarationStatement.cs
- ZoneIdentityPermission.cs
- WinInet.cs
- TypeUtil.cs
- BinaryObjectInfo.cs
- TextBlockAutomationPeer.cs
- CookieParameter.cs
- TextChangedEventArgs.cs
- ObjectSecurityT.cs
- DataGridViewDataErrorEventArgs.cs
- SubMenuStyleCollection.cs
- PermissionListSet.cs
- ConfigDefinitionUpdates.cs
- BindingManagerDataErrorEventArgs.cs
- CodeNamespaceCollection.cs
- DBPropSet.cs
- PerformanceCounter.cs
- XamlToRtfWriter.cs
- PersistencePipeline.cs
- BlobPersonalizationState.cs
- DecoderFallback.cs
- HotSpot.cs
- SystemBrushes.cs
- AutomationPattern.cs
- StreamWriter.cs
- CodeTypeReferenceCollection.cs
- RuleProcessor.cs
- FileChangesMonitor.cs
- ListViewContainer.cs
- SystemPens.cs
- HttpRequestBase.cs
- RuntimeEnvironment.cs
- Comparer.cs
- DelegateCompletionCallbackWrapper.cs
- WindowsTab.cs
- SymbolUsageManager.cs
- Triangle.cs
- BoundColumn.cs