Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SqlFileStream.cs
- HttpCacheParams.cs
- ToolStripTextBox.cs
- ToolboxComponentsCreatedEventArgs.cs
- ConfigXmlCDataSection.cs
- WebRequestModuleElement.cs
- ITreeGenerator.cs
- FileSystemEventArgs.cs
- VirtualizingPanel.cs
- ContentElement.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- UIElementHelper.cs
- TreeNodeCollectionEditorDialog.cs
- SQLInt16.cs
- ListViewSelectEventArgs.cs
- FlatButtonAppearance.cs
- FileDetails.cs
- ContainsRowNumberChecker.cs
- AmbientValueAttribute.cs
- ReflectPropertyDescriptor.cs
- PackagingUtilities.cs
- ViewManager.cs
- UpdatePanelTrigger.cs
- UnmanagedBitmapWrapper.cs
- TemplateControl.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- Compress.cs
- SafeReadContext.cs
- WebPartsPersonalization.cs
- TextDecorations.cs
- Random.cs
- PersonalizationProviderHelper.cs
- NotImplementedException.cs
- TaskForm.cs
- PropertyInfoSet.cs
- DesignerAutoFormatCollection.cs
- _SSPIWrapper.cs
- IntPtr.cs
- XPathItem.cs
- PathFigureCollection.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- mediaeventargs.cs
- SignedXmlDebugLog.cs
- DbConnectionStringBuilder.cs
- LocatorPart.cs
- XmlFormatWriterGenerator.cs
- EndpointAddressMessageFilterTable.cs
- LZCodec.cs
- StrongBox.cs
- Comparer.cs
- MimeMapping.cs
- ProjectionPathSegment.cs
- _AutoWebProxyScriptHelper.cs
- DynamicRenderer.cs
- IndependentAnimationStorage.cs
- AdornedElementPlaceholder.cs
- DataGridTextBoxColumn.cs
- Select.cs
- LinkArea.cs
- NumericUpDown.cs
- LicenseManager.cs
- SoundPlayer.cs
- MemoryStream.cs
- SystemWebCachingSectionGroup.cs
- _BufferOffsetSize.cs
- InputLanguageManager.cs
- UnaryOperationBinder.cs
- Page.cs
- TextEditorLists.cs
- IISUnsafeMethods.cs
- ImportException.cs
- TextContainerChangeEventArgs.cs
- SchemaLookupTable.cs
- _Rfc2616CacheValidators.cs
- TransformGroup.cs
- NativeRightsManagementAPIsStructures.cs
- FixedPageProcessor.cs
- BackStopAuthenticationModule.cs
- HtmlInputButton.cs
- ObjectListSelectEventArgs.cs
- DesignerSerializationOptionsAttribute.cs
- COM2Properties.cs
- NativeMethods.cs
- StorageComplexPropertyMapping.cs
- MsdtcWrapper.cs
- SlipBehavior.cs
- BindingGraph.cs
- TimeSpanOrInfiniteConverter.cs
- StringExpressionSet.cs
- BufferAllocator.cs
- FamilyTypefaceCollection.cs
- HtmlInputHidden.cs
- TrustManagerPromptUI.cs
- PersistenceTypeAttribute.cs
- SqlMethods.cs
- TableCell.cs
- EntityContainerEntitySet.cs
- RelationshipSet.cs
- StaticSiteMapProvider.cs
- TextTreeUndoUnit.cs