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
- OdbcEnvironmentHandle.cs
- ListBase.cs
- StyleSheetComponentEditor.cs
- CalendarBlackoutDatesCollection.cs
- XmlSerializationGeneratedCode.cs
- ThemeConfigurationDialog.cs
- SamlConstants.cs
- OuterGlowBitmapEffect.cs
- BindingsCollection.cs
- ErrorHandlingReceiver.cs
- SecurityHelper.cs
- NativeMethods.cs
- ContextStaticAttribute.cs
- ToolTipAutomationPeer.cs
- DataGridView.cs
- DomNameTable.cs
- InvalidWMPVersionException.cs
- XmlSchemaExternal.cs
- DocumentGridContextMenu.cs
- NetDataContractSerializer.cs
- UnmanagedHandle.cs
- Vector3DCollection.cs
- PropertyInformationCollection.cs
- CodeBinaryOperatorExpression.cs
- DynamicFilterExpression.cs
- SpotLight.cs
- LinearGradientBrush.cs
- GetIsBrowserClientRequest.cs
- QilIterator.cs
- EntityDescriptor.cs
- _KerberosClient.cs
- NamespaceList.cs
- Missing.cs
- StyleCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- CqlBlock.cs
- Rule.cs
- SmiGettersStream.cs
- WorkflowInstanceContextProvider.cs
- HtmlTableRowCollection.cs
- MultiDataTrigger.cs
- TextParaClient.cs
- FastEncoderWindow.cs
- EdmType.cs
- TransformerInfoCollection.cs
- SQLInt64Storage.cs
- StructuredType.cs
- SQLDateTimeStorage.cs
- PeerChannelListener.cs
- ellipse.cs
- AuthenticationService.cs
- OdbcError.cs
- panel.cs
- TraceContext.cs
- CodeDomSerializerBase.cs
- ToolStripActionList.cs
- OutputChannelBinder.cs
- XmlAnyElementAttribute.cs
- ExceptionHandler.cs
- DataGridViewLayoutData.cs
- KnownColorTable.cs
- RowToFieldTransformer.cs
- RegistrySecurity.cs
- TypeContext.cs
- Sequence.cs
- UserPreferenceChangingEventArgs.cs
- SequenceFullException.cs
- DataGridViewTextBoxColumn.cs
- DataGridItemCollection.cs
- LogicalTreeHelper.cs
- XmlText.cs
- ConfigurationSectionGroup.cs
- CodeCatchClauseCollection.cs
- PriorityBindingExpression.cs
- PropertyGroupDescription.cs
- SoapClientProtocol.cs
- AccessorTable.cs
- AnnotationResource.cs
- StreamWriter.cs
- EraserBehavior.cs
- XmlBoundElement.cs
- PresentationTraceSources.cs
- HtmlInputPassword.cs
- SQLMoney.cs
- CompModSwitches.cs
- SQlBooleanStorage.cs
- HtmlInputHidden.cs
- EventSinkActivityDesigner.cs
- DataGridView.cs
- ResourceReferenceExpressionConverter.cs
- XmlNode.cs
- DataTransferEventArgs.cs
- TcpAppDomainProtocolHandler.cs
- ResourcePermissionBaseEntry.cs
- DataGridColumnCollectionEditor.cs
- securitycriticaldataformultiplegetandset.cs
- DataStreamFromComStream.cs
- XdrBuilder.cs
- ControlIdConverter.cs
- ControlsConfig.cs