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
- SqlDataSourceTableQuery.cs
- CannotUnloadAppDomainException.cs
- DetailsViewDeletedEventArgs.cs
- SamlAuthenticationStatement.cs
- WindowsPen.cs
- RadioButtonList.cs
- ExpressionBuilderContext.cs
- ToolStripDropDownMenu.cs
- DbParameterCollectionHelper.cs
- SkewTransform.cs
- MappingMetadataHelper.cs
- XmlSchemaIdentityConstraint.cs
- DataGridViewRow.cs
- RoleGroupCollectionEditor.cs
- InvalidDataException.cs
- DaylightTime.cs
- BasePattern.cs
- SessionStateUtil.cs
- X509ChainElement.cs
- MetadataItemEmitter.cs
- DesignBindingPicker.cs
- TextParentUndoUnit.cs
- Binding.cs
- ProtectedProviderSettings.cs
- PrivilegeNotHeldException.cs
- DataKeyArray.cs
- CompleteWizardStep.cs
- SecurityTokenSpecification.cs
- RuntimeEnvironment.cs
- AppDomainAttributes.cs
- ContextDataSourceContextData.cs
- GenericTypeParameterConverter.cs
- UiaCoreTypesApi.cs
- XAMLParseException.cs
- FullTextLine.cs
- Literal.cs
- SectionXmlInfo.cs
- _Win32.cs
- Evidence.cs
- SchemaTypeEmitter.cs
- DispatcherProcessingDisabled.cs
- NamedPermissionSet.cs
- SessionStateUtil.cs
- DrawingContext.cs
- TemplateKeyConverter.cs
- ConvertEvent.cs
- URLString.cs
- SQLInt64Storage.cs
- ChangeConflicts.cs
- XPathPatternBuilder.cs
- OleDbErrorCollection.cs
- MouseActionValueSerializer.cs
- EFColumnProvider.cs
- EditingCommands.cs
- HtmlMeta.cs
- ProfilePropertySettingsCollection.cs
- PartitionedStreamMerger.cs
- MouseOverProperty.cs
- MouseEventArgs.cs
- DiagnosticsConfiguration.cs
- Parameter.cs
- OleDbError.cs
- BindingExpressionUncommonField.cs
- SystemDiagnosticsSection.cs
- Normalization.cs
- EnterpriseServicesHelper.cs
- QuarticEase.cs
- AnnotationService.cs
- PageThemeParser.cs
- DateRangeEvent.cs
- XmlSchemaSequence.cs
- WasNotInstalledException.cs
- TableProvider.cs
- WinCategoryAttribute.cs
- PartitionResolver.cs
- __FastResourceComparer.cs
- GcSettings.cs
- CodeMemberField.cs
- GenericPrincipal.cs
- IdnMapping.cs
- MissingFieldException.cs
- Expressions.cs
- DebugView.cs
- ColumnResizeAdorner.cs
- XmlSchemaSimpleTypeRestriction.cs
- FtpWebRequest.cs
- EndPoint.cs
- ColumnPropertiesGroup.cs
- PerformanceCounterCategory.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- ObjectRef.cs
- UidManager.cs
- ScrollItemProviderWrapper.cs
- GetPageCompletedEventArgs.cs
- PlanCompilerUtil.cs
- ACL.cs
- PowerModeChangedEventArgs.cs
- DependencyObjectProvider.cs
- RegistryKey.cs
- CodeTypeReferenceExpression.cs