Example #1
0
 public SerialFigure(Figure.Figure fig)
 {
     X1        = fig.X1;
     X2        = fig.X2;
     Y1        = fig.Y1;
     Y2        = fig.Y2;
     penColor  = fig.pen.color;
     penWidth  = fig.pen.Width;
     Name      = fig.GetName();
     Direction = fig.Direction;
     if (fig is MyInterfaces.IFillingable)
     {
         isFilled = ((MyInterfaces.IFillingable)fig).isFilled;
     }
     figtype      = fig.GetType().ToString();
     isUserFigure = fig.isUserFigure;
     if (fig is UserFigure)
     {
         Hash = ((UserFigure)fig).SourceFigures.CalculateHash();
     }
     else
     {
         Hash = 0;
     }
 }
Example #2
0
 private void MD_NewFigureBegin(MouseEventArgs ee)
 {
     btnBack.Enabled = true;
     if (!isChanged)
     {
         figure = (Figure.Figure)Activator.CreateInstance(figure.GetType(), FigParams);
     }
     FigList.Add(figure);
     if (FigList.Last is MyInterfaces.IFillingable)
     {
         ((MyInterfaces.IFillingable)figure).isFilled = isFill;
     }
     FigList.Last.X1 = ee.X;
     FigList.Last.Y1 = ee.Y;
     grMajor.DrawImage(Layers[2], 0, 0);
     grTemp.Clear(Color.Transparent);
     isPressed = true;
     isChanged = false;
 }