Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- TrackBarRenderer.cs
- EntityDataSourceContainerNameConverter.cs
- Events.cs
- CodeChecksumPragma.cs
- NameHandler.cs
- DeviceSpecificChoice.cs
- AssociativeAggregationOperator.cs
- OwnerDrawPropertyBag.cs
- ResolvedKeyFrameEntry.cs
- HtmlDocument.cs
- SoapHeaders.cs
- TemplateContentLoader.cs
- HttpListenerPrefixCollection.cs
- EncoderBestFitFallback.cs
- RuntimeCompatibilityAttribute.cs
- ChannelFactoryRefCache.cs
- RangeValidator.cs
- PipelineModuleStepContainer.cs
- IPHostEntry.cs
- TreeIterators.cs
- HostProtectionException.cs
- SqlColumnizer.cs
- RefreshResponseInfo.cs
- SimpleMailWebEventProvider.cs
- UserNameSecurityTokenProvider.cs
- FileLogRecordHeader.cs
- Axis.cs
- DateTimeFormatInfoScanner.cs
- UniqueEventHelper.cs
- CompModHelpers.cs
- dbdatarecord.cs
- DispatchProxy.cs
- Context.cs
- DefaultTextStoreTextComposition.cs
- SqlTriggerAttribute.cs
- BaseResourcesBuildProvider.cs
- SubMenuStyleCollection.cs
- ConfigurationLocation.cs
- BufferedGraphics.cs
- URLMembershipCondition.cs
- AncillaryOps.cs
- XmlNodeComparer.cs
- CookielessHelper.cs
- BitmapImage.cs
- RequestValidator.cs
- WindowsAuthenticationModule.cs
- TypeReference.cs
- MaterializeFromAtom.cs
- ObjectQuery.cs
- StrongNameKeyPair.cs
- SoapSchemaExporter.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- TypeExtensionSerializer.cs
- ClientTargetSection.cs
- ContentOperations.cs
- X509Utils.cs
- DeleteIndexBinder.cs
- RedirectionProxy.cs
- SingleSelectRootGridEntry.cs
- SmiGettersStream.cs
- SafeEventLogReadHandle.cs
- WebPartTransformer.cs
- XPathSelectionIterator.cs
- CapabilitiesState.cs
- EncryptedData.cs
- NeedSkipTokenVisitor.cs
- OdbcParameterCollection.cs
- PermissionSet.cs
- XomlDesignerLoader.cs
- ImmutableClientRuntime.cs
- LinearQuaternionKeyFrame.cs
- GenericFlowSwitchHelper.cs
- StyleHelper.cs
- _SafeNetHandles.cs
- WebDescriptionAttribute.cs
- DesigntimeLicenseContext.cs
- RtfToXamlReader.cs
- FixedPage.cs
- XmlDataSourceView.cs
- MetadataSource.cs
- ArrayElementGridEntry.cs
- BooleanConverter.cs
- OneOfConst.cs
- HttpListenerException.cs
- XmlException.cs
- DataServiceQueryOfT.cs
- AsnEncodedData.cs
- XmlDataCollection.cs
- FormatterServices.cs
- Line.cs
- FontFamilyConverter.cs
- BindingRestrictions.cs
- CommandBindingCollection.cs
- TranslateTransform3D.cs
- CircleHotSpot.cs
- DataAdapter.cs
- XmlMtomReader.cs
- MatrixTransform3D.cs
- OutputCacheSettings.cs
- MdImport.cs