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
- ImageDrawing.cs
- DataGridViewElement.cs
- HttpPostedFileBase.cs
- ZipIOLocalFileDataDescriptor.cs
- MailDefinition.cs
- parserscommon.cs
- FontResourceCache.cs
- Soap12ServerProtocol.cs
- RelationshipDetailsRow.cs
- WebPartManagerInternals.cs
- TextModifier.cs
- UIElementAutomationPeer.cs
- ListControlConvertEventArgs.cs
- WebDisplayNameAttribute.cs
- LockCookie.cs
- TextServicesContext.cs
- WindowsGraphicsCacheManager.cs
- DataServiceSaveChangesEventArgs.cs
- BitArray.cs
- Debugger.cs
- WorkflowServiceHost.cs
- TemplateInstanceAttribute.cs
- CollaborationHelperFunctions.cs
- MessageQueueException.cs
- EventLogTraceListener.cs
- Composition.cs
- Rotation3D.cs
- CompiledRegexRunner.cs
- CleanUpVirtualizedItemEventArgs.cs
- PagedDataSource.cs
- XmlArrayItemAttribute.cs
- UserControl.cs
- TemplateBindingExpressionConverter.cs
- MarkupProperty.cs
- ThicknessAnimationUsingKeyFrames.cs
- CaseStatement.cs
- SystemIPAddressInformation.cs
- ParallelActivityDesigner.cs
- SafePipeHandle.cs
- HotCommands.cs
- ConstructorBuilder.cs
- Stacktrace.cs
- ValidationError.cs
- IsolatedStorageFilePermission.cs
- TabItemAutomationPeer.cs
- PageThemeCodeDomTreeGenerator.cs
- TypedReference.cs
- SingleStorage.cs
- remotingproxy.cs
- TypeUtil.cs
- UpdateDelegates.Generated.cs
- DataBindingHandlerAttribute.cs
- ContentHostHelper.cs
- SQLInt64.cs
- ReachDocumentSequenceSerializerAsync.cs
- ElementsClipboardData.cs
- ProcessHostConfigUtils.cs
- ResourceReader.cs
- Normalizer.cs
- ObjectDataSourceMethodEventArgs.cs
- PersonalizablePropertyEntry.cs
- BamlRecordWriter.cs
- SpeakInfo.cs
- WmfPlaceableFileHeader.cs
- TransformDescriptor.cs
- wmiprovider.cs
- LayoutEngine.cs
- RoleManagerSection.cs
- MessageBox.cs
- LayoutUtils.cs
- DocumentAutomationPeer.cs
- FlagsAttribute.cs
- FaultDescription.cs
- ProtectedConfiguration.cs
- LayoutEditorPart.cs
- SvcMapFileLoader.cs
- TypeEnumerableViewSchema.cs
- MemberDomainMap.cs
- RequestCachePolicy.cs
- TemplateAction.cs
- WebRequestModuleElementCollection.cs
- AllMembershipCondition.cs
- QilExpression.cs
- DiscoveryServerProtocol.cs
- SimpleHandlerBuildProvider.cs
- XmlCompatibilityReader.cs
- LassoSelectionBehavior.cs
- BezierSegment.cs
- CustomLineCap.cs
- ClientType.cs
- Cursor.cs
- GridViewRowEventArgs.cs
- ConfigXmlWhitespace.cs
- HttpProfileBase.cs
- UserControl.cs
- WhitespaceRuleLookup.cs
- DebugView.cs
- ExpressionPrefixAttribute.cs
- PinnedBufferMemoryStream.cs
- SystemThemeKey.cs