private void btn_static_component_add_Click(object sender, EventArgs e) { if (tb_static_component.Text == "") { return; } Label l = new Label(); l.Text = tb_static_component.Text; l.Font = new Font(FontFamily.GenericMonospace, 8.0f); l.AutoSize = true; l.Click += skuComponentClicked; flp_sku.Controls.Add(l); SkuComponent component = new SkuComponent(); component.StaticText = tb_static_component.Text; SkuComponents.Add(component); tb_static_component.Text = ""; }
private void btn_prop_add_Click(object sender, EventArgs e) { Label l = new Label(); if (lb_products.SelectedItem == null || lb_properties.SelectedItem == null) { return; } l.Text = "<" + lb_products.SelectedItem + "." + lb_properties.SelectedItem + ">"; l.Font = new Font(FontFamily.GenericMonospace, 8.0f); l.AutoSize = true; l.Click += skuComponentClicked; flp_sku.Controls.Add(l); ProductProperty prop = Products.ElementAt(lb_products.SelectedIndex).Properties.ElementAt(lb_properties.SelectedIndex); SkuComponent component = new SkuComponent(); component.Property = prop; SkuComponents.Add(component); }