Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / ParentQuery.cs / 1305376 / ParentQuery.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;
using System.Globalization;
using System.Collections.Generic;
internal sealed class ParentQuery : CacheAxisQuery {
public ParentQuery(Query qyInput, string Name, string Prefix, XPathNodeType Type) : base(qyInput, Name, Prefix, Type) {}
private ParentQuery(ParentQuery other) : base(other) { }
public override object Evaluate(XPathNodeIterator context) {
base.Evaluate(context);
//
XPathNavigator input;
while ((input = qyInput.Advance()) != null) {
input = input.Clone();
if (input.MoveToParent()) {
if (matches(input)) {
Insert(outputBuffer, input);
}
}
}
return this;
}
public override XPathNodeIterator Clone() { return new ParentQuery(this); }
}
}
// 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;
using System.Globalization;
using System.Collections.Generic;
internal sealed class ParentQuery : CacheAxisQuery {
public ParentQuery(Query qyInput, string Name, string Prefix, XPathNodeType Type) : base(qyInput, Name, Prefix, Type) {}
private ParentQuery(ParentQuery other) : base(other) { }
public override object Evaluate(XPathNodeIterator context) {
base.Evaluate(context);
//
XPathNavigator input;
while ((input = qyInput.Advance()) != null) {
input = input.Clone();
if (input.MoveToParent()) {
if (matches(input)) {
Insert(outputBuffer, input);
}
}
}
return this;
}
public override XPathNodeIterator Clone() { return new ParentQuery(this); }
}
}
// 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
- BaseTreeIterator.cs
- HotCommands.cs
- OutputCacheProfile.cs
- ActiveXHost.cs
- MetaForeignKeyColumn.cs
- PointLight.cs
- BitmapDecoder.cs
- PageThemeCodeDomTreeGenerator.cs
- IntSecurity.cs
- WSHttpBindingBaseElement.cs
- SchemaNotation.cs
- tibetanshape.cs
- WindowProviderWrapper.cs
- DataGridViewCell.cs
- Literal.cs
- XmlSchemaInfo.cs
- IgnoreFileBuildProvider.cs
- WebEvents.cs
- SharedConnectionInfo.cs
- SyndicationSerializer.cs
- DialogDivider.cs
- ReversePositionQuery.cs
- SqlLiftIndependentRowExpressions.cs
- mediaclock.cs
- Control.cs
- CodeTypeOfExpression.cs
- _HelperAsyncResults.cs
- Expression.cs
- EndpointDiscoveryElement.cs
- ClientType.cs
- RegexRunner.cs
- AssertSection.cs
- ConnectionInterfaceCollection.cs
- PriorityQueue.cs
- ProfileGroupSettings.cs
- MimePart.cs
- SetStoryboardSpeedRatio.cs
- OleDbError.cs
- AdapterUtil.cs
- ConfigurationProperty.cs
- TextEffect.cs
- InputLangChangeEvent.cs
- CheckBox.cs
- CodeDomDecompiler.cs
- GridViewSelectEventArgs.cs
- _StreamFramer.cs
- HttpFileCollection.cs
- CodeTryCatchFinallyStatement.cs
- UrlPath.cs
- ConfigurationPropertyAttribute.cs
- ProjectionPruner.cs
- TreeViewItem.cs
- SystemTcpConnection.cs
- XmlDesigner.cs
- UInt64Converter.cs
- DbXmlEnabledProviderManifest.cs
- DataKeyArray.cs
- AssemblyBuilder.cs
- ExcCanonicalXml.cs
- BidPrivateBase.cs
- SqlOuterApplyReducer.cs
- LifetimeManager.cs
- WindowsTab.cs
- SQLBinaryStorage.cs
- BitmapEffectRenderDataResource.cs
- OutputCacheSettings.cs
- TextBoxBase.cs
- DataServiceQueryOfT.cs
- GeometryCollection.cs
- EntityTypeEmitter.cs
- OdbcDataAdapter.cs
- RepeatButtonAutomationPeer.cs
- RegistryPermission.cs
- ConnectionPoint.cs
- NavigationPropertyEmitter.cs
- TdsParameterSetter.cs
- FramingDecoders.cs
- KeyToListMap.cs
- TypeConverterHelper.cs
- ObjectViewListener.cs
- Floater.cs
- StreamReader.cs
- Brush.cs
- EventLogHandle.cs
- BamlTreeMap.cs
- VirtualPathUtility.cs
- CachedFontFace.cs
- WebPartsSection.cs
- SqlSelectStatement.cs
- CompoundFileReference.cs
- CacheVirtualItemsEvent.cs
- XMLDiffLoader.cs
- AccessKeyManager.cs
- MetadataItemEmitter.cs
- Activator.cs
- TableItemProviderWrapper.cs
- ipaddressinformationcollection.cs
- SuppressMergeCheckAttribute.cs
- RegisteredHiddenField.cs
- SecurityTokenRequirement.cs