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
- AppLevelCompilationSectionCache.cs
- KeyValuePairs.cs
- DiscreteKeyFrames.cs
- URLString.cs
- EntityCommandExecutionException.cs
- XmlDataProvider.cs
- InheritanceRules.cs
- CopyAction.cs
- PrivilegeNotHeldException.cs
- EventDescriptor.cs
- DataSourceProvider.cs
- SqlProviderManifest.cs
- FilteredXmlReader.cs
- RoleManagerModule.cs
- FilterException.cs
- CancelEventArgs.cs
- ErrorActivity.cs
- FieldAccessException.cs
- COM2Properties.cs
- ResourceType.cs
- TextTreeExtractElementUndoUnit.cs
- Transform3D.cs
- Timer.cs
- FunctionDetailsReader.cs
- XsltConvert.cs
- FileDialogCustomPlace.cs
- nulltextnavigator.cs
- GlobalizationSection.cs
- LinqDataSourceInsertEventArgs.cs
- Triplet.cs
- RouteValueDictionary.cs
- XmlSignificantWhitespace.cs
- DataGridColumnCollection.cs
- Drawing.cs
- IndentedWriter.cs
- UInt64Storage.cs
- TreeNodeBindingCollection.cs
- RangeBaseAutomationPeer.cs
- TreeNodeCollection.cs
- FilterRepeater.cs
- StatusBarDrawItemEvent.cs
- TCEAdapterGenerator.cs
- XPathNavigator.cs
- VerificationException.cs
- BehaviorEditorPart.cs
- CharEntityEncoderFallback.cs
- DynamicILGenerator.cs
- GenericsInstances.cs
- ProcessInputEventArgs.cs
- Attributes.cs
- LZCodec.cs
- GlyphCollection.cs
- RadialGradientBrush.cs
- MetaTable.cs
- RC2CryptoServiceProvider.cs
- ImageSourceValueSerializer.cs
- LeftCellWrapper.cs
- DefaultValueAttribute.cs
- DbConnectionPoolIdentity.cs
- ISAPIRuntime.cs
- MethodBuilderInstantiation.cs
- sqlser.cs
- LabelLiteral.cs
- ConditionValidator.cs
- DiagnosticsConfigurationHandler.cs
- ItemAutomationPeer.cs
- RegisteredHiddenField.cs
- NamedPipeTransportSecurityElement.cs
- XmlValueConverter.cs
- PrinterUnitConvert.cs
- Tuple.cs
- TabItemWrapperAutomationPeer.cs
- PrintingPermissionAttribute.cs
- XslVisitor.cs
- ListViewDeleteEventArgs.cs
- HttpServerVarsCollection.cs
- DependencySource.cs
- ImpersonationContext.cs
- URLIdentityPermission.cs
- MachinePropertyVariants.cs
- SqlErrorCollection.cs
- HttpServerVarsCollection.cs
- SiteMembershipCondition.cs
- PingOptions.cs
- BindingContext.cs
- ResourceContainer.cs
- DetailsViewUpdatedEventArgs.cs
- PDBReader.cs
- ProcessStartInfo.cs
- AccessKeyManager.cs
- TemplatedMailWebEventProvider.cs
- OrCondition.cs
- SelectionPattern.cs
- TabControlEvent.cs
- SelectQueryOperator.cs
- RawMouseInputReport.cs
- UTF7Encoding.cs
- DbConnectionPool.cs
- _OverlappedAsyncResult.cs
- _OSSOCK.cs