private void MainForm_Load(object sender, EventArgs e) { for (int i = 0; i < 3; i++) { Product product = new Product(i,Math.Pow(i,2)); //product.Code = i; //product.Prijs = Math.Pow(i, 2); producten.Add(product); } for (int i = 0; i < 3; i++) { Auto auto = new Auto(4,"Grijs"); auto.Code = i; auto.Prijs = Math.Pow(i, 2); producten.Add(auto); } foreach (Product p in producten) { lstProducten.Items.Add(p.ToonDetails()); } }
public Auto(Product product,int wielen, String kleur) : base() { this.Code = product.Code; this.Prijs = product.Prijs; this.Wielen = wielen; this.Kleur = kleur; }
public Product(Product product) { product = this; }