Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataControlReference.cs
- DescendentsWalker.cs
- XmlObjectSerializerContext.cs
- SystemGatewayIPAddressInformation.cs
- dtdvalidator.cs
- WebPartDisplayModeCollection.cs
- ReferenceEqualityComparer.cs
- HwndSourceParameters.cs
- ProviderCollection.cs
- ActivityUtilities.cs
- DictionaryGlobals.cs
- CodeTypeReferenceExpression.cs
- ListItem.cs
- DataGridViewCheckBoxColumn.cs
- BooleanConverter.cs
- ThreadExceptionDialog.cs
- PropertyMetadata.cs
- CacheModeValueSerializer.cs
- ItemsControlAutomationPeer.cs
- RequiredFieldValidator.cs
- FrameworkElement.cs
- DataTableCollection.cs
- FontStyle.cs
- EmissiveMaterial.cs
- _FtpControlStream.cs
- ResizeBehavior.cs
- Mapping.cs
- XmlSchemaExternal.cs
- MonitorWrapper.cs
- StatusBarPanel.cs
- ListViewGroupCollectionEditor.cs
- AttributeCollection.cs
- TokenBasedSet.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- WCFModelStrings.Designer.cs
- PreDigestedSignedInfo.cs
- SelectionPattern.cs
- StringReader.cs
- AppDomainCompilerProxy.cs
- _SpnDictionary.cs
- ListViewItem.cs
- WorkflowPageSetupDialog.cs
- AsymmetricAlgorithm.cs
- NullExtension.cs
- XmlReaderDelegator.cs
- ContextStack.cs
- BinaryReader.cs
- TagPrefixCollection.cs
- HijriCalendar.cs
- EventProviderTraceListener.cs
- Inflater.cs
- XmlSchemaFacet.cs
- HttpCapabilitiesBase.cs
- SourceElementsCollection.cs
- MachineKeyValidationConverter.cs
- XmlElementCollection.cs
- SafeNativeMethodsOther.cs
- AutomationElementCollection.cs
- WebPartRestoreVerb.cs
- VisualStyleTypesAndProperties.cs
- InternalsVisibleToAttribute.cs
- EncoderReplacementFallback.cs
- TouchDevice.cs
- HtmlCommandAdapter.cs
- TreeNodeCollectionEditorDialog.cs
- BindingContext.cs
- XPathNavigator.cs
- TransferRequestHandler.cs
- VersionPair.cs
- PrintPreviewGraphics.cs
- DependencySource.cs
- RewritingProcessor.cs
- ByteStack.cs
- ValidationHelper.cs
- ProfileGroupSettings.cs
- SHA512Managed.cs
- ConnectionManagementElementCollection.cs
- MultiBindingExpression.cs
- XPathChildIterator.cs
- PropertyBuilder.cs
- Mappings.cs
- TextBoxRenderer.cs
- SapiRecognizer.cs
- JsonXmlDataContract.cs
- DiscoveryExceptionDictionary.cs
- FreezableCollection.cs
- TypeConverterValueSerializer.cs
- ReadOnlyMetadataCollection.cs
- ServiceChannelFactory.cs
- SqlDataSourceEnumerator.cs
- ParameterCollection.cs
- SizeConverter.cs
- SignatureHelper.cs
- PrintDialog.cs
- ExecutionEngineException.cs
- HtmlInputText.cs
- BinaryMethodMessage.cs
- OracleBinary.cs
- configsystem.cs
- OnOperation.cs