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
- AuthorizationRuleCollection.cs
- PriorityBindingExpression.cs
- TextAction.cs
- Converter.cs
- RegistrySecurity.cs
- CreateUserWizard.cs
- GridViewRow.cs
- HostAdapter.cs
- PathFigureCollectionValueSerializer.cs
- QueryCursorEventArgs.cs
- XmlEnumAttribute.cs
- FlowDocumentFormatter.cs
- TransformProviderWrapper.cs
- EasingQuaternionKeyFrame.cs
- HttpProcessUtility.cs
- FontStyleConverter.cs
- SessionStateSection.cs
- Latin1Encoding.cs
- ClosableStream.cs
- FormParameter.cs
- SafeRightsManagementHandle.cs
- WrappedIUnknown.cs
- InternalCache.cs
- ComponentDispatcher.cs
- XmlDataImplementation.cs
- BigInt.cs
- Triangle.cs
- SqlDeflator.cs
- printdlgexmarshaler.cs
- EmptyEnumerable.cs
- SmiEventSink.cs
- IsolatedStorage.cs
- StateDesigner.TransitionInfo.cs
- ChangeTracker.cs
- Operators.cs
- StructuredTypeInfo.cs
- GroupBox.cs
- XmlTextReaderImpl.cs
- Operand.cs
- COM2Enum.cs
- Button.cs
- AdapterUtil.cs
- SQLDateTimeStorage.cs
- WindowsPrincipal.cs
- ReservationCollection.cs
- CompositeClientFormatter.cs
- SortAction.cs
- ViewBox.cs
- RowBinding.cs
- __Filters.cs
- DataKeyCollection.cs
- CodeIterationStatement.cs
- AuthenticationException.cs
- InvokeBinder.cs
- BinaryCommonClasses.cs
- MultiByteCodec.cs
- LayoutSettings.cs
- FormsAuthenticationTicket.cs
- XpsThumbnail.cs
- EncryptedKeyIdentifierClause.cs
- TextRunTypographyProperties.cs
- OleDbDataAdapter.cs
- EntityViewGenerationConstants.cs
- BasicKeyConstraint.cs
- CodeGeneratorOptions.cs
- ChildrenQuery.cs
- Label.cs
- WebPartDisplayModeEventArgs.cs
- ImmutableObjectAttribute.cs
- Environment.cs
- PriorityRange.cs
- SegmentInfo.cs
- UpdateEventArgs.cs
- CalendarAutomationPeer.cs
- WizardStepCollectionEditor.cs
- EastAsianLunisolarCalendar.cs
- XmlTextReader.cs
- SID.cs
- StylusOverProperty.cs
- DesignerOptionService.cs
- NameValueConfigurationElement.cs
- ContactManager.cs
- COM2IPerPropertyBrowsingHandler.cs
- ListItemConverter.cs
- httpserverutility.cs
- EDesignUtil.cs
- TextEditorSpelling.cs
- CursorConverter.cs
- ObjectComplexPropertyMapping.cs
- PropertyTab.cs
- OutputCacheSettings.cs
- TriState.cs
- VectorCollection.cs
- PersistencePipeline.cs
- ObjectDataSourceDesigner.cs
- VisualTreeUtils.cs
- WCFServiceClientProxyGenerator.cs
- OleDbPropertySetGuid.cs
- AnnotationResourceCollection.cs
- TextEffect.cs