Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantBaseQuery.cs / 1305376 / 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
- EventSinkHelperWriter.cs
- TextHintingModeValidation.cs
- JpegBitmapDecoder.cs
- _emptywebproxy.cs
- IntSecurity.cs
- VersionValidator.cs
- ThicknessAnimationBase.cs
- RecognizedPhrase.cs
- ObservableDictionary.cs
- Misc.cs
- FrugalList.cs
- SqlDataSourceEnumerator.cs
- FixedPageAutomationPeer.cs
- Helper.cs
- QueryResponse.cs
- GcHandle.cs
- OleDbMetaDataFactory.cs
- SourceItem.cs
- VariantWrapper.cs
- Typeface.cs
- EndpointDispatcherTable.cs
- DataQuery.cs
- ArgumentOutOfRangeException.cs
- IdleTimeoutMonitor.cs
- CodeIterationStatement.cs
- SqlWorkflowPersistenceService.cs
- VisualBrush.cs
- XmlSchemaImporter.cs
- X509Utils.cs
- Attributes.cs
- Cursors.cs
- PrivacyNoticeBindingElementImporter.cs
- Rect.cs
- StylusButton.cs
- FrameworkElement.cs
- CFStream.cs
- PermissionAttributes.cs
- TrustLevelCollection.cs
- ServiceModelExtensionCollectionElement.cs
- ReadOnlyDataSourceView.cs
- SignatureHelper.cs
- DataTableMapping.cs
- DocumentSignatureManager.cs
- LinkConverter.cs
- PointConverter.cs
- TreeView.cs
- LoginName.cs
- Window.cs
- MarshalByValueComponent.cs
- ListCollectionView.cs
- StorageAssociationTypeMapping.cs
- PlaceHolder.cs
- EntityContainer.cs
- PlanCompilerUtil.cs
- TextBreakpoint.cs
- OracleRowUpdatingEventArgs.cs
- BufferModesCollection.cs
- SoapProcessingBehavior.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataDocumentXPathNavigator.cs
- ComboBoxItem.cs
- WebException.cs
- TableTextElementCollectionInternal.cs
- Matrix3DConverter.cs
- AssemblyGen.cs
- ListParagraph.cs
- Encoder.cs
- ChannelOptions.cs
- SessionStateUtil.cs
- CodeAccessPermission.cs
- FontEmbeddingManager.cs
- DataGridHeaderBorder.cs
- XmlSignatureProperties.cs
- EventDrivenDesigner.cs
- OletxDependentTransaction.cs
- SerializationObjectManager.cs
- AppLevelCompilationSectionCache.cs
- Command.cs
- TextTreeRootTextBlock.cs
- BrowserDefinition.cs
- StreamWriter.cs
- SkipQueryOptionExpression.cs
- UpdateRecord.cs
- InteropAutomationProvider.cs
- OutputWindow.cs
- LoadGrammarCompletedEventArgs.cs
- CopyAction.cs
- DataColumnPropertyDescriptor.cs
- ExtentKey.cs
- _Win32.cs
- MultiTrigger.cs
- StatusBarPanelClickEvent.cs
- CellQuery.cs
- InvalidComObjectException.cs
- UIPermission.cs
- ListBox.cs
- FontWeightConverter.cs
- MessageRpc.cs
- CompilerState.cs
- RepeatInfo.cs