// 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 Material { public bool? IsRawMaterial { get; set; } public bool? IsProcessed { get { return !IsRawMaterial; } } public String Name { get; set; } } public class Program { public static void Main(string[] args) { List lst = new List(); lst.Add(new Material{ Name = "Iron", IsRawMaterial = true }); lst.Add(new Material{ Name = "Concrete", IsRawMaterial = false }); foreach(Material m in lst) { Console.WriteLine("{0} : {1} {2}", m.Name, m.IsRawMaterial, m.IsProcessed); } } } }