示例#1
0
 private new void Paint(object sender, PaintEventArgs e)
 {
     if (_startPaint)
     {
         ShapesList.Draw(e.Graphics);
         _startPaint = false;
         Refresh();
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
        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();
        }