Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- MethodMessage.cs
- WebExceptionStatus.cs
- Task.cs
- Stacktrace.cs
- ProfilePropertyMetadata.cs
- ArgumentElement.cs
- DurableInstanceContextProvider.cs
- PrimitiveXmlSerializers.cs
- SqlFactory.cs
- InputLangChangeEvent.cs
- DynamicPropertyReader.cs
- ColorAnimation.cs
- ExecutionContext.cs
- InProcStateClientManager.cs
- Metadata.cs
- DbXmlEnabledProviderManifest.cs
- CellConstantDomain.cs
- SynthesizerStateChangedEventArgs.cs
- AxDesigner.cs
- peernodeimplementation.cs
- ControlEvent.cs
- LifetimeServices.cs
- ReadOnlyPermissionSet.cs
- LogFlushAsyncResult.cs
- NameSpaceEvent.cs
- GridItem.cs
- sqlmetadatafactory.cs
- DataGridColumnReorderingEventArgs.cs
- DataTableNewRowEvent.cs
- VectorCollection.cs
- SortableBindingList.cs
- ScalarType.cs
- IHttpResponseInternal.cs
- SecurityPermission.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- HMACRIPEMD160.cs
- FloaterBaseParagraph.cs
- XmlDictionaryWriter.cs
- LocalizationCodeDomSerializer.cs
- UDPClient.cs
- AccessedThroughPropertyAttribute.cs
- EventManager.cs
- PersonalizationStateQuery.cs
- CreateUserWizardDesigner.cs
- TwoPhaseCommitProxy.cs
- ValueChangedEventManager.cs
- BooleanAnimationUsingKeyFrames.cs
- ToolStripComboBox.cs
- WindowsEditBox.cs
- EmbossBitmapEffect.cs
- MissingFieldException.cs
- SqlErrorCollection.cs
- RemotingServices.cs
- LOSFormatter.cs
- ImmutableCollection.cs
- PriorityQueue.cs
- DesignerHelpers.cs
- WebPartTracker.cs
- ResXBuildProvider.cs
- NavigationCommands.cs
- OpacityConverter.cs
- TerminateSequence.cs
- FunctionNode.cs
- FontUnitConverter.cs
- DbConnectionFactory.cs
- Claim.cs
- DbDataAdapter.cs
- FrameworkName.cs
- MethodAccessException.cs
- URLAttribute.cs
- WhereQueryOperator.cs
- ConstraintEnumerator.cs
- MemoryFailPoint.cs
- Point3DCollection.cs
- DataRow.cs
- PartialClassGenerationTaskInternal.cs
- LogManagementAsyncResult.cs
- DependencyPropertyChangedEventArgs.cs
- DragStartedEventArgs.cs
- DataControlFieldCell.cs
- arclist.cs
- WindowShowOrOpenTracker.cs
- MachineKeyConverter.cs
- EventLogPermission.cs
- ClientSettingsStore.cs
- VectorCollection.cs
- Formatter.cs
- ButtonChrome.cs
- ImageListStreamer.cs
- WmlCalendarAdapter.cs
- EffectiveValueEntry.cs
- ActiveXContainer.cs
- FigureParagraph.cs
- ClientTargetCollection.cs
- TreeNodeStyleCollection.cs
- InvalidDataContractException.cs
- ToolStripPanelRow.cs
- FragmentQuery.cs
- ContextInformation.cs
- ErrorStyle.cs