Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SkewTransform.cs
- MenuItemAutomationPeer.cs
- XmlSchemaInferenceException.cs
- MatrixCamera.cs
- transactioncontext.cs
- TextServicesPropertyRanges.cs
- MissingMethodException.cs
- Content.cs
- OleDbEnumerator.cs
- SchemaCollectionCompiler.cs
- SmtpException.cs
- SafeRegistryKey.cs
- PaintValueEventArgs.cs
- MouseGestureValueSerializer.cs
- ByteStack.cs
- ToolStripSeparatorRenderEventArgs.cs
- XmlNavigatorStack.cs
- ColorConverter.cs
- RenderOptions.cs
- DataGridViewColumn.cs
- DocumentViewerBase.cs
- ValidationSummaryDesigner.cs
- CodeAccessSecurityEngine.cs
- CancelEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- _WinHttpWebProxyDataBuilder.cs
- Parameter.cs
- JulianCalendar.cs
- InvalidPrinterException.cs
- SqlConnection.cs
- DetailsViewCommandEventArgs.cs
- IgnoreSection.cs
- FileDialogPermission.cs
- DecimalAnimation.cs
- EncoderFallback.cs
- QfeChecker.cs
- SelectorItemAutomationPeer.cs
- DrawingContextWalker.cs
- CompilerGeneratedAttribute.cs
- X509SecurityTokenProvider.cs
- FlowDocumentReader.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- AnnotationResourceCollection.cs
- Point4D.cs
- RegexMatch.cs
- XmlNodeList.cs
- FlowLayoutPanel.cs
- NativeCompoundFileAPIs.cs
- HttpValueCollection.cs
- ConstraintStruct.cs
- PixelShader.cs
- QuotedPrintableStream.cs
- StatusStrip.cs
- XPathSelectionIterator.cs
- Connector.xaml.cs
- DynamicResourceExtension.cs
- ExecutionContext.cs
- HotSpot.cs
- PermissionRequestEvidence.cs
- ParserContext.cs
- ProfilePropertySettingsCollection.cs
- QueryStringConverter.cs
- FlatButtonAppearance.cs
- TaskCanceledException.cs
- FileReader.cs
- FakeModelItemImpl.cs
- LocalValueEnumerator.cs
- SerializationHelper.cs
- TypeSystemProvider.cs
- TraceListener.cs
- XMLSyntaxException.cs
- BufferedStream2.cs
- SeekableReadStream.cs
- XmlChildNodes.cs
- FontFamilyValueSerializer.cs
- OleDbStruct.cs
- PermissionSetEnumerator.cs
- NonNullItemCollection.cs
- HtmlPageAdapter.cs
- SqlConnectionString.cs
- SqlCaseSimplifier.cs
- CodeDirectoryCompiler.cs
- GradientBrush.cs
- CommonDialog.cs
- RenderContext.cs
- DataGridComponentEditor.cs
- SchemaElementLookUpTable.cs
- CapacityStreamGeometryContext.cs
- InvalidCastException.cs
- HostSecurityManager.cs
- SelectionHighlightInfo.cs
- ViewUtilities.cs
- SlipBehavior.cs
- MatrixIndependentAnimationStorage.cs
- WorkflowOwnershipException.cs
- CalendarKeyboardHelper.cs
- CacheVirtualItemsEvent.cs
- PathSegment.cs
- DocumentViewerBase.cs
- ReadOnlyDictionary.cs