Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlIterators.cs / 1305376 / XmlIterators.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
using System;
using System.Xml;
using System.Xml.XPath;
using System.ComponentModel;
namespace System.Xml.Xsl.Runtime {
///
/// Iterators that use containment to control a nested iterator return one of the following values from MoveNext().
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum IteratorResult {
NoMoreNodes, // Iteration is complete; there are no more nodes
NeedInputNode, // The next node needs to be fetched from the contained iterator before iteration can continue
HaveCurrentNode, // This iterator's Current property is set to the next node in the iteration
};
///
/// Tokenize a string containing IDREF values and deref the values in order to get a list of ID elements.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public struct IdIterator {
private XPathNavigator navCurrent;
private string[] idrefs;
private int idx;
public void Create(XPathNavigator context, string value) {
this.navCurrent = XmlQueryRuntime.SyncToNavigator(this.navCurrent, context);
this.idrefs = XmlConvert.SplitString(value);
this.idx = -1;
}
public bool MoveNext() {
do {
this.idx++;
if (this.idx >= idrefs.Length)
return false;
}
while (!this.navCurrent.MoveToId(this.idrefs[this.idx]));
return true;
}
///
/// Return the current result navigator. This is only defined after MoveNext() has returned true.
///
public XPathNavigator Current {
get { return this.navCurrent; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
using System;
using System.Xml;
using System.Xml.XPath;
using System.ComponentModel;
namespace System.Xml.Xsl.Runtime {
///
/// Iterators that use containment to control a nested iterator return one of the following values from MoveNext().
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum IteratorResult {
NoMoreNodes, // Iteration is complete; there are no more nodes
NeedInputNode, // The next node needs to be fetched from the contained iterator before iteration can continue
HaveCurrentNode, // This iterator's Current property is set to the next node in the iteration
};
///
/// Tokenize a string containing IDREF values and deref the values in order to get a list of ID elements.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public struct IdIterator {
private XPathNavigator navCurrent;
private string[] idrefs;
private int idx;
public void Create(XPathNavigator context, string value) {
this.navCurrent = XmlQueryRuntime.SyncToNavigator(this.navCurrent, context);
this.idrefs = XmlConvert.SplitString(value);
this.idx = -1;
}
public bool MoveNext() {
do {
this.idx++;
if (this.idx >= idrefs.Length)
return false;
}
while (!this.navCurrent.MoveToId(this.idrefs[this.idx]));
return true;
}
///
/// Return the current result navigator. This is only defined after MoveNext() has returned true.
///
public XPathNavigator Current {
get { return this.navCurrent; }
}
}
}
// 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
- PlatformNotSupportedException.cs
- AsymmetricKeyExchangeDeformatter.cs
- Crc32.cs
- QueryContinueDragEventArgs.cs
- FixedDocumentPaginator.cs
- PointHitTestResult.cs
- XmlILTrace.cs
- CodeRegionDirective.cs
- IdentifierService.cs
- DataGridTable.cs
- AmbientLight.cs
- ProfileService.cs
- BitVector32.cs
- TypeSource.cs
- DesignOnlyAttribute.cs
- LicenseException.cs
- GZipDecoder.cs
- CqlLexer.cs
- TextServicesProperty.cs
- RoutingTable.cs
- Model3DGroup.cs
- X509ScopedServiceCertificateElement.cs
- PerspectiveCamera.cs
- TableParagraph.cs
- RoutedUICommand.cs
- ResourceManager.cs
- MediaSystem.cs
- CellTreeNodeVisitors.cs
- StateDesigner.LayoutSelectionGlyph.cs
- SizeConverter.cs
- WindowInteractionStateTracker.cs
- SwitchAttribute.cs
- ConstraintEnumerator.cs
- ExpressionTextBoxAutomationPeer.cs
- InfocardExtendedInformationCollection.cs
- MsdtcClusterUtils.cs
- Filter.cs
- DataControlField.cs
- IntSecurity.cs
- CookielessHelper.cs
- ScriptingWebServicesSectionGroup.cs
- NameValueConfigurationCollection.cs
- NamedObject.cs
- ZipIORawDataFileBlock.cs
- LoadedOrUnloadedOperation.cs
- ToolStripSeparator.cs
- nulltextcontainer.cs
- DecryptRequest.cs
- WebPartConnectionsDisconnectVerb.cs
- DoneReceivingAsyncResult.cs
- AlphabeticalEnumConverter.cs
- ColorConverter.cs
- ToolStripContentPanelRenderEventArgs.cs
- ClientOptions.cs
- EntityCollection.cs
- ParserContext.cs
- ContentWrapperAttribute.cs
- DataGridItemCollection.cs
- HttpServerVarsCollection.cs
- GridViewRowCollection.cs
- ObjectStateManager.cs
- Cloud.cs
- DataGridViewImageCell.cs
- WinFormsSpinner.cs
- TransformationRules.cs
- DataColumnPropertyDescriptor.cs
- MoveSizeWinEventHandler.cs
- PenCursorManager.cs
- EdmToObjectNamespaceMap.cs
- ActivityScheduledQuery.cs
- EventLogQuery.cs
- TimeSpanMinutesConverter.cs
- XmlElementElementCollection.cs
- BaseInfoTable.cs
- ClientUrlResolverWrapper.cs
- DbProviderSpecificTypePropertyAttribute.cs
- FrameworkRichTextComposition.cs
- WpfKnownMemberInvoker.cs
- ObjectDataSourceEventArgs.cs
- TextEditorTables.cs
- PatternMatcher.cs
- Point3DKeyFrameCollection.cs
- CompilerError.cs
- Durable.cs
- Parsers.cs
- FileSystemInfo.cs
- DynamicResourceExtension.cs
- TemplatePagerField.cs
- dataobject.cs
- DataGridViewButtonColumn.cs
- EntryIndex.cs
- NumberFunctions.cs
- ModifiableIteratorCollection.cs
- CompiledXpathExpr.cs
- LabelDesigner.cs
- ReferencedCategoriesDocument.cs
- ApplyImportsAction.cs
- MachineKeyConverter.cs
- SessionStateUtil.cs
- GcHandle.cs