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
- TimeoutException.cs
- CounterSampleCalculator.cs
- CompModSwitches.cs
- InstancePersistenceContext.cs
- WCFBuildProvider.cs
- Wizard.cs
- UserControlBuildProvider.cs
- BitmapFrameEncode.cs
- EdmComplexTypeAttribute.cs
- _ListenerResponseStream.cs
- nulltextcontainer.cs
- RemoteWebConfigurationHost.cs
- Vector3DCollectionConverter.cs
- RectConverter.cs
- SoapConverter.cs
- AssemblyBuilder.cs
- NativeCppClassAttribute.cs
- PenThreadWorker.cs
- FunctionImportElement.cs
- ClientUtils.cs
- PathData.cs
- SizeIndependentAnimationStorage.cs
- PaperSize.cs
- RouteTable.cs
- TemplateComponentConnector.cs
- SqlDelegatedTransaction.cs
- CharEnumerator.cs
- HtmlSelect.cs
- OleDbWrapper.cs
- OdbcReferenceCollection.cs
- SafeBitVector32.cs
- EntityReference.cs
- ListenerElementsCollection.cs
- CodeGotoStatement.cs
- safex509handles.cs
- DateTimeFormat.cs
- ListSortDescription.cs
- ISAPIRuntime.cs
- TextTreeObjectNode.cs
- ComplusEndpointConfigContainer.cs
- NamedElement.cs
- PointLight.cs
- ContainerControl.cs
- HostingPreferredMapPath.cs
- FontWeightConverter.cs
- RegexMatchCollection.cs
- SpotLight.cs
- HighlightComponent.cs
- SqlGenericUtil.cs
- InstallerTypeAttribute.cs
- TextTreeDeleteContentUndoUnit.cs
- X509ChainPolicy.cs
- MdImport.cs
- DataMisalignedException.cs
- DBParameter.cs
- Timer.cs
- StackBuilderSink.cs
- RangeValuePattern.cs
- Buffer.cs
- Point4D.cs
- TemplateControlParser.cs
- LogLogRecordEnumerator.cs
- FieldBuilder.cs
- TemplateManager.cs
- PatternMatcher.cs
- StateRuntime.cs
- WebPartConnectionsEventArgs.cs
- PrefixQName.cs
- PartitionedDataSource.cs
- RSAOAEPKeyExchangeFormatter.cs
- TreeViewAutomationPeer.cs
- SchemaManager.cs
- ServicePoint.cs
- CultureSpecificStringDictionary.cs
- FastEncoder.cs
- PrintingPermissionAttribute.cs
- DurableInstanceProvider.cs
- PageTheme.cs
- FrameworkElement.cs
- ThrowHelper.cs
- CommandLibraryHelper.cs
- Helpers.cs
- WorkflowRuntimeServiceElement.cs
- FormatVersion.cs
- CodeNamespaceImportCollection.cs
- CodeGen.cs
- BufferedGraphics.cs
- TemplatePagerField.cs
- XPathArrayIterator.cs
- ToolStripItemEventArgs.cs
- ParameterCollection.cs
- WebEventTraceProvider.cs
- DragEvent.cs
- ExecutionContext.cs
- LeftCellWrapper.cs
- SiteMapProvider.cs
- WindowsBrush.cs
- RuntimeIdentifierPropertyAttribute.cs
- AppDomainFactory.cs
- NewItemsContextMenuStrip.cs