scripts
This commit is contained in:
@@ -0,0 +1,324 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Collections.ObjectModel
|
||||
{
|
||||
/// <summary>Provides the base class for a generic read-only collection. </summary>
|
||||
/// <typeparam name="T">The type of elements in the collection.</typeparam>
|
||||
// Token: 0x02000112 RID: 274
|
||||
[ComVisible(false)]
|
||||
[Serializable]
|
||||
public class ReadOnlyCollection<T> : IEnumerable, ICollection, IList, ICollection<T>, IList<T>, IEnumerable<T>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> class that is a read-only wrapper around the specified list.</summary>
|
||||
/// <param name="list">The list to wrap.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="list" /> is null.</exception>
|
||||
// Token: 0x06000D9A RID: 3482 RVA: 0x0003B9C4 File Offset: 0x00039BC4
|
||||
public ReadOnlyCollection(IList<T> list)
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
throw new ArgumentNullException("list");
|
||||
}
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
// Token: 0x06000D9B RID: 3483 RVA: 0x0003B9E4 File Offset: 0x00039BE4
|
||||
void ICollection<T>.Add(T item)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Token: 0x06000D9C RID: 3484 RVA: 0x0003B9EC File Offset: 0x00039BEC
|
||||
void ICollection<T>.Clear()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Token: 0x06000D9D RID: 3485 RVA: 0x0003B9F4 File Offset: 0x00039BF4
|
||||
void IList<T>.Insert(int index, T item)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Token: 0x06000D9E RID: 3486 RVA: 0x0003B9FC File Offset: 0x00039BFC
|
||||
bool ICollection<T>.Remove(T item)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Token: 0x06000D9F RID: 3487 RVA: 0x0003BA04 File Offset: 0x00039C04
|
||||
void IList<T>.RemoveAt(int index)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Token: 0x1700020B RID: 523
|
||||
T IList<T>.this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700020C RID: 524
|
||||
// (get) Token: 0x06000DA2 RID: 3490 RVA: 0x0003BA20 File Offset: 0x00039C20
|
||||
bool ICollection<T>.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies the elements of the <see cref="T:System.Collections.ICollection" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.</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.ICollection" />. 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-<paramref name="array" /> does not have zero-based indexing.-or-The number of elements in the source <see cref="T:System.Collections.ICollection" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.ICollection" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x06000DA3 RID: 3491 RVA: 0x0003BA24 File Offset: 0x00039C24
|
||||
void ICollection.CopyTo(Array array, int index)
|
||||
{
|
||||
((ICollection)this.list).CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through a collection.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns>
|
||||
// Token: 0x06000DA4 RID: 3492 RVA: 0x0003BA38 File Offset: 0x00039C38
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.list.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>Adds an item to the <see cref="T:System.Collections.IList" />. This implementation always throws <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <returns>The position into which the new element was inserted.</returns>
|
||||
/// <param name="value">The <see cref="T:System.Object" /> to add to the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown.</exception>
|
||||
// Token: 0x06000DA5 RID: 3493 RVA: 0x0003BA48 File Offset: 0x00039C48
|
||||
int IList.Add(object value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Removes all items from the <see cref="T:System.Collections.IList" />. This implementation always throws <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown.</exception>
|
||||
// Token: 0x06000DA6 RID: 3494 RVA: 0x0003BA50 File Offset: 0x00039C50
|
||||
void IList.Clear()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the <see cref="T:System.Collections.IList" /> contains a specific value.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Object" /> is found in the <see cref="T:System.Collections.IList" />; otherwise, false.</returns>
|
||||
/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="value" /> is not of the type specified for the generic type parameter <paramref name="T" />.</exception>
|
||||
// Token: 0x06000DA7 RID: 3495 RVA: 0x0003BA58 File Offset: 0x00039C58
|
||||
bool IList.Contains(object value)
|
||||
{
|
||||
return Collection<T>.IsValidItem(value) && this.list.Contains((T)((object)value));
|
||||
}
|
||||
|
||||
/// <summary>Determines the index of a specific item in the <see cref="T:System.Collections.IList" />.</summary>
|
||||
/// <returns>The index of <paramref name="value" /> if found in the list; otherwise, -1.</returns>
|
||||
/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="value" /> is not of the type specified for the generic type parameter <paramref name="T" />.</exception>
|
||||
// Token: 0x06000DA8 RID: 3496 RVA: 0x0003BA78 File Offset: 0x00039C78
|
||||
int IList.IndexOf(object value)
|
||||
{
|
||||
if (Collection<T>.IsValidItem(value))
|
||||
{
|
||||
return this.list.IndexOf((T)((object)value));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>Inserts an item to the <see cref="T:System.Collections.IList" /> at the specified index. This implementation always throws <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <param name="index">The zero-based index at which <paramref name="value" /> should be inserted.</param>
|
||||
/// <param name="value">The <see cref="T:System.Object" /> to insert into the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown.</exception>
|
||||
// Token: 0x06000DA9 RID: 3497 RVA: 0x0003BA98 File Offset: 0x00039C98
|
||||
void IList.Insert(int index, object value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.IList" />. This implementation always throws <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <param name="value">The <see cref="T:System.Object" /> to remove from the <see cref="T:System.Collections.IList" />.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown.</exception>
|
||||
// Token: 0x06000DAA RID: 3498 RVA: 0x0003BAA0 File Offset: 0x00039CA0
|
||||
void IList.Remove(object value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Removes the <see cref="T:System.Collections.IList" /> item at the specified index. This implementation always throws <see cref="T:System.NotSupportedException" />.</summary>
|
||||
/// <param name="index">The zero-based index of the item to remove.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown.</exception>
|
||||
// Token: 0x06000DAB RID: 3499 RVA: 0x0003BAA8 File Offset: 0x00039CA8
|
||||
void IList.RemoveAt(int index)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe).</summary>
|
||||
/// <returns>true if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, false. In the default implementation of <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />, this property always returns false.</returns>
|
||||
// Token: 0x1700020D RID: 525
|
||||
// (get) Token: 0x06000DAC RID: 3500 RVA: 0x0003BAB0 File Offset: 0x00039CB0
|
||||
bool ICollection.IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</summary>
|
||||
/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />. In the default implementation of <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />, this property always returns the current instance.</returns>
|
||||
// Token: 0x1700020E RID: 526
|
||||
// (get) Token: 0x06000DAD RID: 3501 RVA: 0x0003BAB4 File Offset: 0x00039CB4
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IList" /> has a fixed size.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.IList" /> has a fixed size; otherwise, false. In the default implementation of <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />, this property always returns true.</returns>
|
||||
// Token: 0x1700020F RID: 527
|
||||
// (get) Token: 0x06000DAE RID: 3502 RVA: 0x0003BAB8 File Offset: 0x00039CB8
|
||||
bool IList.IsFixedSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IList" /> is read-only.</summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.IList" /> is read-only; otherwise, false. In the default implementation of <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />, this property always returns true.</returns>
|
||||
// Token: 0x17000210 RID: 528
|
||||
// (get) Token: 0x06000DAF RID: 3503 RVA: 0x0003BABC File Offset: 0x00039CBC
|
||||
bool IList.IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the element at the specified index.</summary>
|
||||
/// <returns>The element at the specified index.</returns>
|
||||
/// <param name="index">The zero-based index of the element to get.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is not a valid index in the <see cref="T:System.Collections.IList" />. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Always thrown if the property is set.</exception>
|
||||
// Token: 0x17000211 RID: 529
|
||||
object IList.this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Determines whether an element is in the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />.</summary>
|
||||
/// <returns>true if <paramref name="value" /> is found in the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />; otherwise, false.</returns>
|
||||
/// <param name="value">The object to locate in the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000DB2 RID: 3506 RVA: 0x0003BADC File Offset: 0x00039CDC
|
||||
public bool Contains(T value)
|
||||
{
|
||||
return this.list.Contains(value);
|
||||
}
|
||||
|
||||
/// <summary>Copies the entire <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> 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.ObjectModel.ReadOnlyCollection`1" />. 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">The number of elements in the source <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
|
||||
// Token: 0x06000DB3 RID: 3507 RVA: 0x0003BAEC File Offset: 0x00039CEC
|
||||
public void CopyTo(T[] array, int index)
|
||||
{
|
||||
this.list.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.Generic.IEnumerator`1" /> for the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />.</returns>
|
||||
// Token: 0x06000DB4 RID: 3508 RVA: 0x0003BAFC File Offset: 0x00039CFC
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
return this.list.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>Searches for the specified object and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />.</summary>
|
||||
/// <returns>The zero-based index of the first occurrence of <paramref name="item" /> within the entire <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" />, if found; otherwise, -1.</returns>
|
||||
/// <param name="value">The object to locate in the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
|
||||
// Token: 0x06000DB5 RID: 3509 RVA: 0x0003BB0C File Offset: 0x00039D0C
|
||||
public int IndexOf(T value)
|
||||
{
|
||||
return this.list.IndexOf(value);
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of elements contained in the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> instance.</summary>
|
||||
/// <returns>The number of elements contained in the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> instance.</returns>
|
||||
// Token: 0x17000212 RID: 530
|
||||
// (get) Token: 0x06000DB6 RID: 3510 RVA: 0x0003BB1C File Offset: 0x00039D1C
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list.Count;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns the <see cref="T:System.Collections.Generic.IList`1" /> that the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> wraps.</summary>
|
||||
/// <returns>The <see cref="T:System.Collections.Generic.IList`1" /> that the <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> wraps.</returns>
|
||||
// Token: 0x17000213 RID: 531
|
||||
// (get) Token: 0x06000DB7 RID: 3511 RVA: 0x0003BB2C File Offset: 0x00039D2C
|
||||
protected IList<T> Items
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the element at the specified index.</summary>
|
||||
/// <returns>The element at the specified index.</returns>
|
||||
/// <param name="index">The zero-based index of the element to get.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="index" /> is less than zero.-or-<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.ObjectModel.ReadOnlyCollection`1.Count" />. </exception>
|
||||
// Token: 0x17000214 RID: 532
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list[index];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400038C RID: 908
|
||||
private IList<T> list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user