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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DLinqColumnProvider.cs
- HtmlInputButton.cs
- XmlSchemaCollection.cs
- ToolboxSnapDragDropEventArgs.cs
- DataKeyCollection.cs
- Win32Interop.cs
- HatchBrush.cs
- SubpageParagraph.cs
- HwndSubclass.cs
- cache.cs
- TableLayoutPanelCellPosition.cs
- PingOptions.cs
- WebEncodingValidatorAttribute.cs
- ObjectStateEntry.cs
- VoiceSynthesis.cs
- SoapCodeExporter.cs
- XmlSerializationGeneratedCode.cs
- WindowAutomationPeer.cs
- InfocardChannelParameter.cs
- DataGridTextBoxColumn.cs
- UIElementPropertyUndoUnit.cs
- LineMetrics.cs
- DrawingVisualDrawingContext.cs
- ToolStripContainer.cs
- PeerInputChannelListener.cs
- ProcessModelInfo.cs
- Utility.cs
- RuleSetCollection.cs
- ProfileModule.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- CultureSpecificCharacterBufferRange.cs
- ProxySimple.cs
- RegexNode.cs
- WebPartCatalogAddVerb.cs
- TypeUsageBuilder.cs
- KnownIds.cs
- TextViewSelectionProcessor.cs
- HtmlTableRow.cs
- BooleanExpr.cs
- ConfigsHelper.cs
- Assert.cs
- HttpMethodConstraint.cs
- ClipboardProcessor.cs
- assertwrapper.cs
- ToolStripSeparator.cs
- AllMembershipCondition.cs
- PlatformCulture.cs
- ListViewTableRow.cs
- StringUtil.cs
- RectValueSerializer.cs
- FullTextState.cs
- PropertyGridView.cs
- VisualTarget.cs
- MailSettingsSection.cs
- ConditionBrowserDialog.cs
- OleDbFactory.cs
- BamlBinaryReader.cs
- PersonalizationAdministration.cs
- ListenerElementsCollection.cs
- MobileUserControl.cs
- PoisonMessageException.cs
- CachedFontFace.cs
- XmlDataSourceView.cs
- MouseDevice.cs
- SecureUICommand.cs
- CodeExporter.cs
- ValidationPropertyAttribute.cs
- WmfPlaceableFileHeader.cs
- SizeChangedInfo.cs
- SpinLock.cs
- PackWebResponse.cs
- ProxyOperationRuntime.cs
- TextEvent.cs
- GenericEnumerator.cs
- GPPOINTF.cs
- WriteTimeStream.cs
- Expr.cs
- oledbmetadatacolumnnames.cs
- PointLight.cs
- WebConfigurationManager.cs
- ListControlConvertEventArgs.cs
- SpellerError.cs
- _SslState.cs
- TreeViewImageKeyConverter.cs
- CodeTypeDeclarationCollection.cs
- TrackBarRenderer.cs
- TextElement.cs
- CacheAxisQuery.cs
- Package.cs
- PageOrientation.cs
- SqlBooleanMismatchVisitor.cs
- SafeRegistryHandle.cs
- Clipboard.cs
- TargetControlTypeAttribute.cs
- NoneExcludedImageIndexConverter.cs
- ConnectionInterfaceCollection.cs
- BuildProvidersCompiler.cs
- ListViewItem.cs
- PointCollectionValueSerializer.cs
- DbConnectionFactory.cs