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
- ObjectParameter.cs
- HttpListenerException.cs
- CodeLinePragma.cs
- _LocalDataStore.cs
- AdRotator.cs
- XmlSchemaType.cs
- UInt32Converter.cs
- XmlDigitalSignatureProcessor.cs
- sqlinternaltransaction.cs
- SchemaImporterExtension.cs
- UpdateProgress.cs
- Int16Converter.cs
- SectionUpdates.cs
- FixedSOMGroup.cs
- Transactions.cs
- ArcSegment.cs
- QilGeneratorEnv.cs
- DataGridCaption.cs
- FixedSOMLineCollection.cs
- FileStream.cs
- NavigationFailedEventArgs.cs
- Control.cs
- ClientSettingsStore.cs
- MarginCollapsingState.cs
- PolicyDesigner.cs
- HyperLinkStyle.cs
- ExtensionSurface.cs
- DiffuseMaterial.cs
- SafePointer.cs
- DocumentPageView.cs
- XmlRawWriter.cs
- HijriCalendar.cs
- ToolStripDropDownClosedEventArgs.cs
- PropertyGrid.cs
- HostAdapter.cs
- SqlTrackingQuery.cs
- SqlInternalConnectionSmi.cs
- SignatureDescription.cs
- PreservationFileReader.cs
- TypeConverterAttribute.cs
- SimpleBitVector32.cs
- COSERVERINFO.cs
- SortKey.cs
- WebPartCollection.cs
- ClusterRegistryConfigurationProvider.cs
- DesignerVerbCollection.cs
- TimestampInformation.cs
- SyndicationPerson.cs
- ToolStripItemDataObject.cs
- Hex.cs
- CatalogPartDesigner.cs
- ResourcePart.cs
- ConsoleTraceListener.cs
- ExpressionBuilderContext.cs
- SecurityPolicySection.cs
- UrlMapping.cs
- DataGridViewButtonColumn.cs
- AttributeTableBuilder.cs
- StylusEventArgs.cs
- ResourceExpressionEditor.cs
- ChangesetResponse.cs
- DictionarySectionHandler.cs
- ResizeGrip.cs
- OleCmdHelper.cs
- ParameterBinding.cs
- OleDbErrorCollection.cs
- Stroke.cs
- ConvertersCollection.cs
- QilLoop.cs
- MenuItem.cs
- SystemEvents.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- PropertyDescriptors.cs
- Header.cs
- infer.cs
- CodeGroup.cs
- IISUnsafeMethods.cs
- JournalEntry.cs
- UserControl.cs
- RelatedImageListAttribute.cs
- InkPresenter.cs
- EnumValidator.cs
- UnmanagedMemoryStream.cs
- SmiXetterAccessMap.cs
- URLAttribute.cs
- LinqDataSourceContextEventArgs.cs
- ComponentSerializationService.cs
- Events.cs
- StrongNameIdentityPermission.cs
- ReadOnlyDataSourceView.cs
- WebPartMenu.cs
- TextPointer.cs
- ViewService.cs
- RegisteredExpandoAttribute.cs
- UpDownBase.cs
- ConfigurationLoader.cs
- TPLETWProvider.cs
- COM2ExtendedBrowsingHandler.cs
- SessionEndingEventArgs.cs
- SvcMapFile.cs