Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CreatingCookieEventArgs.cs
- CodeSubDirectory.cs
- VoiceObjectToken.cs
- SystemWebCachingSectionGroup.cs
- LineGeometry.cs
- MenuItemCollectionEditor.cs
- EncodingDataItem.cs
- XmlDictionaryWriter.cs
- DependencyPropertyKey.cs
- _Win32.cs
- ProtocolInformationReader.cs
- ClientConfigurationSystem.cs
- FunctionUpdateCommand.cs
- EncoderFallback.cs
- RequestQueryParser.cs
- ExpressionNode.cs
- ReadOnlyAttribute.cs
- SynchronousReceiveElement.cs
- IfAction.cs
- DocumentAutomationPeer.cs
- ExpressionBindings.cs
- EdmFunctionAttribute.cs
- PropertyGroupDescription.cs
- ViewGenResults.cs
- ConnectionStringsSection.cs
- HtmlSelectionListAdapter.cs
- PropertyGridEditorPart.cs
- SystemUdpStatistics.cs
- SystemSounds.cs
- ClassicBorderDecorator.cs
- ServiceNotStartedException.cs
- XmlLanguage.cs
- RuntimeWrappedException.cs
- XsltInput.cs
- CodeSnippetStatement.cs
- InvokePatternIdentifiers.cs
- OptimalTextSource.cs
- EntryIndex.cs
- Win32KeyboardDevice.cs
- BuilderPropertyEntry.cs
- ServerValidateEventArgs.cs
- CriticalExceptions.cs
- DesignerAttributeInfo.cs
- WebPartMenuStyle.cs
- DataGridViewAdvancedBorderStyle.cs
- NullableDecimalMinMaxAggregationOperator.cs
- PointCollection.cs
- HtmlInputReset.cs
- SelectionEditingBehavior.cs
- MessageQueuePermissionEntry.cs
- TextRunCacheImp.cs
- EFColumnProvider.cs
- QueryExpression.cs
- CursorInteropHelper.cs
- TypeInitializationException.cs
- CheckPair.cs
- XmlTextReader.cs
- DashStyle.cs
- XmlSchemaAll.cs
- AddInServer.cs
- ReadOnlyPropertyMetadata.cs
- FunctionUpdateCommand.cs
- HttpSocketManager.cs
- AuthenticationException.cs
- DelegatingTypeDescriptionProvider.cs
- ProcessProtocolHandler.cs
- ReferenceEqualityComparer.cs
- ScriptControlManager.cs
- HtmlAnchor.cs
- DoubleStorage.cs
- ZipIOBlockManager.cs
- JulianCalendar.cs
- ContentElementCollection.cs
- XmlDomTextWriter.cs
- ReferentialConstraint.cs
- ClientBuildManager.cs
- DiscardableAttribute.cs
- Utils.cs
- DateRangeEvent.cs
- HitTestWithGeometryDrawingContextWalker.cs
- backend.cs
- filewebresponse.cs
- ObjectContext.cs
- wgx_sdk_version.cs
- ModelTreeEnumerator.cs
- DataRecordInternal.cs
- RuntimeCompatibilityAttribute.cs
- HttpWebRequestElement.cs
- InlineObject.cs
- AbstractExpressions.cs
- BamlLocalizer.cs
- HtmlTableRowCollection.cs
- CompilationUnit.cs
- DataTableClearEvent.cs
- FolderBrowserDialogDesigner.cs
- PriorityBinding.cs
- LinqDataSourceInsertEventArgs.cs
- ListSortDescription.cs
- ProxyGenerationError.cs
- WmlControlAdapter.cs