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
- SoapSchemaImporter.cs
- CounterSample.cs
- DoubleAverageAggregationOperator.cs
- RequiredFieldValidator.cs
- HierarchicalDataBoundControl.cs
- SQLDouble.cs
- ServiceContractListItemList.cs
- MD5CryptoServiceProvider.cs
- RemotingConfiguration.cs
- XmlSchemaObjectCollection.cs
- WebUtil.cs
- OracleLob.cs
- Win32Exception.cs
- TableRow.cs
- WebBrowserNavigatingEventHandler.cs
- AuthenticationModulesSection.cs
- WithParamAction.cs
- LingerOption.cs
- ValueUtilsSmi.cs
- XmlDataCollection.cs
- PreservationFileReader.cs
- AmbientEnvironment.cs
- PropertyGeneratedEventArgs.cs
- TypeToken.cs
- PlainXmlWriter.cs
- DrawingGroup.cs
- RoleGroupCollection.cs
- Cursor.cs
- OrderByQueryOptionExpression.cs
- Dispatcher.cs
- InternalControlCollection.cs
- Context.cs
- ComponentRenameEvent.cs
- XmlText.cs
- ProgressBar.cs
- XmlAutoDetectWriter.cs
- ConfigurationManagerInternal.cs
- BulletedList.cs
- ControlCollection.cs
- ObjectSet.cs
- ObjectConverter.cs
- VisualProxy.cs
- CompilerParameters.cs
- SecureConversationServiceCredential.cs
- OptionUsage.cs
- BinaryObjectInfo.cs
- GridEntry.cs
- ADMembershipProvider.cs
- CngKeyBlobFormat.cs
- ScrollEvent.cs
- WeakReadOnlyCollection.cs
- Win32Native.cs
- Transaction.cs
- DataSourceControlBuilder.cs
- WebBrowserProgressChangedEventHandler.cs
- ThemeInfoAttribute.cs
- EventProvider.cs
- SystemColorTracker.cs
- GatewayIPAddressInformationCollection.cs
- SqlMetaData.cs
- MenuItemBinding.cs
- RowCache.cs
- UnsafeNativeMethodsPenimc.cs
- BaseDataListDesigner.cs
- ClientProxyGenerator.cs
- RadioButtonStandardAdapter.cs
- XmlCollation.cs
- PackageStore.cs
- ResXBuildProvider.cs
- Vector3DValueSerializer.cs
- FormatterConverter.cs
- ListViewUpdateEventArgs.cs
- XmlBinaryReader.cs
- ProgressBar.cs
- FixedSOMTableRow.cs
- CodeTypeParameter.cs
- GifBitmapDecoder.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- ScriptManager.cs
- ReaderOutput.cs
- SoapTypeAttribute.cs
- QualifiedCellIdBoolean.cs
- ExpandedWrapper.cs
- FixedSOMImage.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- InvalidOperationException.cs
- recordstatefactory.cs
- TripleDES.cs
- OpenTypeLayoutCache.cs
- DataGridPagerStyle.cs
- BasePropertyDescriptor.cs
- SequentialUshortCollection.cs
- ViewCellSlot.cs
- Point3DCollection.cs
- DoubleAnimationUsingPath.cs
- TypeSemantics.cs
- CompilationUtil.cs
- FastPropertyAccessor.cs
- EntityDataSource.cs
- TextEditorCopyPaste.cs