using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
class ConverterCollection : Collection
{
private Converter convert;
public ConverterCollection(Converter convert)
{
this.convert = convert;
}
protected override void InsertItem(int index, T item)
{
base.InsertItem(index, convert(item));
}
}
public class MainClass
{
public static void Main()
{
ConverterCollection c = new ConverterCollection(
delegate (string s) { return s.ToUpper(); });
c.Add("Hello");
c.Add("World!");
foreach (string s in c)
Console.WriteLine(s);
}
}