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
- ByValueEqualityComparer.cs
- ListenerElementsCollection.cs
- PrtCap_Base.cs
- ExpressionNode.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- CollectionChangedEventManager.cs
- XmlSchemas.cs
- HttpResponse.cs
- remotingproxy.cs
- SqlVisitor.cs
- SoapEnumAttribute.cs
- NamespaceInfo.cs
- SQLDateTimeStorage.cs
- TextBlock.cs
- SizeConverter.cs
- StoreContentChangedEventArgs.cs
- DoubleCollectionConverter.cs
- XPathDocumentNavigator.cs
- ServiceModelConfigurationSectionGroup.cs
- FixedNode.cs
- WindowsTreeView.cs
- Switch.cs
- SamlAssertionKeyIdentifierClause.cs
- EtwTrace.cs
- ItemMap.cs
- SettingsProviderCollection.cs
- SortQueryOperator.cs
- Image.cs
- IdentityManager.cs
- CorrelationQuery.cs
- FontInfo.cs
- XNodeNavigator.cs
- TimeSpanParse.cs
- XmlQualifiedNameTest.cs
- BitmapFrame.cs
- KeyConstraint.cs
- TextViewBase.cs
- AttributeEmitter.cs
- SqlUtil.cs
- UdpDuplexChannel.cs
- Compilation.cs
- SqlParameter.cs
- ImageCodecInfoPrivate.cs
- coordinatorscratchpad.cs
- BamlWriter.cs
- LocalizableAttribute.cs
- sortedlist.cs
- ActiveXMessageFormatter.cs
- StackOverflowException.cs
- CodeArrayIndexerExpression.cs
- EmptyControlCollection.cs
- TextEffect.cs
- CollectionViewGroupInternal.cs
- KoreanCalendar.cs
- ActivityExecutorSurrogate.cs
- CompatibleComparer.cs
- XmlNodeChangedEventArgs.cs
- SqlSelectStatement.cs
- TagNameToTypeMapper.cs
- SineEase.cs
- clipboard.cs
- LongSumAggregationOperator.cs
- Effect.cs
- Vector3DCollectionConverter.cs
- RayMeshGeometry3DHitTestResult.cs
- ParameterRetriever.cs
- TextTreeTextBlock.cs
- IUnknownConstantAttribute.cs
- OutKeywords.cs
- AddInEnvironment.cs
- EmptyReadOnlyDictionaryInternal.cs
- SizeValueSerializer.cs
- ReaderWriterLock.cs
- OrderedDictionaryStateHelper.cs
- MailWebEventProvider.cs
- DesignerAdapterAttribute.cs
- ConstructorNeedsTagAttribute.cs
- XmlElementList.cs
- NotImplementedException.cs
- DataBindEngine.cs
- ContentPropertyAttribute.cs
- UserMapPath.cs
- DocumentApplicationJournalEntry.cs
- FileIOPermission.cs
- SystemThemeKey.cs
- DbConnectionPoolIdentity.cs
- SqlUtils.cs
- Formatter.cs
- WindowsContainer.cs
- CodeAccessPermission.cs
- NotificationContext.cs
- SafeRegistryKey.cs
- RequestResizeEvent.cs
- ScrollData.cs
- XmlNode.cs
- ToggleButtonAutomationPeer.cs
- FilteredReadOnlyMetadataCollection.cs
- Propagator.ExtentPlaceholderCreator.cs
- _AutoWebProxyScriptEngine.cs
- DetailsView.cs