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
- StdValidatorsAndConverters.cs
- VirtualDirectoryMapping.cs
- CheckBoxAutomationPeer.cs
- DataGridSortCommandEventArgs.cs
- UnauthorizedAccessException.cs
- FontFamilyValueSerializer.cs
- WebServiceParameterData.cs
- BitFlagsGenerator.cs
- PopupRootAutomationPeer.cs
- WindowsListViewItem.cs
- ControlEvent.cs
- Item.cs
- Rijndael.cs
- LongSumAggregationOperator.cs
- EventListener.cs
- NumberAction.cs
- FloatUtil.cs
- ZipFileInfoCollection.cs
- HeaderUtility.cs
- DataViewManagerListItemTypeDescriptor.cs
- ScriptResourceMapping.cs
- Soap12ServerProtocol.cs
- IndexExpression.cs
- ExpressionBuilder.cs
- ConditionalAttribute.cs
- ZipIOExtraFieldPaddingElement.cs
- UpdateTranslator.cs
- ActivityDesignerResources.cs
- Button.cs
- CompositeFontFamily.cs
- BorderGapMaskConverter.cs
- DuplexChannelFactory.cs
- SqlSupersetValidator.cs
- ForAllOperator.cs
- MasterPageParser.cs
- TextTreeUndoUnit.cs
- RunClient.cs
- SafeNativeMethods.cs
- PeerNameRecord.cs
- UrlRoutingHandler.cs
- XmlChildEnumerator.cs
- KnownTypeAttribute.cs
- ContainerActivationHelper.cs
- NotifyParentPropertyAttribute.cs
- LocatorGroup.cs
- UrlPropertyAttribute.cs
- SerializationAttributes.cs
- ProfilePropertyNameValidator.cs
- DataGridViewElement.cs
- DataGridItemAttachedStorage.cs
- TypeInitializationException.cs
- HtmlTitle.cs
- TextAnchor.cs
- DCSafeHandle.cs
- Point3DKeyFrameCollection.cs
- SerializableAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- TTSEngineProxy.cs
- TagNameToTypeMapper.cs
- Underline.cs
- DescendantBaseQuery.cs
- JulianCalendar.cs
- _HeaderInfoTable.cs
- WSHttpBindingCollectionElement.cs
- ScrollBar.cs
- KeyInfo.cs
- Visual3D.cs
- DataGridViewCellStyle.cs
- HierarchicalDataBoundControl.cs
- storepermission.cs
- AddInDeploymentState.cs
- SqlDataSourceSelectingEventArgs.cs
- Int32RectConverter.cs
- FontFamilyConverter.cs
- ComponentSerializationService.cs
- EntityFrameworkVersions.cs
- ObjectConverter.cs
- FlowDocumentPageViewerAutomationPeer.cs
- SpeechAudioFormatInfo.cs
- XPathDocumentIterator.cs
- SmiContext.cs
- Int32AnimationUsingKeyFrames.cs
- InfiniteTimeSpanConverter.cs
- SortQueryOperator.cs
- SQLCharsStorage.cs
- WebPartPersonalization.cs
- BufferedReadStream.cs
- ToolStripDropTargetManager.cs
- XmlCharType.cs
- TypeProvider.cs
- FileDialog.cs
- DetailsViewActionList.cs
- ServicePoint.cs
- WebPartConnectionCollection.cs
- DataTableReader.cs
- XmlDictionaryString.cs
- EdmFunction.cs
- ExpressionConverter.cs
- EntityModelBuildProvider.cs
- ListControlStringCollectionEditor.cs