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
- WpfPayload.cs
- ResourcesGenerator.cs
- PageCache.cs
- RelationshipEndCollection.cs
- StringKeyFrameCollection.cs
- SchemaImporterExtension.cs
- UiaCoreApi.cs
- MarshalByRefObject.cs
- SystemIPGlobalStatistics.cs
- TemplateNameScope.cs
- NotImplementedException.cs
- CounterSampleCalculator.cs
- FontConverter.cs
- HttpCapabilitiesSectionHandler.cs
- SizeConverter.cs
- AttachInfo.cs
- ConnectionManagementElementCollection.cs
- ArrangedElementCollection.cs
- ReliableOutputSessionChannel.cs
- CommandManager.cs
- Converter.cs
- ProxyWebPartConnectionCollection.cs
- StoreItemCollection.cs
- SqlFactory.cs
- Encoder.cs
- Memoizer.cs
- TextRangeBase.cs
- ADMembershipUser.cs
- NonParentingControl.cs
- HttpClientCertificate.cs
- SqlDataSourceFilteringEventArgs.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- AssertUtility.cs
- ServicePointManager.cs
- EnvironmentPermission.cs
- SystemIPInterfaceStatistics.cs
- DiscoveryViaBehavior.cs
- ProjectedSlot.cs
- KeyInterop.cs
- InstanceDataCollection.cs
- Profiler.cs
- ComponentEditorPage.cs
- LeaseManager.cs
- SR.cs
- DataContractSerializerOperationBehavior.cs
- ChildTable.cs
- FtpWebResponse.cs
- TextElement.cs
- PaintEvent.cs
- Brush.cs
- CodeObject.cs
- TrackingLocation.cs
- Table.cs
- FormView.cs
- EntityDataSource.cs
- ChameleonKey.cs
- MultiBindingExpression.cs
- Rectangle.cs
- AmbientValueAttribute.cs
- DESCryptoServiceProvider.cs
- XmlSchemaComplexContentExtension.cs
- TabletDevice.cs
- tibetanshape.cs
- NeutralResourcesLanguageAttribute.cs
- GenerateTemporaryTargetAssembly.cs
- CodeDomSerializer.cs
- SecurityContext.cs
- CroppedBitmap.cs
- ExpressionBindingCollection.cs
- RenderTargetBitmap.cs
- TemplateXamlTreeBuilder.cs
- SqlRemoveConstantOrderBy.cs
- DataGridTableCollection.cs
- _FtpDataStream.cs
- FocusChangedEventArgs.cs
- TemplateBamlRecordReader.cs
- CodeStatement.cs
- TraceEventCache.cs
- DataColumnMapping.cs
- VirtualDirectoryMappingCollection.cs
- CompatibleIComparer.cs
- PhysicalFontFamily.cs
- TiffBitmapEncoder.cs
- WebPartConnectionsCancelVerb.cs
- TraceListeners.cs
- nulltextcontainer.cs
- ProcessHost.cs
- ResourceAssociationType.cs
- DefinitionUpdate.cs
- IndexOutOfRangeException.cs
- TagMapCollection.cs
- TemplateParser.cs
- SystemFonts.cs
- AppDomainFactory.cs
- FixedNode.cs
- SizeValueSerializer.cs
- METAHEADER.cs
- GeneralTransform3DTo2D.cs
- KnownTypesHelper.cs
- CopyNodeSetAction.cs