// 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; using System.Threading; namespace Modern { public class Data { public DateTime Created { get; set; } public int Counted { get; set; } public Data(int c) { Created = DateTime.Now; Counted = c; } public override string ToString() { return string.Format("[{0}: {1}]", Created, Counted); } } public class Program { public static void Dump(List lstd) { foreach (Data d in lstd) { Console.WriteLine(d); } } public static void Main(string[] args) { Console.WriteLine("C#"); List alld = new List(); alld.Add(new Data(37)); Thread.Sleep(1000); alld.Add(new Data(32)); Thread.Sleep(1000); alld.Add(new Data(19)); Thread.Sleep(1000); alld.Add(new Data(50)); Dump(alld); Console.ReadKey(); } } }