Ejemplo n.º 1
0
        public void DragMoveLine(int Xl, int Yl)
        {
            Line line = CLineList.Where(o => o.Otrisovka).FirstOrDefault();

            if (line != null)
            {
                CFigure cFigure = CFigureList.Where(o => o.Id == line.IdFigureNachalo).FirstOrDefault();
                line.PositionLineKonec = new Point(Xl, Yl);

                numMin = PologenieLine.OptimalPut(cFigure, line.PositionLineKonec);
                line.PositionLineNachalo = new Point(cFigure.SerediniStoron[numMin].X, cFigure.SerediniStoron[numMin].Y);
            }
        }
Ejemplo n.º 2
0
        public void DragMouseUpLine(int Xl, int Yl)
        {
            CFigure cFigure = CFigureList.Where(o => o.Vhod(Xl, Yl)).FirstOrDefault();

            Line line = CLineList.Where(o => o.Otrisovka).FirstOrDefault();

            if (cFigure != null && line != null && line.PositionLineNachalo != line.PositionLineKonec)
            {
                numMin = PologenieLine.OptimalPut(cFigure, line.PositionLineNachalo);
                line.PositionLineKonec = new Point(cFigure.SerediniStoron[numMin].X, cFigure.SerediniStoron[numMin].Y);
                line.IdFigureKonec     = cFigure.Id;

                line.Otrisovka = false;
            }
            else
            {
                CLineList.Remove(line);
            }
        }