You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
709 B

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Net3_Proxy
{
public class IReadOnlyList<T> : IEnumerable<T>
{
private IList<T> list;
private IReadOnlyList(IList<T> lst)
{
list = lst;
}
public IEnumerator<T> GetEnumerator() => list.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)list).GetEnumerator();
public int Count => list.Count;
public T this[int index] => list[index];
public static implicit operator IReadOnlyList<T>(List<T> list) => new IReadOnlyList<T>(list);
}
}