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
- EnlistmentTraceIdentifier.cs
- ComponentResourceKey.cs
- LazyTextWriterCreator.cs
- ScriptDescriptor.cs
- ThicknessAnimationBase.cs
- NativeMethods.cs
- DataGridViewImageCell.cs
- ImmutableCollection.cs
- DataContractAttribute.cs
- ListItem.cs
- SchemaSetCompiler.cs
- DataPagerCommandEventArgs.cs
- PropertyChangingEventArgs.cs
- SqlDataSourceCommandEventArgs.cs
- CornerRadiusConverter.cs
- PeerName.cs
- WebPartPersonalization.cs
- ChannelServices.cs
- TableLayoutPanelCellPosition.cs
- DataGridAutoFormat.cs
- SponsorHelper.cs
- CatalogUtil.cs
- DesignerSerializationVisibilityAttribute.cs
- Ref.cs
- LocationUpdates.cs
- _DisconnectOverlappedAsyncResult.cs
- XhtmlBasicFormAdapter.cs
- XamlDesignerSerializationManager.cs
- StorageMappingFragment.cs
- FunctionImportMapping.cs
- Simplifier.cs
- HtmlHead.cs
- PasswordTextContainer.cs
- UpdateTracker.cs
- DateTime.cs
- datacache.cs
- GridView.cs
- TextBoxAutomationPeer.cs
- Button.cs
- ToolboxComponentsCreatingEventArgs.cs
- SqlClientFactory.cs
- EntityTypeEmitter.cs
- XPathException.cs
- ByteStack.cs
- InstanceDataCollectionCollection.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- SendSecurityHeaderElement.cs
- XmlWrappingReader.cs
- Section.cs
- PageParser.cs
- CacheDependency.cs
- DependencyPropertyKind.cs
- COM2IProvidePropertyBuilderHandler.cs
- ParameterReplacerVisitor.cs
- SafeMILHandle.cs
- Funcletizer.cs
- CharacterString.cs
- WSMessageEncoding.cs
- InvalidOleVariantTypeException.cs
- EnumConverter.cs
- EventRoute.cs
- LiteralText.cs
- ReadWriteSpinLock.cs
- SqlInternalConnectionSmi.cs
- DefaultBinder.cs
- Path.cs
- Int16Converter.cs
- CssTextWriter.cs
- SafeFileMappingHandle.cs
- TrustLevelCollection.cs
- ImageList.cs
- HashRepartitionStream.cs
- validationstate.cs
- XmlAttributeCollection.cs
- ValueType.cs
- DbConnectionFactory.cs
- SafeFileMappingHandle.cs
- EDesignUtil.cs
- DeploymentSection.cs
- BeginEvent.cs
- MLangCodePageEncoding.cs
- Encoding.cs
- EndpointInfo.cs
- InputQueueChannel.cs
- TreeView.cs
- ColorAnimationBase.cs
- RequestNavigateEventArgs.cs
- WebBrowserBase.cs
- DocumentSchemaValidator.cs
- codemethodreferenceexpression.cs
- EntryPointNotFoundException.cs
- TreeNodeEventArgs.cs
- DocumentOrderQuery.cs
- TimeSpanSecondsConverter.cs
- TreeNode.cs
- XmlSchemaGroupRef.cs
- Stream.cs
- RadialGradientBrush.cs
- CommandHelper.cs
- CellTreeNode.cs