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
- XmlSchemaImport.cs
- ButtonPopupAdapter.cs
- validation.cs
- RequestCachePolicy.cs
- Adorner.cs
- FixedSOMPageElement.cs
- PagesSection.cs
- DbModificationCommandTree.cs
- XmlReflectionImporter.cs
- EventData.cs
- PersonalizableTypeEntry.cs
- XmlConvert.cs
- TableHeaderCell.cs
- PerfCounterSection.cs
- SectionRecord.cs
- NativeMethods.cs
- TabletCollection.cs
- BooleanKeyFrameCollection.cs
- SHA512Cng.cs
- Color.cs
- DynamicDataManager.cs
- Expression.cs
- WebServiceParameterData.cs
- DataConnectionHelper.cs
- CodeCatchClause.cs
- TemplateField.cs
- CaseCqlBlock.cs
- SqlRecordBuffer.cs
- OdbcTransaction.cs
- ProvidersHelper.cs
- MimeTypeMapper.cs
- TreeBuilderBamlTranslator.cs
- DeploymentExceptionMapper.cs
- SymDocumentType.cs
- LinqDataSourceSelectEventArgs.cs
- _Win32.cs
- HwndSourceParameters.cs
- XmlStreamedByteStreamReader.cs
- PartManifestEntry.cs
- WindowsComboBox.cs
- FileUtil.cs
- ItemMap.cs
- SrgsSubset.cs
- PointValueSerializer.cs
- TextBoxAutoCompleteSourceConverter.cs
- HttpCapabilitiesSectionHandler.cs
- PieceNameHelper.cs
- DrawListViewItemEventArgs.cs
- EUCJPEncoding.cs
- SerializationFieldInfo.cs
- LayoutInformation.cs
- ListBox.cs
- EventLogLink.cs
- LinkedResourceCollection.cs
- DelegatingChannelListener.cs
- VirtualizingStackPanel.cs
- Drawing.cs
- Baml2006ReaderSettings.cs
- TabletDevice.cs
- ParserHooks.cs
- ParameterReplacerVisitor.cs
- Win32.cs
- SspiHelper.cs
- NetworkInformationException.cs
- _ListenerRequestStream.cs
- StylusShape.cs
- CommandID.cs
- LicFileLicenseProvider.cs
- ControlValuePropertyAttribute.cs
- RayMeshGeometry3DHitTestResult.cs
- SimpleHandlerFactory.cs
- AssociationProvider.cs
- ObjectViewQueryResultData.cs
- ToolStripTextBox.cs
- ExpressionQuoter.cs
- GridViewSortEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- FormCollection.cs
- CaseInsensitiveComparer.cs
- DoubleStorage.cs
- WmlPhoneCallAdapter.cs
- LinkedResourceCollection.cs
- NamedPipeConnectionPoolSettingsElement.cs
- IISMapPath.cs
- OleDbStruct.cs
- AddInActivator.cs
- ParameterModifier.cs
- DocumentSequence.cs
- WpfPayload.cs
- OdbcConnectionPoolProviderInfo.cs
- MimeAnyImporter.cs
- RegexBoyerMoore.cs
- LogManagementAsyncResult.cs
- SerialReceived.cs
- UniqueEventHelper.cs
- MenuAdapter.cs
- WindowsFormsHostAutomationPeer.cs
- CompletionCallbackWrapper.cs
- DbConnectionClosed.cs
- AssemblyLoader.cs