Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ListViewItem.cs
- GeneralTransform3DGroup.cs
- TerminatorSinks.cs
- _RequestCacheProtocol.cs
- HtmlEmptyTagControlBuilder.cs
- BitmapDecoder.cs
- SamlEvidence.cs
- ObjectListCommand.cs
- WebConfigurationManager.cs
- ProviderIncompatibleException.cs
- TreeNodeClickEventArgs.cs
- ViewPort3D.cs
- IOException.cs
- SocketManager.cs
- ScriptReferenceEventArgs.cs
- SHA256CryptoServiceProvider.cs
- CodeCommentStatementCollection.cs
- FixedSOMPageConstructor.cs
- CultureInfoConverter.cs
- unsafenativemethodstextservices.cs
- RegisteredDisposeScript.cs
- XamlInt32CollectionSerializer.cs
- TextEditorSelection.cs
- WebServiceParameterData.cs
- TextElementCollection.cs
- ParsedAttributeCollection.cs
- SmiTypedGetterSetter.cs
- ColorAnimationUsingKeyFrames.cs
- OAVariantLib.cs
- ParallelLoopState.cs
- SecurityPolicySection.cs
- XmlSchemaSet.cs
- StateMachineHelpers.cs
- WmlSelectionListAdapter.cs
- DescendantOverDescendantQuery.cs
- BinaryUtilClasses.cs
- Vector3D.cs
- FormsAuthenticationTicket.cs
- RuntimeTransactionHandle.cs
- ResXResourceSet.cs
- IDataContractSurrogate.cs
- SocketException.cs
- UserPreferenceChangingEventArgs.cs
- ZipFileInfo.cs
- FixedPageProcessor.cs
- DocumentPageViewAutomationPeer.cs
- ContentValidator.cs
- SqlInternalConnection.cs
- RuleAction.cs
- SchemaNotation.cs
- DetailsViewUpdatedEventArgs.cs
- tooltip.cs
- TreeChangeInfo.cs
- ASCIIEncoding.cs
- DataGridPagerStyle.cs
- UntypedNullExpression.cs
- WebPartsPersonalization.cs
- SignatureSummaryDialog.cs
- Point4D.cs
- PointLight.cs
- TypeRestriction.cs
- OperationResponse.cs
- OleDbErrorCollection.cs
- SHA512Cng.cs
- AstTree.cs
- EventRoute.cs
- Header.cs
- PackageDigitalSignature.cs
- XmlLoader.cs
- AssemblyCache.cs
- Int64Storage.cs
- DataControlCommands.cs
- FtpCachePolicyElement.cs
- AnimationTimeline.cs
- SqlDataSource.cs
- SystemFonts.cs
- AnimationTimeline.cs
- ServiceModelConfigurationSection.cs
- ConstraintStruct.cs
- FixedSOMTableCell.cs
- IncrementalCompileAnalyzer.cs
- selecteditemcollection.cs
- TreeViewItem.cs
- InputGestureCollection.cs
- PassportAuthentication.cs
- ImageButton.cs
- TTSVoice.cs
- ImageDrawing.cs
- DataKeyCollection.cs
- SymLanguageVendor.cs
- PromptStyle.cs
- TextTreeText.cs
- PositiveTimeSpanValidator.cs
- SecurityUtils.cs
- CompareValidator.cs
- StringExpressionSet.cs
- ThreadPool.cs
- PageContentAsyncResult.cs
- DbConnectionHelper.cs
- HttpModuleActionCollection.cs