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
- ContentElement.cs
- MetabaseReader.cs
- ScrollableControlDesigner.cs
- ConfigurationManagerHelperFactory.cs
- DocumentApplication.cs
- ArgumentOutOfRangeException.cs
- ConfigXmlSignificantWhitespace.cs
- ViewGenerator.cs
- XMLUtil.cs
- QilInvoke.cs
- LocalFileSettingsProvider.cs
- Processor.cs
- ScrollViewerAutomationPeer.cs
- StretchValidation.cs
- COSERVERINFO.cs
- Transform3D.cs
- SettingsProperty.cs
- PeerCustomResolverSettings.cs
- SHA1.cs
- StatusBarPanelClickEvent.cs
- ProfileGroupSettings.cs
- Int16AnimationUsingKeyFrames.cs
- HttpContextServiceHost.cs
- StickyNoteAnnotations.cs
- PkcsUtils.cs
- EntityAdapter.cs
- SystemIPInterfaceStatistics.cs
- UIElementHelper.cs
- RSATokenProvider.cs
- RegionIterator.cs
- ProcessHostMapPath.cs
- NamedObject.cs
- UpdateExpressionVisitor.cs
- HostingEnvironmentException.cs
- CanonicalFontFamilyReference.cs
- TextRunProperties.cs
- UserInitiatedRoutedEventPermission.cs
- FixedSOMGroup.cs
- ValidationErrorCollection.cs
- WhitespaceRuleReader.cs
- CodeSnippetExpression.cs
- MessageSmuggler.cs
- SafeArrayRankMismatchException.cs
- MailDefinition.cs
- Int32Converter.cs
- XmlDataCollection.cs
- ImageBrush.cs
- NumberFormatInfo.cs
- EntityDataSourceSelectedEventArgs.cs
- UInt64.cs
- SelectionRangeConverter.cs
- XmlSignificantWhitespace.cs
- BitmapScalingModeValidation.cs
- Psha1DerivedKeyGenerator.cs
- ApplicationProxyInternal.cs
- StrongNameKeyPair.cs
- SerializationInfo.cs
- Group.cs
- WebPartPersonalization.cs
- WebUtil.cs
- DecimalConstantAttribute.cs
- HashHelper.cs
- Wildcard.cs
- precedingsibling.cs
- OutputCacheModule.cs
- CodeEntryPointMethod.cs
- TypeConstant.cs
- NameGenerator.cs
- Messages.cs
- RegistryDataKey.cs
- ExtensionElement.cs
- XmlBufferReader.cs
- PathGeometry.cs
- RadioButtonList.cs
- CapabilitiesUse.cs
- TrayIconDesigner.cs
- CultureInfoConverter.cs
- TableAdapterManagerGenerator.cs
- CollectionMarkupSerializer.cs
- SmiConnection.cs
- ValidationSummary.cs
- HtmlMeta.cs
- DebugInfoExpression.cs
- TrustManagerMoreInformation.cs
- BulletedListDesigner.cs
- ListViewItemSelectionChangedEvent.cs
- PermissionAttributes.cs
- DbProviderManifest.cs
- SqlDataSourceQueryConverter.cs
- CorrelationTokenInvalidatedHandler.cs
- TableLayout.cs
- PenLineCapValidation.cs
- QueryRewriter.cs
- EventDescriptor.cs
- BinaryObjectInfo.cs
- Brush.cs
- DES.cs
- PropertyDescriptor.cs
- EdmItemCollection.cs
- StringFormat.cs