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
- HttpModuleCollection.cs
- cryptoapiTransform.cs
- SafeNativeMethodsMilCoreApi.cs
- Canvas.cs
- PersistenceTypeAttribute.cs
- MasterPageBuildProvider.cs
- EntityContainerAssociationSetEnd.cs
- HtmlInputSubmit.cs
- DataKeyArray.cs
- KnownBoxes.cs
- baseaxisquery.cs
- CorePropertiesFilter.cs
- SmiEventSink_DeferedProcessing.cs
- UnsignedPublishLicense.cs
- Identifier.cs
- FastEncoder.cs
- DataGridCellClipboardEventArgs.cs
- Console.cs
- HTTPNotFoundHandler.cs
- DynamicQueryableWrapper.cs
- SrgsOneOf.cs
- LongTypeConverter.cs
- ModuleBuilder.cs
- HostProtectionException.cs
- EnumBuilder.cs
- NullToBooleanConverter.cs
- InputLanguageCollection.cs
- FontWeight.cs
- DrawingAttributeSerializer.cs
- EntityProviderServices.cs
- DiagnosticsConfiguration.cs
- _ConnectStream.cs
- QueryProcessor.cs
- GridItemPatternIdentifiers.cs
- SQLSingleStorage.cs
- SqlClientPermission.cs
- IPipelineRuntime.cs
- WorkflowApplicationCompletedException.cs
- SystemWebSectionGroup.cs
- FontNamesConverter.cs
- NamedPipeTransportSecurity.cs
- Bits.cs
- Deflater.cs
- PenCursorManager.cs
- ExpressionList.cs
- BrushMappingModeValidation.cs
- FormsAuthenticationEventArgs.cs
- SQLMembershipProvider.cs
- ComponentGlyph.cs
- EventSource.cs
- GetCryptoTransformRequest.cs
- MessageEnumerator.cs
- TreeNodeEventArgs.cs
- WebResponse.cs
- SynchronizedInputAdaptor.cs
- Transform.cs
- ReachUIElementCollectionSerializer.cs
- CommonDialog.cs
- InputScopeManager.cs
- DataBinder.cs
- KnownBoxes.cs
- XmlTextReaderImplHelpers.cs
- StrokeNodeOperations.cs
- CompilerWrapper.cs
- BufferedStream.cs
- HtmlHistory.cs
- DynamicQueryableWrapper.cs
- WindowsPrincipal.cs
- GC.cs
- StorageSetMapping.cs
- XmlCDATASection.cs
- ZoneLinkButton.cs
- QilGeneratorEnv.cs
- DetailsViewModeEventArgs.cs
- Vector3DCollectionValueSerializer.cs
- ISO2022Encoding.cs
- DiscoveryClientChannelBase.cs
- ComponentDispatcherThread.cs
- ImmutablePropertyDescriptorGridEntry.cs
- BrowserCapabilitiesFactory.cs
- GeneratedCodeAttribute.cs
- BaseResourcesBuildProvider.cs
- _emptywebproxy.cs
- FormView.cs
- WebPartTransformer.cs
- Constants.cs
- ViewValidator.cs
- ValidationErrorCollection.cs
- RedirectionProxy.cs
- KnownTypesHelper.cs
- Transform3DGroup.cs
- WebServiceParameterData.cs
- TableLayoutPanel.cs
- MachineKeySection.cs
- BitVec.cs
- CodeDomLoader.cs
- Point4D.cs
- SizeAnimationUsingKeyFrames.cs
- MaterialCollection.cs
- GroupStyle.cs