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
- itemelement.cs
- ElementMarkupObject.cs
- EntityDataSourceDataSelectionPanel.cs
- ChameleonKey.cs
- TreeNodeStyleCollection.cs
- FileIOPermission.cs
- Page.cs
- MethodImplAttribute.cs
- EllipseGeometry.cs
- RelationshipFixer.cs
- XmlWrappingReader.cs
- Attribute.cs
- FixedDocument.cs
- VoiceObjectToken.cs
- StringResourceManager.cs
- ToolStrip.cs
- QueryLifecycle.cs
- CodeComment.cs
- TimeZone.cs
- PublisherMembershipCondition.cs
- Converter.cs
- ClientSection.cs
- DCSafeHandle.cs
- selecteditemcollection.cs
- ConditionChanges.cs
- SelectedDatesCollection.cs
- JournalEntry.cs
- SqlUDTStorage.cs
- FunctionQuery.cs
- XPathDocumentBuilder.cs
- ComIntegrationManifestGenerator.cs
- LateBoundChannelParameterCollection.cs
- OrderedDictionary.cs
- DashStyle.cs
- SqlCacheDependencyDatabase.cs
- TableColumnCollection.cs
- StickyNoteAnnotations.cs
- ListBox.cs
- DataSourceCache.cs
- FixedFlowMap.cs
- ConfigurationManagerInternalFactory.cs
- XmlILIndex.cs
- RectAnimationClockResource.cs
- OdbcConnectionString.cs
- WebServiceData.cs
- PhysicalOps.cs
- DataGridViewColumnCollectionEditor.cs
- Encoding.cs
- PropertyInfo.cs
- SqlDataSourceCustomCommandPanel.cs
- SymLanguageVendor.cs
- JsonByteArrayDataContract.cs
- FastEncoder.cs
- CodeTypeReferenceCollection.cs
- ServiceOperation.cs
- XmlQueryStaticData.cs
- CultureInfo.cs
- XmlIncludeAttribute.cs
- GetWorkflowTree.cs
- PresentationAppDomainManager.cs
- MemoryMappedView.cs
- NavigationEventArgs.cs
- PropertyRecord.cs
- TraceXPathNavigator.cs
- EventSchemaTraceListener.cs
- SocketPermission.cs
- PartitionerStatic.cs
- XmlChoiceIdentifierAttribute.cs
- InputQueueChannel.cs
- MetadataCacheItem.cs
- RSAProtectedConfigurationProvider.cs
- Light.cs
- GridItem.cs
- Monitor.cs
- PropertyValueChangedEvent.cs
- SecurityKeyUsage.cs
- NavigationWindowAutomationPeer.cs
- DrawingDrawingContext.cs
- TypeValidationEventArgs.cs
- XmlWellformedWriterHelpers.cs
- PreservationFileReader.cs
- AuthenticationModulesSection.cs
- NativeMethods.cs
- ObjectKeyFrameCollection.cs
- VersionPair.cs
- PropertyStore.cs
- ZipIORawDataFileBlock.cs
- DisposableCollectionWrapper.cs
- BitmapCodecInfo.cs
- BrowserPolicyValidator.cs
- ExpandoObject.cs
- LayoutEditorPart.cs
- GregorianCalendar.cs
- DesignerAutoFormatStyle.cs
- GatewayIPAddressInformationCollection.cs
- ComboBoxHelper.cs
- RijndaelManaged.cs
- DataGridViewSelectedRowCollection.cs
- WebPartAuthorizationEventArgs.cs
- PropertyPathConverter.cs