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
- ExpressionBuilderContext.cs
- ScrollEventArgs.cs
- DocumentApplication.cs
- SystemResourceKey.cs
- TypedElement.cs
- DateTimeFormatInfoScanner.cs
- ListView.cs
- DataBoundLiteralControl.cs
- DocumentEventArgs.cs
- DataKey.cs
- RepeaterItemEventArgs.cs
- HandlerMappingMemo.cs
- SystemIPv6InterfaceProperties.cs
- RtfControls.cs
- DeploymentSectionCache.cs
- RenderDataDrawingContext.cs
- BitmapEffect.cs
- Pair.cs
- WaitHandleCannotBeOpenedException.cs
- WorkflowOperationContext.cs
- EncoderReplacementFallback.cs
- HtmlTableCellCollection.cs
- PrintDialog.cs
- FileSystemInfo.cs
- TableLayoutSettingsTypeConverter.cs
- HttpCookiesSection.cs
- CommonGetThemePartSize.cs
- X509AsymmetricSecurityKey.cs
- ResourcesBuildProvider.cs
- BoolExpr.cs
- TreeNodeSelectionProcessor.cs
- FontStyles.cs
- WeakReferenceKey.cs
- DbParameterHelper.cs
- InkCanvasSelection.cs
- CodeGenerator.cs
- PauseStoryboard.cs
- PersistenceProviderBehavior.cs
- EventLogger.cs
- Message.cs
- AssemblyAttributesGoHere.cs
- DbConnectionPoolGroup.cs
- ShapingEngine.cs
- InOutArgument.cs
- Debug.cs
- SendAgentStatusRequest.cs
- Helper.cs
- ConcurrentQueue.cs
- CharEntityEncoderFallback.cs
- ScrollPattern.cs
- WebServiceData.cs
- WebDisplayNameAttribute.cs
- UIElementPropertyUndoUnit.cs
- CodeActivity.cs
- DbExpressionRules.cs
- SimpleType.cs
- TextDecorationCollection.cs
- XmlArrayItemAttributes.cs
- FileSystemWatcher.cs
- UriParserTemplates.cs
- RangeBaseAutomationPeer.cs
- RewritingSimplifier.cs
- Parameter.cs
- PrefixQName.cs
- PowerStatus.cs
- RelationshipFixer.cs
- CodeRegionDirective.cs
- ConnectivityStatus.cs
- SoapAttributeAttribute.cs
- ThreadPool.cs
- CachingHintValidation.cs
- HostingEnvironmentException.cs
- RegexBoyerMoore.cs
- WebHeaderCollection.cs
- ByteStream.cs
- DeflateStream.cs
- TableParagraph.cs
- XmlIlGenerator.cs
- XPathSelectionIterator.cs
- EnlistmentState.cs
- DataPager.cs
- EventLogEntryCollection.cs
- Hashtable.cs
- SQLDateTime.cs
- LinkLabelLinkClickedEvent.cs
- StreamGeometry.cs
- InternalPolicyElement.cs
- InvalidCastException.cs
- OutputScopeManager.cs
- UTF8Encoding.cs
- Brushes.cs
- InheritanceRules.cs
- DbReferenceCollection.cs
- DesignerSerializerAttribute.cs
- XmlMemberMapping.cs
- SR.Designer.cs
- DataGridViewBand.cs
- TagPrefixInfo.cs
- SafeWaitHandle.cs
- QilLiteral.cs