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
- AudioStateChangedEventArgs.cs
- EDesignUtil.cs
- CheckBoxList.cs
- Parser.cs
- CodeMemberProperty.cs
- ObjectSerializerFactory.cs
- SqlTriggerContext.cs
- KeyedCollection.cs
- ProtocolsConfigurationEntry.cs
- SecurityTimestamp.cs
- ConnectionPoolManager.cs
- RenderData.cs
- PermissionSetEnumerator.cs
- ReflectionUtil.cs
- MenuBase.cs
- SqlCommand.cs
- FamilyMap.cs
- ToolboxComponentsCreatedEventArgs.cs
- DecimalKeyFrameCollection.cs
- Common.cs
- PageParser.cs
- Binding.cs
- DuplicateWaitObjectException.cs
- TransformCryptoHandle.cs
- PerformanceCountersElement.cs
- CalendarKeyboardHelper.cs
- HostedElements.cs
- XmlDocumentFieldSchema.cs
- ImportedNamespaceContextItem.cs
- ManagementInstaller.cs
- PathData.cs
- ResourceProviderFactory.cs
- DecimalConstantAttribute.cs
- figurelengthconverter.cs
- CharEnumerator.cs
- PartialTrustVisibleAssembliesSection.cs
- ColumnResult.cs
- AdCreatedEventArgs.cs
- Point3DCollection.cs
- DataListItemCollection.cs
- JulianCalendar.cs
- ProcessRequestArgs.cs
- ObjectNotFoundException.cs
- EntityTypeEmitter.cs
- DataSourceView.cs
- ExtenderProvidedPropertyAttribute.cs
- PassportAuthenticationModule.cs
- ItemType.cs
- SQLDecimal.cs
- PathStreamGeometryContext.cs
- NetCodeGroup.cs
- WmlSelectionListAdapter.cs
- VisualCollection.cs
- FieldToken.cs
- StylusPointDescription.cs
- FormsAuthenticationTicket.cs
- PolicyChain.cs
- NetworkInterface.cs
- SchemaAttDef.cs
- XmlWriterTraceListener.cs
- InternalDispatchObject.cs
- AutoGeneratedFieldProperties.cs
- DropDownList.cs
- NamespaceDecl.cs
- PersonalizationProviderCollection.cs
- SoapFault.cs
- IEnumerable.cs
- DetailsViewRow.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- SmtpMail.cs
- NavigationFailedEventArgs.cs
- Invariant.cs
- ClientOptions.cs
- TransformValueSerializer.cs
- TextProviderWrapper.cs
- ZeroOpNode.cs
- KnownBoxes.cs
- SaveWorkflowCommand.cs
- XmlTextAttribute.cs
- ImportedNamespaceContextItem.cs
- NumberSubstitution.cs
- VirtualizedContainerService.cs
- InstalledFontCollection.cs
- Registry.cs
- QilName.cs
- WebUtil.cs
- KeyInterop.cs
- HighlightComponent.cs
- DelegateSerializationHolder.cs
- SimpleFieldTemplateFactory.cs
- WindowsFont.cs
- ListView.cs
- Vector.cs
- ToolTip.cs
- HtmlInputPassword.cs
- CopyAction.cs
- ModuleConfigurationInfo.cs
- MenuAutomationPeer.cs
- ObservableDictionary.cs
- XmlSchemaComplexContent.cs