using System; using System.Collections; namespace System.Text.RegularExpressions { /// Represents a collection of captured groups in a single match. // Token: 0x020002AE RID: 686 [Serializable] public class GroupCollection : ICollection, IEnumerable { // Token: 0x06001905 RID: 6405 RVA: 0x00055B24 File Offset: 0x00053D24 internal GroupCollection(int n, int gap) { this.list = new Group[n]; this.gap = gap; } /// Returns the number of groups in the collection. /// The number of groups in the collection. // Token: 0x170007D8 RID: 2008 // (get) Token: 0x06001906 RID: 6406 RVA: 0x00055B40 File Offset: 0x00053D40 public int Count { get { return this.list.Length; } } /// Gets a value indicating whether the collection is read-only. /// true if GroupCollection is read-only; otherwise false. // Token: 0x170007D9 RID: 2009 // (get) Token: 0x06001907 RID: 6407 RVA: 0x00055B4C File Offset: 0x00053D4C public bool IsReadOnly { get { return true; } } /// Gets a value indicating whether access to the GroupCollection is synchronized (thread-safe). /// true if access is synchronized; otherwise false. // Token: 0x170007DA RID: 2010 // (get) Token: 0x06001908 RID: 6408 RVA: 0x00055B50 File Offset: 0x00053D50 public bool IsSynchronized { get { return false; } } /// Enables access to a member of the collection by integer index. /// The member of the collection specified by . /// The zero-based index of the collection member to be retrieved. // Token: 0x170007DB RID: 2011 public Group this[int i] { get { if (i >= this.gap) { Match match = (Match)this.list[0]; i = ((match != Match.Empty) ? match.Regex.GetGroupIndex(i) : (-1)); } return (i >= 0) ? this.list[i] : Group.Fail; } } // Token: 0x0600190A RID: 6410 RVA: 0x00055BB4 File Offset: 0x00053DB4 internal void SetValue(Group g, int i) { this.list[i] = g; } /// Enables access to a member of the collection by string index. /// The member of the collection specified by . /// The name of a capturing group. // Token: 0x170007DC RID: 2012 public Group this[string groupName] { get { Match match = (Match)this.list[0]; if (match != Match.Empty) { int num = match.Regex.GroupNumberFromName(groupName); if (num != -1) { return this[num]; } } return Group.Fail; } } /// Gets an object that can be used to synchronize access to the GroupCollection. /// A copy of the object to synchronize. // Token: 0x170007DD RID: 2013 // (get) Token: 0x0600190C RID: 6412 RVA: 0x00055C08 File Offset: 0x00053E08 public object SyncRoot { get { return this.list; } } /// Copies all the elements of the collection to the given array beginning at the given index. /// The array the collection is to be copied into. /// The position in the destination array where the copying is to begin. /// /// is null. /// /// is outside the bounds of .-or- plus is outside the bounds of . // Token: 0x0600190D RID: 6413 RVA: 0x00055C10 File Offset: 0x00053E10 public void CopyTo(Array array, int index) { this.list.CopyTo(array, index); } /// Returns an enumerator that can iterate through the collection. /// An object that contains all objects in the . // Token: 0x0600190E RID: 6414 RVA: 0x00055C20 File Offset: 0x00053E20 public IEnumerator GetEnumerator() { return this.list.GetEnumerator(); } // Token: 0x040013C9 RID: 5065 private Group[] list; // Token: 0x040013CA RID: 5066 private int gap; } }