Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- FileCodeGroup.cs
- SessionIDManager.cs
- BoundColumn.cs
- Documentation.cs
- ConfigXmlCDataSection.cs
- LookupNode.cs
- SortKey.cs
- RoleManagerSection.cs
- MdImport.cs
- ClientUtils.cs
- XmlComplianceUtil.cs
- SyndicationSerializer.cs
- XmlTypeMapping.cs
- ScriptResourceHandler.cs
- SponsorHelper.cs
- XmlSerializableServices.cs
- ThicknessAnimation.cs
- TcpDuplicateContext.cs
- WorkflowDefinitionDispenser.cs
- MasterPageCodeDomTreeGenerator.cs
- Material.cs
- WindowsAltTab.cs
- ToolStripPanelCell.cs
- MatrixUtil.cs
- NamespaceList.cs
- DelegatedStream.cs
- Resources.Designer.cs
- DecoderReplacementFallback.cs
- IteratorFilter.cs
- ListViewGroup.cs
- OpenTypeCommon.cs
- ApplicationHost.cs
- PersonalizableAttribute.cs
- BamlTreeUpdater.cs
- WindowsSecurityTokenAuthenticator.cs
- StateDesigner.Layouts.cs
- SectionInformation.cs
- UIElement3D.cs
- COM2ExtendedTypeConverter.cs
- ExpressionBindingCollection.cs
- ActionItem.cs
- OdbcHandle.cs
- OneOfElement.cs
- WebPart.cs
- WebMessageFormatHelper.cs
- DataGridPagerStyle.cs
- DefaultEvaluationContext.cs
- ComplexBindingPropertiesAttribute.cs
- TemplatedWizardStep.cs
- ISFTagAndGuidCache.cs
- XmlSchemaImport.cs
- DataControlFieldCell.cs
- SchemaElement.cs
- ComplexType.cs
- InputMethodStateTypeInfo.cs
- XmlSignificantWhitespace.cs
- PropertyNames.cs
- DetailsViewPageEventArgs.cs
- EntityDataSourceSelectedEventArgs.cs
- MLangCodePageEncoding.cs
- QilPatternFactory.cs
- DataControlImageButton.cs
- ToolStripOverflow.cs
- OdbcTransaction.cs
- Int32Rect.cs
- SwitchAttribute.cs
- DataGridViewColumnStateChangedEventArgs.cs
- TextBox.cs
- BeginEvent.cs
- ExceptionUtil.cs
- AppDomainUnloadedException.cs
- MtomMessageEncoder.cs
- DeclaredTypeElementCollection.cs
- MouseButton.cs
- SqlRecordBuffer.cs
- DbProviderFactoriesConfigurationHandler.cs
- FileDialogCustomPlace.cs
- Bits.cs
- PageMediaType.cs
- TerminatorSinks.cs
- WebEncodingValidator.cs
- DuplicateMessageDetector.cs
- Int32EqualityComparer.cs
- CheckBoxField.cs
- ColorTransformHelper.cs
- IconEditor.cs
- BrowserCapabilitiesFactoryBase.cs
- CodeThrowExceptionStatement.cs
- NamespaceEmitter.cs
- TargetParameterCountException.cs
- DatagramAdapter.cs
- SafeArrayTypeMismatchException.cs
- VisemeEventArgs.cs
- EntityKeyElement.cs
- NotifyInputEventArgs.cs
- WindowsToolbar.cs
- CustomErrorsSection.cs
- ControlHelper.cs
- Ref.cs
- SmtpFailedRecipientsException.cs