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
- OracleConnectionString.cs
- Cursor.cs
- MoveSizeWinEventHandler.cs
- x509store.cs
- ComNativeDescriptor.cs
- ConnectionPoolManager.cs
- CheckBoxBaseAdapter.cs
- DataGridViewAdvancedBorderStyle.cs
- UnmanagedMemoryStream.cs
- OperandQuery.cs
- GAC.cs
- PresentationAppDomainManager.cs
- Int32KeyFrameCollection.cs
- LayoutSettings.cs
- ComponentCommands.cs
- AllMembershipCondition.cs
- StyleModeStack.cs
- TextFindEngine.cs
- NameValueSectionHandler.cs
- XpsFilter.cs
- ColorDialog.cs
- ExtendedProperty.cs
- TextEndOfParagraph.cs
- MediaTimeline.cs
- ListBase.cs
- AuthenticateEventArgs.cs
- dataobject.cs
- ToolStripCodeDomSerializer.cs
- TextEndOfLine.cs
- EmptyElement.cs
- QueryOperationResponseOfT.cs
- AmbiguousMatchException.cs
- SafeRegistryKey.cs
- XmlFormatExtensionPointAttribute.cs
- WindowsListViewItem.cs
- PreservationFileWriter.cs
- Pkcs9Attribute.cs
- AnimationTimeline.cs
- InternalControlCollection.cs
- FontFamily.cs
- NonParentingControl.cs
- GatewayDefinition.cs
- PropertyEntry.cs
- Triangle.cs
- GroupQuery.cs
- DataGridViewColumnConverter.cs
- ArrayList.cs
- baseaxisquery.cs
- DeferredTextReference.cs
- Internal.cs
- FlowLayoutSettings.cs
- PolyLineSegmentFigureLogic.cs
- SiteIdentityPermission.cs
- PathGeometry.cs
- ComponentEditorPage.cs
- LocalBuilder.cs
- LongPath.cs
- SqlAggregateChecker.cs
- DefaultObjectMappingItemCollection.cs
- ApplicationCommands.cs
- SatelliteContractVersionAttribute.cs
- ProviderIncompatibleException.cs
- CodeDelegateCreateExpression.cs
- XmlSchemaDatatype.cs
- InstanceOwnerException.cs
- Italic.cs
- QilFactory.cs
- WmpBitmapEncoder.cs
- TextServicesPropertyRanges.cs
- KeyTime.cs
- DataGridViewCellMouseEventArgs.cs
- OdbcParameterCollection.cs
- WindowsScrollBar.cs
- LinkLabel.cs
- IsolatedStorage.cs
- FrameworkPropertyMetadata.cs
- DiagnosticTrace.cs
- Brush.cs
- HashHelper.cs
- DoneReceivingAsyncResult.cs
- OleDbParameter.cs
- HitTestWithPointDrawingContextWalker.cs
- DefaultBinder.cs
- Type.cs
- XmlSchemaAny.cs
- ChangesetResponse.cs
- RootBuilder.cs
- Attributes.cs
- CompilerErrorCollection.cs
- ReflectionUtil.cs
- SafeFileMapViewHandle.cs
- Schema.cs
- SrgsGrammar.cs
- XLinq.cs
- TaiwanCalendar.cs
- EnumType.cs
- FixedSOMTextRun.cs
- AsyncResult.cs
- ScaleTransform.cs
- DataGridViewColumn.cs