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
- SimpleWebHandlerParser.cs
- XXXOnTypeBuilderInstantiation.cs
- WebScriptEnablingBehavior.cs
- SoapAttributeOverrides.cs
- CompiledScopeCriteria.cs
- AdministrationHelpers.cs
- Converter.cs
- SoapAttributeOverrides.cs
- Effect.cs
- SecurityRuntime.cs
- HideDisabledControlAdapter.cs
- RowToParametersTransformer.cs
- DesignTimeVisibleAttribute.cs
- XmlIncludeAttribute.cs
- Int64AnimationBase.cs
- IPAddressCollection.cs
- SiteMapProvider.cs
- PopupControlService.cs
- TypeDependencyAttribute.cs
- ProgressChangedEventArgs.cs
- TextParagraphView.cs
- ViewEventArgs.cs
- SequentialOutput.cs
- DataSvcMapFileSerializer.cs
- RayHitTestParameters.cs
- HierarchicalDataSourceControl.cs
- HttpHandlerAction.cs
- DescendentsWalker.cs
- ReachDocumentReferenceSerializerAsync.cs
- LabelLiteral.cs
- ReaderContextStackData.cs
- LogRestartAreaEnumerator.cs
- WebPartHeaderCloseVerb.cs
- NotSupportedException.cs
- httpstaticobjectscollection.cs
- XmlSchemaInferenceException.cs
- x509store.cs
- VisualBrush.cs
- EdmRelationshipRoleAttribute.cs
- KeyValueConfigurationCollection.cs
- UTF32Encoding.cs
- PageStatePersister.cs
- DocumentPageTextView.cs
- ExceptionTranslationTable.cs
- IDReferencePropertyAttribute.cs
- ComplexPropertyEntry.cs
- FixedBufferAttribute.cs
- InfoCardClaimCollection.cs
- ToolboxComponentsCreatingEventArgs.cs
- RoleManagerSection.cs
- Attribute.cs
- _ProxyRegBlob.cs
- LocalBuilder.cs
- AxisAngleRotation3D.cs
- FontWeights.cs
- AutoGeneratedFieldProperties.cs
- _CacheStreams.cs
- LassoSelectionBehavior.cs
- DataGridTemplateColumn.cs
- EdmType.cs
- TogglePattern.cs
- HttpsTransportElement.cs
- Single.cs
- COM2Enum.cs
- SerializationFieldInfo.cs
- BuildManager.cs
- Aggregates.cs
- DictionaryCustomTypeDescriptor.cs
- EmptyCollection.cs
- SoapDocumentMethodAttribute.cs
- ListBoxChrome.cs
- SqlConnectionHelper.cs
- XsdDuration.cs
- OrthographicCamera.cs
- WindowsToolbar.cs
- ModulesEntry.cs
- TextBoxAutoCompleteSourceConverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- IndexingContentUnit.cs
- WorkflowIdleElement.cs
- FragmentQueryProcessor.cs
- DataSvcMapFile.cs
- DataGridViewImageColumn.cs
- TextReader.cs
- CompoundFileStreamReference.cs
- _RequestCacheProtocol.cs
- MasterPage.cs
- XXXOnTypeBuilderInstantiation.cs
- ComplexType.cs
- ResourceCodeDomSerializer.cs
- RoutedEventValueSerializer.cs
- Link.cs
- XmlNotation.cs
- compensatingcollection.cs
- CompilationUnit.cs
- FrameworkContextData.cs
- ActivityWithResultValueSerializer.cs
- ZipIOLocalFileHeader.cs
- XmlSchemaComplexContent.cs
- CultureInfoConverter.cs