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
- State.cs
- SchemaImporterExtensionsSection.cs
- PreviewKeyDownEventArgs.cs
- GetLedgerEntryForRecipientRequest.cs
- FormatterConverter.cs
- AuthenticationManager.cs
- ColorConverter.cs
- LoadedOrUnloadedOperation.cs
- CodeSubDirectory.cs
- DirectoryNotFoundException.cs
- DataList.cs
- WebPartVerbsEventArgs.cs
- KnownIds.cs
- MimeBasePart.cs
- NativeRightsManagementAPIsStructures.cs
- GroupItem.cs
- TrustLevelCollection.cs
- MemberDescriptor.cs
- HierarchicalDataSourceControl.cs
- DataBindingValueUIHandler.cs
- DesignerFrame.cs
- FileDialog.cs
- DataGridGeneralPage.cs
- Comparer.cs
- COM2ExtendedUITypeEditor.cs
- HideDisabledControlAdapter.cs
- BitVector32.cs
- UInt32Converter.cs
- Vector3DValueSerializer.cs
- ObjectDataSourceMethodEditor.cs
- SchemaImporterExtensionElement.cs
- ListViewInsertionMark.cs
- CodeDirectionExpression.cs
- HandledMouseEvent.cs
- VideoDrawing.cs
- LogExtentCollection.cs
- XMLSchema.cs
- Int32KeyFrameCollection.cs
- PartialArray.cs
- WpfSharedBamlSchemaContext.cs
- PenContexts.cs
- SystemWebSectionGroup.cs
- PersistChildrenAttribute.cs
- UIElementParaClient.cs
- SerializationObjectManager.cs
- DbgCompiler.cs
- IdentitySection.cs
- SmiXetterAccessMap.cs
- InputLanguageManager.cs
- OdbcUtils.cs
- OrderingExpression.cs
- Lazy.cs
- View.cs
- SQLInt32.cs
- InternalConfigSettingsFactory.cs
- NotificationContext.cs
- StylusPointPropertyId.cs
- LocatorManager.cs
- ComponentChangingEvent.cs
- ThicknessAnimationBase.cs
- WebPartAddingEventArgs.cs
- PropertyMetadata.cs
- TogglePatternIdentifiers.cs
- InheritedPropertyDescriptor.cs
- SrgsRulesCollection.cs
- TimeBoundedCache.cs
- _BaseOverlappedAsyncResult.cs
- ZeroOpNode.cs
- Enlistment.cs
- RadioButton.cs
- OracleEncoding.cs
- OleDbDataReader.cs
- PeerNearMe.cs
- DesignerProperties.cs
- XmlReader.cs
- ThreadSafeList.cs
- BaseDataList.cs
- GcSettings.cs
- DataControlImageButton.cs
- HttpCachePolicyElement.cs
- SearchForVirtualItemEventArgs.cs
- RequestTimeoutManager.cs
- AxWrapperGen.cs
- CodePageEncoding.cs
- XmlSchemaObjectTable.cs
- Latin1Encoding.cs
- BackStopAuthenticationModule.cs
- ClonableStack.cs
- SortDescription.cs
- FindProgressChangedEventArgs.cs
- DoubleIndependentAnimationStorage.cs
- SinglePageViewer.cs
- OrderedHashRepartitionStream.cs
- NativeWindow.cs
- TypeToStringValueConverter.cs
- FormViewDeleteEventArgs.cs
- LinqDataSourceDeleteEventArgs.cs
- HttpServerVarsCollection.cs
- CoreSwitches.cs
- MeshGeometry3D.cs