public static void AsyncMove(Figure hostFigure, Point coordinates, Figure [] figures) { MovingHelper mH = new MovingHelper { Figures = figures, Coordinate = coordinates, HostFigure = hostFigure }; Thread t = new Thread(mH.Move); t.Start(); }
private void pbFigures_Paint(object sender, PaintEventArgs e) { pbMaxCoordinate = new Point(pbFigures.Right, pbFigures.Bottom);// Figure[] currentFigures = (from f in figures select f).ToArray(); if (figures.Count > 0) { foreach (var f in figures) { MovingHelper.AsyncMove(f, pbMaxCoordinate, currentFigures); f.Draw(e.Graphics); } } }