Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlIterators.cs / 1 / 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
- WmpBitmapEncoder.cs
- KeyBinding.cs
- ZipPackage.cs
- TabRenderer.cs
- PrePrepareMethodAttribute.cs
- RuleElement.cs
- UrlAuthorizationModule.cs
- BaseUriHelper.cs
- MemberAccessException.cs
- ErrorWrapper.cs
- ImageCodecInfo.cs
- ObjectListDataBindEventArgs.cs
- Config.cs
- SerializationHelper.cs
- ButtonField.cs
- WebPartZoneBaseDesigner.cs
- XmlSchemaFacet.cs
- ChangePassword.cs
- BasicHttpBindingElement.cs
- AdornerLayer.cs
- _NTAuthentication.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ConditionalAttribute.cs
- ProfileManager.cs
- XmlKeywords.cs
- BitmapEffectInputData.cs
- ValidatingPropertiesEventArgs.cs
- CardSpaceSelector.cs
- MILUtilities.cs
- IteratorDescriptor.cs
- SubMenuStyleCollection.cs
- OracleBoolean.cs
- InfoCardProofToken.cs
- SystemIPv6InterfaceProperties.cs
- KnownColorTable.cs
- Rect3DConverter.cs
- ContextStack.cs
- WebPartDisplayModeCancelEventArgs.cs
- ExtenderProviderService.cs
- OracleLob.cs
- WindowsSolidBrush.cs
- LocalValueEnumerator.cs
- Zone.cs
- ValueChangedEventManager.cs
- CodeAttributeDeclaration.cs
- TextCollapsingProperties.cs
- EntityDataSourceDataSelectionPanel.cs
- BrushMappingModeValidation.cs
- RawStylusInputCustomDataList.cs
- PenCursorManager.cs
- MetaChildrenColumn.cs
- PathTooLongException.cs
- OutputCacheEntry.cs
- TemplateParser.cs
- TimelineClockCollection.cs
- GradientBrush.cs
- ProcessThreadDesigner.cs
- basevalidator.cs
- Transform.cs
- XPathNavigatorKeyComparer.cs
- BuildManagerHost.cs
- ConfigsHelper.cs
- EncryptedKey.cs
- IsolatedStorageException.cs
- DataObject.cs
- BlurEffect.cs
- EntityDataSourceEntitySetNameItem.cs
- DataTableClearEvent.cs
- SortedDictionary.cs
- StylusOverProperty.cs
- FormViewModeEventArgs.cs
- MenuStrip.cs
- DigestTraceRecordHelper.cs
- DataGridViewBindingCompleteEventArgs.cs
- IERequestCache.cs
- ImageCodecInfoPrivate.cs
- CriticalFinalizerObject.cs
- RoutingConfiguration.cs
- IsolatedStorageFileStream.cs
- DefaultPropertiesToSend.cs
- PasswordPropertyTextAttribute.cs
- PartialCachingControl.cs
- GeometryConverter.cs
- FillBehavior.cs
- GetPageNumberCompletedEventArgs.cs
- PropertyStore.cs
- GenericPrincipal.cs
- PrinterSettings.cs
- StringValidator.cs
- InfoCardTrace.cs
- MDIWindowDialog.cs
- HtmlGenericControl.cs
- Helper.cs
- WhileDesigner.cs
- SHA256Managed.cs
- EpmSyndicationContentSerializer.cs
- ConfigurationLocationCollection.cs
- RoamingStoreFile.cs
- DrawingContextDrawingContextWalker.cs
- DbSourceParameterCollection.cs