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
- HostProtectionPermission.cs
- ConsoleKeyInfo.cs
- TableRow.cs
- EnumBuilder.cs
- XmlSerializerAssemblyAttribute.cs
- InfoCardSchemas.cs
- XmlAttribute.cs
- CompilerState.cs
- ArrayHelper.cs
- XPathDescendantIterator.cs
- InstallerTypeAttribute.cs
- BindingOperations.cs
- EditingCoordinator.cs
- VarRemapper.cs
- SmiGettersStream.cs
- OrthographicCamera.cs
- GeneralTransform2DTo3D.cs
- CodeNamespaceImport.cs
- ForwardPositionQuery.cs
- DataGridViewCellConverter.cs
- XamlPoint3DCollectionSerializer.cs
- FunctionMappingTranslator.cs
- DbConnectionPoolGroup.cs
- HttpCacheParams.cs
- DataGridHeaderBorder.cs
- EmptyCollection.cs
- RoleGroupCollection.cs
- SymbolType.cs
- CheckBoxBaseAdapter.cs
- HtmlUtf8RawTextWriter.cs
- AppDomainFactory.cs
- SafeRightsManagementHandle.cs
- SQLBinary.cs
- PrivateFontCollection.cs
- PeerNameResolver.cs
- BitStream.cs
- ToolStripPanelCell.cs
- LocalizableAttribute.cs
- NativeMethods.cs
- DataGridViewComboBoxCell.cs
- ButtonBaseDesigner.cs
- SvcMapFileSerializer.cs
- CryptoSession.cs
- BulletedListEventArgs.cs
- WebPartDeleteVerb.cs
- DataSourceProvider.cs
- MaskedTextProvider.cs
- CustomAttribute.cs
- LayoutEvent.cs
- XmlSerializationWriter.cs
- ACL.cs
- DeviceContext2.cs
- ConfigXmlText.cs
- DataGridColumnStyleMappingNameEditor.cs
- Menu.cs
- DataGridViewSelectedRowCollection.cs
- ChangePasswordAutoFormat.cs
- BitmapCodecInfoInternal.cs
- TimeSpanOrInfiniteConverter.cs
- Compiler.cs
- ContentElement.cs
- EventWaitHandleSecurity.cs
- NavigationPropertyEmitter.cs
- ImageListImageEditor.cs
- QueryPageSettingsEventArgs.cs
- Size3DConverter.cs
- FontClient.cs
- FormCollection.cs
- PtsHelper.cs
- CodeNamespaceImport.cs
- RawStylusSystemGestureInputReport.cs
- WindowsRegion.cs
- WasEndpointConfigContainer.cs
- MissingMethodException.cs
- KernelTypeValidation.cs
- NamespaceListProperty.cs
- SqlMethodAttribute.cs
- DataReaderContainer.cs
- UserControlAutomationPeer.cs
- TypeKeyValue.cs
- ToolStripDesignerAvailabilityAttribute.cs
- SqlDataSourceCache.cs
- _AutoWebProxyScriptWrapper.cs
- DialogResultConverter.cs
- ObjectToIdCache.cs
- PeerCredential.cs
- ParagraphVisual.cs
- FileIOPermission.cs
- TextEditorTables.cs
- ContentPresenter.cs
- BaseAutoFormat.cs
- XmlLangPropertyAttribute.cs
- Size3DConverter.cs
- LayoutExceptionEventArgs.cs
- Deflater.cs
- EncoderBestFitFallback.cs
- ComponentGlyph.cs
- MiniMapControl.xaml.cs
- EditorPart.cs
- HttpClientChannel.cs