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
- Monitor.cs
- X509CertificateValidator.cs
- MultipleViewPatternIdentifiers.cs
- CollectionTypeElement.cs
- StorageBasedPackageProperties.cs
- LinkUtilities.cs
- WindowCollection.cs
- CompiledIdentityConstraint.cs
- StandardToolWindows.cs
- DispatchChannelSink.cs
- WindowClosedEventArgs.cs
- EditorZoneBase.cs
- DispatcherObject.cs
- FileClassifier.cs
- TableLayoutRowStyleCollection.cs
- AudienceUriMode.cs
- MatrixAnimationUsingPath.cs
- AutomationProperties.cs
- CallbackException.cs
- Logging.cs
- RectangleConverter.cs
- Transform.cs
- TrackPointCollection.cs
- LabelLiteral.cs
- HttpRequestWrapper.cs
- FormViewInsertEventArgs.cs
- ExpressionTable.cs
- ResourceDictionary.cs
- AnnotationHelper.cs
- CodeSubDirectory.cs
- PolicyStatement.cs
- PlainXmlWriter.cs
- ComponentEditorPage.cs
- AttributeCollection.cs
- FieldMetadata.cs
- Misc.cs
- Int32Rect.cs
- ProtocolImporter.cs
- MonthCalendar.cs
- FileDialog.cs
- RootBrowserWindowAutomationPeer.cs
- NumberFormatter.cs
- RequestNavigateEventArgs.cs
- PersonalizationStateInfoCollection.cs
- PathStreamGeometryContext.cs
- DateRangeEvent.cs
- StrokeDescriptor.cs
- ObjectStateEntryDbDataRecord.cs
- COM2ExtendedBrowsingHandler.cs
- Vector3D.cs
- XpsSerializationException.cs
- AtomParser.cs
- LogEntryUtils.cs
- ProvideValueServiceProvider.cs
- PnrpPermission.cs
- Int32Storage.cs
- ProtocolsConfigurationHandler.cs
- ViewGenResults.cs
- ToolStripScrollButton.cs
- File.cs
- FixedSOMLineRanges.cs
- AnnotationService.cs
- SaveFileDialog.cs
- HandlerWithFactory.cs
- FontFamilyConverter.cs
- DataObjectCopyingEventArgs.cs
- BindableAttribute.cs
- UserControlDocumentDesigner.cs
- PrintPreviewControl.cs
- AnimatedTypeHelpers.cs
- AmbiguousMatchException.cs
- Serializer.cs
- DiagnosticTraceSource.cs
- RepeaterItem.cs
- LabelLiteral.cs
- EmptyCollection.cs
- TextTreeInsertUndoUnit.cs
- PublishLicense.cs
- DoubleUtil.cs
- RangeValidator.cs
- CollectionViewGroup.cs
- DeobfuscatingStream.cs
- GenericTextProperties.cs
- Propagator.cs
- CodeObject.cs
- WebCategoryAttribute.cs
- TemplatedWizardStep.cs
- ValidationEventArgs.cs
- ServiceBuildProvider.cs
- TextPattern.cs
- RawStylusSystemGestureInputReport.cs
- SafeProcessHandle.cs
- ApplicationManager.cs
- SessionEndingEventArgs.cs
- ThreadExceptionEvent.cs
- AnnotationService.cs
- TextBlock.cs
- FillBehavior.cs
- CodeGotoStatement.cs
- AutomationFocusChangedEventArgs.cs