Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //[....] //----------------------------------------------------------------------------- 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
- SystemUdpStatistics.cs
- BufferedReadStream.cs
- ProxyAttribute.cs
- DataServiceException.cs
- SqlUnionizer.cs
- XmlMtomReader.cs
- Base64Encoder.cs
- Base64Encoder.cs
- ShadowGlyph.cs
- DeviceContext2.cs
- SvcMapFile.cs
- Listbox.cs
- DataServiceRequestArgs.cs
- HandlerBase.cs
- GorillaCodec.cs
- RangeBase.cs
- TableAutomationPeer.cs
- Ray3DHitTestResult.cs
- PackageStore.cs
- DataSourceViewSchemaConverter.cs
- ObjectManager.cs
- EncodingNLS.cs
- ValueSerializerAttribute.cs
- ChannelServices.cs
- DetailsViewPagerRow.cs
- CompilationUnit.cs
- ValueChangedEventManager.cs
- WebServiceReceiveDesigner.cs
- ThemeInfoAttribute.cs
- LineServices.cs
- CodeTypeDeclaration.cs
- ProcessProtocolHandler.cs
- HttpModuleActionCollection.cs
- Stroke.cs
- Image.cs
- ParseChildrenAsPropertiesAttribute.cs
- ContentPresenter.cs
- CursorInteropHelper.cs
- SoapBinding.cs
- TableLayoutStyle.cs
- smtppermission.cs
- VSWCFServiceContractGenerator.cs
- ServiceParser.cs
- ZipIOLocalFileHeader.cs
- GlobalProxySelection.cs
- FactoryMaker.cs
- Literal.cs
- Component.cs
- WindowInteropHelper.cs
- XmlSchemaComplexContentExtension.cs
- WindowsListViewSubItem.cs
- Visual3DCollection.cs
- RecipientInfo.cs
- PolicyReader.cs
- XsltException.cs
- PathData.cs
- HMACSHA1.cs
- AliasedSlot.cs
- ThreadStartException.cs
- DataControlField.cs
- DictionaryGlobals.cs
- TypeConverterHelper.cs
- HtmlToClrEventProxy.cs
- Symbol.cs
- CheckBoxField.cs
- HttpHeaderCollection.cs
- CollectionViewProxy.cs
- DCSafeHandle.cs
- ScrollBar.cs
- TransactionsSectionGroup.cs
- SponsorHelper.cs
- PropertyInfoSet.cs
- SourceChangedEventArgs.cs
- base64Transforms.cs
- DataProtection.cs
- RequestCache.cs
- XmlSchemaAnyAttribute.cs
- Rights.cs
- AnimationLayer.cs
- ConvertEvent.cs
- FacetChecker.cs
- WorkingDirectoryEditor.cs
- Tokenizer.cs
- BackgroundWorker.cs
- PartitionerStatic.cs
- Stack.cs
- PenThread.cs
- IPEndPoint.cs
- FormsIdentity.cs
- KnownTypes.cs
- ActiveXHost.cs
- TokenizerHelper.cs
- RtfNavigator.cs
- FloatUtil.cs
- VariantWrapper.cs
- BaseContextMenu.cs
- _TransmitFileOverlappedAsyncResult.cs
- InternalSafeNativeMethods.cs
- Base64Decoder.cs
- SoapReflectionImporter.cs