Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / CharEnumerator.cs / 1 / CharEnumerator.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: CharEnumerator ** ** ** Purpose: Enumerates the characters on a string. skips range ** checks. ** ** ============================================================*/ namespace System { using System.Collections; using System.Collections.Generic; [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public sealed class CharEnumerator : IEnumerator, ICloneable, IEnumerator{ private String str; private int index; private char currentElement; internal CharEnumerator(String str) { this.str = str; this.index = -1; } public Object Clone() { return MemberwiseClone(); } public bool MoveNext() { if (index < (str.Length-1)) { index++; currentElement = str[index]; return true; } else index = str.Length; return false; } void IDisposable.Dispose() { } /// Object IEnumerator.Current { get { if (index == -1) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); if (index >= str.Length) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); return currentElement; } } public char Current { get { if (index == -1) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); if (index >= str.Length) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); return currentElement; } } public void Reset() { currentElement = (char)0; index = -1; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IndependentAnimationStorage.cs
- MdImport.cs
- TerminateDesigner.cs
- dbenumerator.cs
- InteropBitmapSource.cs
- SecurityTokenReferenceStyle.cs
- FileDialog_Vista.cs
- ColumnBinding.cs
- Parser.cs
- DbDataSourceEnumerator.cs
- ProjectedSlot.cs
- WebPartTransformer.cs
- PackWebResponse.cs
- XmlDomTextWriter.cs
- WindowsListViewScroll.cs
- DecoderExceptionFallback.cs
- ToolStripGripRenderEventArgs.cs
- NullableIntAverageAggregationOperator.cs
- DataGridViewTopLeftHeaderCell.cs
- ClientTargetSection.cs
- VisualStyleInformation.cs
- ControlPropertyNameConverter.cs
- XomlCompilerParameters.cs
- X509Certificate2.cs
- AutomationPatternInfo.cs
- SqlBulkCopyColumnMapping.cs
- SQLBinaryStorage.cs
- StringUtil.cs
- LinkConverter.cs
- CornerRadiusConverter.cs
- OutKeywords.cs
- UniqueIdentifierService.cs
- DataKeyArray.cs
- MetadataArtifactLoaderCompositeFile.cs
- DatePickerAutomationPeer.cs
- DataPointer.cs
- SecurityHelper.cs
- UInt32Storage.cs
- ToolStripSeparatorRenderEventArgs.cs
- OperatorExpressions.cs
- NetSectionGroup.cs
- GB18030Encoding.cs
- _Semaphore.cs
- DataGridState.cs
- ChtmlTextWriter.cs
- PolicyReader.cs
- TextServicesContext.cs
- MessageDecoder.cs
- XamlTreeBuilderBamlRecordWriter.cs
- DocumentsTrace.cs
- ContextMenuAutomationPeer.cs
- DataGridLinkButton.cs
- ExclusiveTcpListener.cs
- XmlnsDictionary.cs
- WinHttpWebProxyFinder.cs
- ItemChangedEventArgs.cs
- HtmlTableRowCollection.cs
- DynamicPhysicalDiscoSearcher.cs
- EventWaitHandleSecurity.cs
- ExpressionNormalizer.cs
- EFTableProvider.cs
- PerfCounters.cs
- OracleColumn.cs
- Clause.cs
- SecurityException.cs
- DataGridAutomationPeer.cs
- InvalidProgramException.cs
- CollectionViewGroup.cs
- BackgroundFormatInfo.cs
- ExtentCqlBlock.cs
- SimpleFieldTemplateFactory.cs
- TransportSecurityProtocolFactory.cs
- SerializationSectionGroup.cs
- CheckBoxPopupAdapter.cs
- PropertyIDSet.cs
- NetworkCredential.cs
- ImmutableDispatchRuntime.cs
- StyleReferenceConverter.cs
- NamespaceEmitter.cs
- ImageSource.cs
- XPathSingletonIterator.cs
- CodeCommentStatement.cs
- ControlAdapter.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- VersionedStreamOwner.cs
- DataDocumentXPathNavigator.cs
- TimestampInformation.cs
- ToolStripItemImageRenderEventArgs.cs
- InvalidateEvent.cs
- ClientSession.cs
- XmlUtil.cs
- HWStack.cs
- TableItemPattern.cs
- WindowsImpersonationContext.cs
- Panel.cs
- FolderLevelBuildProviderCollection.cs
- BinHexEncoder.cs
- RelativeSource.cs
- Storyboard.cs
- MultipleViewProviderWrapper.cs