private new void Paint(object sender, PaintEventArgs e) { if (_startPaint) { ShapesList.Draw(e.Graphics); _startPaint = false; Refresh(); } }
private void button4_Click(object sender, EventArgs e) { foreach (var t in Serializer.Deserialize <List <Figure> >("serialize.xml")) { t.Pen = new Pen(Brushes.Red) { Width = 2 }; t.Draw = Draws[t.GetType().Name]; ShapesList.AddShape(t); } }
public override void AddShape() { Point point1 = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Point point2 = new Point(int.Parse(Point2X.Text), int.Parse(Point2Y.Text)); MethodInfo method = _rhombDialog.GetMethod("AddShape"); if (method != null) { var rhomb = method.Invoke(_rhombDialogObject, new object[] { point1, point2 }); Adapter adapter = new Adapter(new PolygonDraw(), rhomb); ShapesList.AddShape(adapter); } MessageBox.Show(@"Success"); Clean(); }