Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SafeHandles.cs
- RegexCompiler.cs
- SqlCacheDependency.cs
- CompilerGlobalScopeAttribute.cs
- ExpressionCopier.cs
- EdmItemError.cs
- X509Chain.cs
- DragAssistanceManager.cs
- RadioButtonRenderer.cs
- ComplexTypeEmitter.cs
- MutexSecurity.cs
- CmsInterop.cs
- OptimizedTemplateContentHelper.cs
- SafeEventHandle.cs
- UpdateExpressionVisitor.cs
- BaseParser.cs
- WebPartTracker.cs
- PageStatePersister.cs
- RoutedPropertyChangedEventArgs.cs
- SmtpMail.cs
- COM2ExtendedUITypeEditor.cs
- MultipartIdentifier.cs
- shaperfactory.cs
- WinInet.cs
- IOThreadTimer.cs
- DesignerHierarchicalDataSourceView.cs
- DocumentViewerAutomationPeer.cs
- EntryPointNotFoundException.cs
- BaseResourcesBuildProvider.cs
- CredentialCache.cs
- _NestedSingleAsyncResult.cs
- WebPermission.cs
- ProxyElement.cs
- TextEndOfSegment.cs
- Table.cs
- XmlValidatingReaderImpl.cs
- XPathMultyIterator.cs
- DataGridHeaderBorder.cs
- DataSourceControlBuilder.cs
- EditingCommands.cs
- ObjectCache.cs
- WebControl.cs
- BinHexEncoder.cs
- Keywords.cs
- PolyLineSegment.cs
- HuffmanTree.cs
- SplayTreeNode.cs
- FunctionQuery.cs
- RSAOAEPKeyExchangeFormatter.cs
- TdsRecordBufferSetter.cs
- ContainsRowNumberChecker.cs
- DiscoveryClientBindingElement.cs
- EntityDataSource.cs
- SizeConverter.cs
- IgnoreSectionHandler.cs
- Paragraph.cs
- XPathLexer.cs
- EdgeModeValidation.cs
- TextTreeText.cs
- DragDeltaEventArgs.cs
- _DisconnectOverlappedAsyncResult.cs
- compensatingcollection.cs
- WinFormsUtils.cs
- TdsEnums.cs
- LinkedList.cs
- BuildDependencySet.cs
- RadialGradientBrush.cs
- Converter.cs
- InputManager.cs
- ErrorStyle.cs
- TypeDescriptorContext.cs
- Attributes.cs
- KeyPressEvent.cs
- TriState.cs
- ToolStripDropDownClosedEventArgs.cs
- LabelEditEvent.cs
- WindowsSysHeader.cs
- WmpBitmapEncoder.cs
- TraceSource.cs
- SQLBinary.cs
- OdbcUtils.cs
- DirectoryGroupQuery.cs
- ColorKeyFrameCollection.cs
- Wow64ConfigurationLoader.cs
- InstanceCreationEditor.cs
- SecureUICommand.cs
- ActionMismatchAddressingException.cs
- Pair.cs
- QueryPageSettingsEventArgs.cs
- LostFocusEventManager.cs
- PropertyReferenceSerializer.cs
- ReadContentAsBinaryHelper.cs
- TraversalRequest.cs
- XhtmlConformanceSection.cs
- assemblycache.cs
- ImageAttributes.cs
- ColumnTypeConverter.cs
- _emptywebproxy.cs
- ToolZone.cs
- MemoryRecordBuffer.cs