Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- BrowserCapabilitiesCompiler.cs
- RenameRuleObjectDialog.Designer.cs
- TemplatedAdorner.cs
- LoginDesigner.cs
- EntityDataSourceUtil.cs
- DelegatedStream.cs
- DBCommandBuilder.cs
- SettingsProperty.cs
- TablePatternIdentifiers.cs
- AssemblyCache.cs
- WebPartEditorCancelVerb.cs
- ServiceOperationInfoTypeConverter.cs
- WsdlInspector.cs
- CollectionChangeEventArgs.cs
- Size3DConverter.cs
- webclient.cs
- TextHidden.cs
- HttpRequestCacheValidator.cs
- RuntimeHandles.cs
- Math.cs
- PropertyInfoSet.cs
- RootAction.cs
- TimerElapsedEvenArgs.cs
- TileBrush.cs
- TimelineGroup.cs
- exports.cs
- GridViewCancelEditEventArgs.cs
- Command.cs
- ErasingStroke.cs
- BitmapCodecInfoInternal.cs
- EventManager.cs
- ListItemCollection.cs
- UserValidatedEventArgs.cs
- PartialArray.cs
- ProtocolsConfiguration.cs
- HealthMonitoringSectionHelper.cs
- AcceleratedTokenAuthenticator.cs
- QueueSurrogate.cs
- QilLoop.cs
- TypeSystemProvider.cs
- XmlSchemaObjectTable.cs
- MergeFilterQuery.cs
- DataSetUtil.cs
- PolyQuadraticBezierSegment.cs
- FrameworkElementFactoryMarkupObject.cs
- StorageModelBuildProvider.cs
- Stackframe.cs
- ListenerConnectionModeReader.cs
- LassoSelectionBehavior.cs
- Menu.cs
- XmlQueryRuntime.cs
- CompilationLock.cs
- LoadedOrUnloadedOperation.cs
- DbConvert.cs
- Membership.cs
- CaseExpr.cs
- PreProcessor.cs
- OpenFileDialog.cs
- ModuleBuilderData.cs
- MembershipAdapter.cs
- XDeferredAxisSource.cs
- ResourceReferenceExpressionConverter.cs
- EventlogProvider.cs
- PromptStyle.cs
- StringDictionaryEditor.cs
- ClientScriptManager.cs
- XmlDownloadManager.cs
- AssemblyContextControlItem.cs
- BamlLocalizableResourceKey.cs
- webbrowsersite.cs
- Bitmap.cs
- Encoding.cs
- StringInfo.cs
- CapacityStreamGeometryContext.cs
- MenuItemBindingCollection.cs
- OpenFileDialog.cs
- LinkDescriptor.cs
- IdentitySection.cs
- AudioFormatConverter.cs
- HandlerFactoryCache.cs
- SqlReferenceCollection.cs
- SystemIPv4InterfaceProperties.cs
- EmptyEnumerator.cs
- Internal.cs
- Query.cs
- ContainerActivationHelper.cs
- DBDataPermissionAttribute.cs
- RtfToXamlLexer.cs
- BitmapMetadataEnumerator.cs
- listitem.cs
- ImplicitInputBrush.cs
- GeneralTransform3DGroup.cs
- CultureSpecificStringDictionary.cs
- MenuCommand.cs
- PropertyMetadata.cs
- ViewStateModeByIdAttribute.cs
- MetadataPropertyvalue.cs
- SizeConverter.cs
- WriteStateInfoBase.cs
- SqlNodeTypeOperators.cs