// 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; namespace E { public abstract class MoldPart { public string PartNo { get; set; } public double Width { get; set; } public double Length { get; set; } public double Thickness { get; set; } public MoldPart(string partno, double width, double length, double thickness) { this.PartNo = partno; this.Width = width; this.Length = length; this.Thickness = thickness; } } public class MoldSide : MoldPart { public bool LongSide { get; set; } public MoldSide(string partno, double width, double length, double thickness, bool longside) : base(partno, width, length, thickness) { this.LongSide = longside; } } public class Program { public static void Main(string[] args) { MoldPart o = new MoldSide("#123", 2.0, 12.0, 0.01, true); Console.WriteLine(o.PartNo + " : " + o.Width + " x " + o.Length); } } }