using System; using System.Collections; using System.Runtime.InteropServices; namespace System.Globalization { /// Enumerates the text elements of a string. // Token: 0x02000199 RID: 409 [ComVisible(true)] [Serializable] public class TextElementEnumerator : IEnumerator { // Token: 0x060014D0 RID: 5328 RVA: 0x0004FF5C File Offset: 0x0004E15C internal TextElementEnumerator(string str, int startpos) { this.index = -1; this.startpos = startpos; this.str = str.Substring(startpos); this.element = null; } /// Gets the current text element in the string. /// An object containing the current text element in the string. /// The enumerator is positioned before the first text element of the string or after the last text element. // Token: 0x170003AF RID: 943 // (get) Token: 0x060014D1 RID: 5329 RVA: 0x0004FF94 File Offset: 0x0004E194 public object Current { get { if (this.element == null) { throw new InvalidOperationException(); } return this.element; } } /// Gets the index of the text element that the enumerator is currently positioned over. /// The index of the text element that the enumerator is currently positioned over. /// The enumerator is positioned before the first text element of the string or after the last text element. // Token: 0x170003B0 RID: 944 // (get) Token: 0x060014D2 RID: 5330 RVA: 0x0004FFB0 File Offset: 0x0004E1B0 public int ElementIndex { get { if (this.element == null) { throw new InvalidOperationException(); } return this.elementindex + this.startpos; } } /// Gets the current text element in the string. /// A new string containing the current text element in the string being read. /// The enumerator is positioned before the first text element of the string or after the last text element. // Token: 0x060014D3 RID: 5331 RVA: 0x0004FFD0 File Offset: 0x0004E1D0 public string GetTextElement() { if (this.element == null) { throw new InvalidOperationException(); } return this.element; } /// Advances the enumerator to the next text element of the string. /// true if the enumerator was successfully advanced to the next text element; false if the enumerator has passed the end of the string. // Token: 0x060014D4 RID: 5332 RVA: 0x0004FFEC File Offset: 0x0004E1EC public bool MoveNext() { this.elementindex = this.index + 1; if (this.elementindex < this.str.Length) { this.element = StringInfo.GetNextTextElement(this.str, this.elementindex); this.index += this.element.Length; return true; } this.element = null; return false; } /// Sets the enumerator to its initial position, which is before the first text element in the string. // Token: 0x060014D5 RID: 5333 RVA: 0x00050058 File Offset: 0x0004E258 public void Reset() { this.element = null; this.index = -1; } // Token: 0x040005E1 RID: 1505 private int index; // Token: 0x040005E2 RID: 1506 private int elementindex; // Token: 0x040005E3 RID: 1507 private int startpos; // Token: 0x040005E4 RID: 1508 private string str; // Token: 0x040005E5 RID: 1509 private string element; } }