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
- COM2ExtendedBrowsingHandler.cs
- ProfileService.cs
- RawTextInputReport.cs
- TableLayoutRowStyleCollection.cs
- TextBoxBase.cs
- UserControlBuildProvider.cs
- ReflectionHelper.cs
- FontStyles.cs
- CalloutQueueItem.cs
- ToolStripOverflow.cs
- ImmutableObjectAttribute.cs
- ChangeProcessor.cs
- InfoCardSymmetricAlgorithm.cs
- BitSet.cs
- Span.cs
- HotSpot.cs
- remotingproxy.cs
- PauseStoryboard.cs
- MediaPlayer.cs
- TripleDESCryptoServiceProvider.cs
- FactoryGenerator.cs
- WebPartMenu.cs
- securitycriticaldata.cs
- ThreadStateException.cs
- RealizationContext.cs
- XamlStyleSerializer.cs
- Win32PrintDialog.cs
- OutOfMemoryException.cs
- DataServices.cs
- Menu.cs
- X509CertificateStore.cs
- QuestionEventArgs.cs
- SerializableAttribute.cs
- TriggerCollection.cs
- IDispatchConstantAttribute.cs
- IsolatedStorageFilePermission.cs
- SwitchExpression.cs
- RadioButtonRenderer.cs
- SeverityFilter.cs
- BaseParagraph.cs
- Rfc2898DeriveBytes.cs
- DataConnectionHelper.cs
- BezierSegment.cs
- MailDefinition.cs
- IPipelineRuntime.cs
- EventSinkActivityDesigner.cs
- X509CertificateChain.cs
- latinshape.cs
- RecordManager.cs
- RegistryConfigurationProvider.cs
- WSHttpBindingBaseElement.cs
- Form.cs
- BinaryUtilClasses.cs
- EventMetadata.cs
- DetailsViewPageEventArgs.cs
- DataGridViewComboBoxColumn.cs
- Gdiplus.cs
- DetailsViewModeEventArgs.cs
- XamlNamespaceHelper.cs
- BezierSegment.cs
- ScriptControlManager.cs
- DelegateArgumentReference.cs
- ListInitExpression.cs
- TextPenaltyModule.cs
- ClientFactory.cs
- ParenExpr.cs
- FontFamily.cs
- XhtmlTextWriter.cs
- ValidationErrorInfo.cs
- BackgroundWorker.cs
- SelectionEditor.cs
- ExpressionPrinter.cs
- Mapping.cs
- RefType.cs
- HttpClientProtocol.cs
- MenuItemCollection.cs
- XamlSerializationHelper.cs
- QilNode.cs
- WebHttpSecurityElement.cs
- HttpAsyncResult.cs
- ExpandSegmentCollection.cs
- ColorTransform.cs
- XmlSchemaFacet.cs
- ContentDefinition.cs
- XPathChildIterator.cs
- TransformerConfigurationWizardBase.cs
- TimeoutValidationAttribute.cs
- GenericEnumerator.cs
- MdImport.cs
- WebPartsSection.cs
- DbCommandDefinition.cs
- SurrogateSelector.cs
- SafeRegistryHandle.cs
- ConnectorDragDropGlyph.cs
- AutomationProperties.cs
- Control.cs
- TimeSpan.cs
- FailedToStartupUIException.cs
- XPathNavigatorReader.cs
- _UncName.cs