// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; namespace E { public class Investment { } public class Stock : Investment { } public class OtherInvestment : Investment { } public interface IROList { T this[int ix] { get; } int Count { get; } } public class ROList : IROList where T2 : T,new() { private IList real; public ROList(IList orig) { real = orig; } public T this[int ix] { get { return real[ix]; } } public int Count { get { return real.Count; } } } public class Program { public static void Main(string[] args) { //IList lst = new List(); IROList lst1 = new ROList(new List()); IROList lst2 = new ROList(new List()); } } }