Пример #1
0
        private void ProcessStartWorker(int genNum)
        {
            int x = _rnd.Next(0, _upperBound);
            int y = _rnd.Next(0, _upperBound);

            Point point = new Point(x, y);

            List <Point> points = new List <Point> {
                point
            };

            PointsMsg msg = new PointsMsg(points);

            Context.Parent.Tell(msg);

            genNum = genNum - 1;

            if (genNum == 0)
            {
                Context.Self.Tell(PoisonPill.Instance);
            }
            else
            {
                Context.System.Scheduler.ScheduleTellOnce(TimeSpan.FromMilliseconds(200), Self, new InfoForWorker(genNum), Self);
            }
        }
 private void DrawPoints(PointsMsg x)
 {
     _pictureBox.AddRange(x.Points);
     _lblResult.Text        = ProcjeniPi().ToString();
     _lblPointsCreated.Text = _pictureBox.AllPoints.ToString();
 }