Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantBaseQuery.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Base64Decoder.cs
- AppManager.cs
- ActivitySurrogateSelector.cs
- MetadataUtilsSmi.cs
- KeyedCollection.cs
- XmlImplementation.cs
- XslAst.cs
- Win32.cs
- FormClosedEvent.cs
- CustomLineCap.cs
- WindowPattern.cs
- DataSvcMapFileSerializer.cs
- PermissionSet.cs
- ExpressionBuilderContext.cs
- ReadOnlyHierarchicalDataSource.cs
- ServiceDiscoveryBehavior.cs
- LogicalExpr.cs
- URLIdentityPermission.cs
- BufferModeSettings.cs
- HttpCapabilitiesBase.cs
- SqlRemoveConstantOrderBy.cs
- InkCollectionBehavior.cs
- TypeLoader.cs
- CultureMapper.cs
- WebControlAdapter.cs
- ComplexTypeEmitter.cs
- PropertyGeneratedEventArgs.cs
- SizeAnimationUsingKeyFrames.cs
- ParameterCollection.cs
- IDataContractSurrogate.cs
- ButtonFlatAdapter.cs
- SplayTreeNode.cs
- TabControl.cs
- State.cs
- CultureSpecificCharacterBufferRange.cs
- GACIdentityPermission.cs
- CFGGrammar.cs
- PagesSection.cs
- XmlSchemaFacet.cs
- BamlLocalizer.cs
- DictionaryBase.cs
- Shared.cs
- InkCanvas.cs
- ZipArchive.cs
- DiscoveryEndpointElement.cs
- ControlIdConverter.cs
- VectorCollectionConverter.cs
- ToolStripPanelSelectionBehavior.cs
- UnsafeNativeMethods.cs
- ListView.cs
- XmlBinaryWriter.cs
- ProviderManager.cs
- ApplicationInfo.cs
- ValidatedControlConverter.cs
- ClientBase.cs
- StringSource.cs
- GenericParameterDataContract.cs
- Evaluator.cs
- CapiNative.cs
- ReadOnlyCollectionBase.cs
- GridViewUpdateEventArgs.cs
- DodSequenceMerge.cs
- PageEventArgs.cs
- path.cs
- TextTreeInsertElementUndoUnit.cs
- DesignerHierarchicalDataSourceView.cs
- CellParaClient.cs
- smtpconnection.cs
- securitymgrsite.cs
- XsltArgumentList.cs
- SafeNativeMethods.cs
- DataObjectCopyingEventArgs.cs
- SystemIPGlobalProperties.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- UIElementParaClient.cs
- LockingPersistenceProvider.cs
- SynchronizationLockException.cs
- COAUTHIDENTITY.cs
- Root.cs
- HttpCookiesSection.cs
- PagerSettings.cs
- EventListener.cs
- AnnotationHelper.cs
- ResXDataNode.cs
- HtmlContainerControl.cs
- ObjectIDGenerator.cs
- File.cs
- BindableTemplateBuilder.cs
- HttpWrapper.cs
- RoutedCommand.cs
- srgsitem.cs
- WindowsTokenRoleProvider.cs
- FixedSOMElement.cs
- WebPartManagerDesigner.cs
- FlagPanel.cs
- PropertySourceInfo.cs
- EncodingInfo.cs
- CollectionBase.cs
- Line.cs
- DataGridViewCellCollection.cs