private void createOrnament(Shape s, Composite c, string location, string text) { switch (location) { case "Above": { AboveOrnament aOrnament = new AboveOrnament(s, c, text); CreateLabel(aOrnament, location, text, s, c); break; } case "Below": { BelowOrnament bOrnament = new BelowOrnament(s, c, text); CreateLabel(bOrnament, location, text, s, c); break; } case "Left": { LeftOrnament lOrnament = new LeftOrnament(s, c, text); CreateLabel(lOrnament, location, text, s, c); break; } case "Right": { RightOrnament rOrnament = new RightOrnament(s, c, text); CreateLabel(rOrnament, location, text, s, c); break; } } }
private void saveBtn_Click(object sender, EventArgs e) { if (ornamentInput.Text.Equals("")) { MessageBox.Show("Voer het ornament velt in."); } else { switch (comboBox1.SelectedItem.ToString()) { case "Above": { AboveOrnament aOrnament = new AboveOrnament(currentShape, currentGroup, ornamentInput.Text.ToString()); CreateLabel(aOrnament, "Above"); break; } case "Below": { BelowOrnament bOrnament = new BelowOrnament(currentShape, currentGroup, ornamentInput.Text.ToString()); CreateLabel(bOrnament, "Below"); break; } case "Left": { LeftOrnament lOrnament = new LeftOrnament(currentShape, currentGroup, ornamentInput.Text.ToString()); CreateLabel(lOrnament, "Left"); break; } case "Right": { RightOrnament rOrnament = new RightOrnament(currentShape, currentGroup, ornamentInput.Text.ToString()); CreateLabel(rOrnament, "Right"); break; } } } }
private void addOrnament(Shape s, Composite c) { switch (locationCombo.SelectedItem.ToString()) { case "Above": { AboveOrnament aOrnament = new AboveOrnament(s, c, OrnamentTextBox.Text.ToString()); CreateLabel(aOrnament, "top"); break; } case "Below": { BelowOrnament bOrnament = new BelowOrnament(s, c, OrnamentTextBox.Text.ToString()); CreateLabel(bOrnament, "bottom"); break; } case "Left": { LeftOrnament lOrnament = new LeftOrnament(s, c, OrnamentTextBox.Text.ToString()); CreateLabel(lOrnament, "left"); break; } case "Right": { RightOrnament rOrnament = new RightOrnament(s, c, OrnamentTextBox.Text.ToString()); CreateLabel(rOrnament, "right"); break; } } }