Files
2026-06-04 11:42:34 +02:00

108 lines
5.0 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace System.Collections
{
/// <summary>Provides the abstract base class for a strongly typed non-generic read-only collection.</summary>
/// <filterpriority>2</filterpriority>
// Token: 0x0200013A RID: 314
[ComVisible(true)]
[Serializable]
public abstract class ReadOnlyCollectionBase : IEnumerable, ICollection
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> class.</summary>
// Token: 0x06001017 RID: 4119 RVA: 0x00042BA8 File Offset: 0x00040DA8
protected ReadOnlyCollectionBase()
{
this.list = new ArrayList();
}
// Token: 0x06001018 RID: 4120 RVA: 0x00042BBC File Offset: 0x00040DBC
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Copies the entire <see cref="T:System.Collections.ReadOnlyCollectionBase" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.ReadOnlyCollectionBase" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.ReadOnlyCollectionBase" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.ReadOnlyCollectionBase" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x06001019 RID: 4121 RVA: 0x00042BC4 File Offset: 0x00040DC4
void ICollection.CopyTo(Array array, int index)
{
ArrayList innerList = this.InnerList;
lock (innerList)
{
this.InnerList.CopyTo(array, index);
}
}
/// <summary>Gets an object that can be used to synchronize access to a <see cref="T:System.Collections.ReadOnlyCollectionBase" /> object.</summary>
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> object.</returns>
// Token: 0x1700029C RID: 668
// (get) Token: 0x0600101A RID: 4122 RVA: 0x00042C14 File Offset: 0x00040E14
object ICollection.SyncRoot
{
get
{
return this.InnerList.SyncRoot;
}
}
/// <summary>Gets a value indicating whether access to a <see cref="T:System.Collections.ReadOnlyCollectionBase" /> object is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> object is synchronized (thread safe); otherwise, false. The default is false.</returns>
// Token: 0x1700029D RID: 669
// (get) Token: 0x0600101B RID: 4123 RVA: 0x00042C24 File Offset: 0x00040E24
bool ICollection.IsSynchronized
{
get
{
return this.InnerList.IsSynchronized;
}
}
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance.</summary>
/// <returns>The number of elements contained in the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance.Retrieving the value of this property is an O(1) operation.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x1700029E RID: 670
// (get) Token: 0x0600101C RID: 4124 RVA: 0x00042C34 File Offset: 0x00040E34
public virtual int Count
{
get
{
return this.InnerList.Count;
}
}
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x0600101D RID: 4125 RVA: 0x00042C44 File Offset: 0x00040E44
public virtual IEnumerator GetEnumerator()
{
return this.InnerList.GetEnumerator();
}
/// <summary>Gets the list of elements contained in the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance.</summary>
/// <returns>An <see cref="T:System.Collections.ArrayList" /> representing the <see cref="T:System.Collections.ReadOnlyCollectionBase" /> instance itself.</returns>
// Token: 0x1700029F RID: 671
// (get) Token: 0x0600101E RID: 4126 RVA: 0x00042C54 File Offset: 0x00040E54
protected ArrayList InnerList
{
get
{
return this.list;
}
}
// Token: 0x040003E9 RID: 1001
private ArrayList list;
}
}