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
- WebPartEditorApplyVerb.cs
- PerformanceCounter.cs
- DropShadowEffect.cs
- HttpCookiesSection.cs
- DataGridViewHeaderCell.cs
- RowToParametersTransformer.cs
- OperandQuery.cs
- MatrixKeyFrameCollection.cs
- AttributeXamlType.cs
- DataControlCommands.cs
- odbcmetadatacollectionnames.cs
- PeerNodeAddress.cs
- SchemaNamespaceManager.cs
- AlignmentYValidation.cs
- CoreChannel.cs
- UmAlQuraCalendar.cs
- OdbcEnvironment.cs
- AdornerPresentationContext.cs
- ApplicationInfo.cs
- BufferManager.cs
- GroupQuery.cs
- PropertyManager.cs
- ScriptingWebServicesSectionGroup.cs
- securitycriticaldataClass.cs
- ShaderEffect.cs
- GuidelineSet.cs
- ColorPalette.cs
- HttpCookie.cs
- BatchServiceHost.cs
- IChannel.cs
- SqlBulkCopy.cs
- BitmapMetadata.cs
- RelativeSource.cs
- BitmapEffectGroup.cs
- EnumMember.cs
- ListParagraph.cs
- SelectedPathEditor.cs
- AsynchronousChannel.cs
- AsyncCompletedEventArgs.cs
- DataGridItemCollection.cs
- ContainerActivationHelper.cs
- NavigationPropertyEmitter.cs
- DataContractJsonSerializer.cs
- KeyValueConfigurationElement.cs
- HttpConfigurationSystem.cs
- RadioButtonStandardAdapter.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DesignerSerializerAttribute.cs
- DbMetaDataColumnNames.cs
- WindowsFormsSectionHandler.cs
- OutputCacheSection.cs
- Evidence.cs
- ToolStripOverflow.cs
- WebResourceUtil.cs
- AuthenticationService.cs
- DataObjectEventArgs.cs
- MouseWheelEventArgs.cs
- ReadWriteSpinLock.cs
- CodeSubDirectoriesCollection.cs
- RunWorkerCompletedEventArgs.cs
- TypeToken.cs
- SecurityHeaderElementInferenceEngine.cs
- BlurBitmapEffect.cs
- EmptyEnumerator.cs
- BevelBitmapEffect.cs
- CommandEventArgs.cs
- StylusButtonEventArgs.cs
- SeverityFilter.cs
- tibetanshape.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TrackingStringDictionary.cs
- RowToParametersTransformer.cs
- DrawingContextDrawingContextWalker.cs
- CacheMemory.cs
- EntityExpressionVisitor.cs
- BindingSource.cs
- TreeWalker.cs
- Stacktrace.cs
- ResourceExpression.cs
- ArgumentReference.cs
- MenuTracker.cs
- HttpContextBase.cs
- ImageListUtils.cs
- HttpStreamXmlDictionaryReader.cs
- Journaling.cs
- SortedList.cs
- LinkLabel.cs
- MouseBinding.cs
- TemplateParser.cs
- localization.cs
- WebConfigurationHost.cs
- safePerfProviderHandle.cs
- HtmlImage.cs
- PersonalizationStateInfo.cs
- TaiwanLunisolarCalendar.cs
- SqlFormatter.cs
- ErrorHandlerModule.cs
- TypeUnloadedException.cs
- UserControl.cs
- MenuAdapter.cs