Code:
/ DotNET / DotNET / 8.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
- InheritanceAttribute.cs
- HuffModule.cs
- InkCanvasSelection.cs
- HwndSubclass.cs
- AutomationIdentifier.cs
- DataControlCommands.cs
- EmptyStringExpandableObjectConverter.cs
- ComplexPropertyEntry.cs
- SQLSingle.cs
- WindowShowOrOpenTracker.cs
- KeyManager.cs
- InvariantComparer.cs
- SizeFConverter.cs
- XmlNullResolver.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SmtpNetworkElement.cs
- ToolStripItemCollection.cs
- CacheModeValueSerializer.cs
- SessionEndingCancelEventArgs.cs
- RoleServiceManager.cs
- ColorMap.cs
- OracleInternalConnection.cs
- TextRange.cs
- CredentialCache.cs
- MergePropertyDescriptor.cs
- SqlUserDefinedTypeAttribute.cs
- FacetDescriptionElement.cs
- Profiler.cs
- RootDesignerSerializerAttribute.cs
- DispatchWrapper.cs
- TextDecorations.cs
- NamespaceEmitter.cs
- XslException.cs
- DropSource.cs
- RegexCompiler.cs
- NativeMethods.cs
- AppDomainShutdownMonitor.cs
- Bits.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ManualResetEvent.cs
- HtmlSelect.cs
- TypeDelegator.cs
- DesignerGenericWebPart.cs
- Globals.cs
- DispatcherOperation.cs
- SkipStoryboardToFill.cs
- Size3D.cs
- PriorityItem.cs
- AnimationStorage.cs
- DataSourceHelper.cs
- ListContractAdapter.cs
- MobileListItem.cs
- RegexMatch.cs
- Int16.cs
- HuffModule.cs
- SymbolType.cs
- SystemInformation.cs
- DesignerLoader.cs
- Padding.cs
- AssemblySettingAttributes.cs
- HtmlInputImage.cs
- GeometryDrawing.cs
- StdRegProviderWrapper.cs
- SafeProcessHandle.cs
- Transform.cs
- DrawTreeNodeEventArgs.cs
- ControlPaint.cs
- DynamicDocumentPaginator.cs
- ReplyAdapterChannelListener.cs
- PropertyMap.cs
- BoundField.cs
- TextSelectionHighlightLayer.cs
- ActivityBindForm.cs
- DocobjHost.cs
- AdjustableArrowCap.cs
- ExceptionUtil.cs
- SetterBase.cs
- GridViewDeleteEventArgs.cs
- SendKeys.cs
- QueryCacheEntry.cs
- BaseProcessProtocolHandler.cs
- TextControlDesigner.cs
- XmlSchemaSimpleTypeList.cs
- SchemaEntity.cs
- designeractionlistschangedeventargs.cs
- TextServicesHost.cs
- HwndHostAutomationPeer.cs
- PageFunction.cs
- SafeEventLogReadHandle.cs
- ScrollBarAutomationPeer.cs
- ImageDrawing.cs
- HScrollBar.cs
- RunClient.cs
- EdmFunctionAttribute.cs
- ConfigurationConverterBase.cs
- DataStorage.cs
- ScriptReference.cs
- XmlNodeReader.cs
- MethodBuilder.cs
- HMACSHA384.cs