listcollection!1.cs

来自「破解的飞信源代码」· CS 代码 · 共 107 行

CS
107
字号
namespace Imps.Utils
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Reflection;

    public class ListCollection<T> : ICollection<T>, IEnumerable<T>, IEnumerable
    {
        private List<T> List;

        public ListCollection()
        {
            this.List = new List<T>();
        }

        public void Add(T item)
        {
            this.List.Add(item);
        }

        public void Clear()
        {
            this.List.Clear();
        }

        public bool Contains(T item)
        {
            return this.List.Contains(item);
        }

        public void CopyTo(T[] array)
        {
            this.List.CopyTo(array);
        }

        public void CopyTo(T[] array, int index)
        {
            this.List.CopyTo(array, index);
        }

        public void CopyTo(int index, T[] array, int arrayIndex, int count)
        {
            this.List.CopyTo(index, array, arrayIndex, count);
        }

        public IEnumerator<T> GetEnumerator()
        {
            return this.GetEnumerator();
        }

        public int IndexOf(T item)
        {
            return this.List.IndexOf(item);
        }

        public void Insert(int index, T item)
        {
            this.List.Insert(index, item);
        }

        public bool Remove(T item)
        {
            return this.List.Remove(item);
        }

        public void RemoveAt(int index)
        {
            this.List.RemoveAt(index);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.List.GetEnumerator();
        }

        public int Count
        {
            get
            {
                return this.List.get_Count();
            }
        }

        public bool IsReadOnly
        {
            get
            {
                return true;
            }
        }

        public T this[int index]
        {
            get
            {
                return this.List.get_Item(index);
            }
            set
            {
                this.List.set_Item(index, value);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?