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
- RoutingChannelExtension.cs
- NaturalLanguageHyphenator.cs
- EdmScalarPropertyAttribute.cs
- SafeArrayTypeMismatchException.cs
- DataGridViewSortCompareEventArgs.cs
- Filter.cs
- Logging.cs
- DLinqColumnProvider.cs
- FormViewCommandEventArgs.cs
- GeometryCombineModeValidation.cs
- ListViewItem.cs
- MetadataPropertyAttribute.cs
- DefaultPrintController.cs
- TogglePattern.cs
- UnionExpr.cs
- DigitShape.cs
- FixedSOMFixedBlock.cs
- sqlnorm.cs
- WindowsButton.cs
- TagMapInfo.cs
- SocketSettings.cs
- HostingEnvironmentSection.cs
- TableHeaderCell.cs
- XmlStreamStore.cs
- Nullable.cs
- DrawingAttributes.cs
- SpecularMaterial.cs
- GcSettings.cs
- SessionStateItemCollection.cs
- BoundField.cs
- ServicesUtilities.cs
- XmlSchemaSet.cs
- ProtocolsConfigurationHandler.cs
- HtmlAnchor.cs
- NavigationExpr.cs
- RulePatternOps.cs
- TextRangeSerialization.cs
- Descriptor.cs
- AuthStoreRoleProvider.cs
- ArrayElementGridEntry.cs
- DiscoveryVersion.cs
- IncrementalHitTester.cs
- GridViewColumn.cs
- ListViewTableRow.cs
- ImageListStreamer.cs
- XmlUnspecifiedAttribute.cs
- CancellationTokenRegistration.cs
- RemoteWebConfigurationHost.cs
- StrokeCollection2.cs
- LinqDataSource.cs
- Stacktrace.cs
- AlphaSortedEnumConverter.cs
- ConnectionManager.cs
- TemplateBindingExtensionConverter.cs
- DataChangedEventManager.cs
- ByteConverter.cs
- TextProperties.cs
- _HTTPDateParse.cs
- DocumentApplicationJournalEntry.cs
- SqlCommandBuilder.cs
- AbstractExpressions.cs
- DependencyProperty.cs
- QueryCacheManager.cs
- NavigationPropertyEmitter.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- TdsParserStaticMethods.cs
- CodeLabeledStatement.cs
- CodeConstructor.cs
- FontFamilyValueSerializer.cs
- OutputCacheProfileCollection.cs
- SerializationHelper.cs
- AxisAngleRotation3D.cs
- UIElement3DAutomationPeer.cs
- PreviewPageInfo.cs
- CodeCommentStatementCollection.cs
- TokenizerHelper.cs
- PropertyDescriptorCollection.cs
- XslVisitor.cs
- TextReader.cs
- Point3DIndependentAnimationStorage.cs
- OdbcConnectionString.cs
- RTLAwareMessageBox.cs
- XmlToDatasetMap.cs
- BamlMapTable.cs
- IdentityNotMappedException.cs
- Section.cs
- DesigntimeLicenseContext.cs
- GeneralTransform2DTo3D.cs
- ProfileGroupSettingsCollection.cs
- TTSEngineProxy.cs
- SpAudioStreamWrapper.cs
- OracleBinary.cs
- DataGridViewIntLinkedList.cs
- ReadOnlyHierarchicalDataSource.cs
- TimelineClockCollection.cs
- SEHException.cs
- OleAutBinder.cs
- ControlBindingsConverter.cs
- CfgParser.cs
- BindingManagerDataErrorEventArgs.cs