Exemple #1
0
        private void Start_btn_Click(object sender, EventArgs e)
        {
            Rocket rocket = new Rocket();
            //движение ракеты
            Thread       moveRocketThread = new Thread(new ParameterizedThreadStart(Utils.MoveObjectRocket));
            ClassForMove objRocket        = new ClassForMove(rocket, Rocket_pb, Backhround_pb);

            moveRocketThread.Start(objRocket);
            //выход космонавтов
            Thread       moveCosmonautThread = new Thread(new ParameterizedThreadStart(Utils.CheckSuccesfullStart));
            ClassForMove objCosmonaut        = new ClassForMove(rocket, Cosmonaut_pb, Backhround_pb);

            moveCosmonautThread.Start(objCosmonaut);
            //выплата страховки
            Insurance    insurance       = new InsuranceRocket();
            Thread       insuranceThread = new Thread(new ParameterizedThreadStart(Utils.CheckCrashStatus));
            ClassForMove objInsurance    = new ClassForMove(rocket, Money_pb, Backhround_pb);

            insuranceThread.Start(objInsurance);
        }
Exemple #2
0
        private static void StartMoving(PictureBox rocket_pb, PictureBox cosmonaut_pb, PictureBox insurance_pb, PictureBox bg_pb, Panel panel)
        {
            panel.Invoke(new MethodInvoker(() =>
                                           panel.Visible = true));
            Rocket rocket = new Rocket();
            //движение ракеты
            Thread       moveRocketThread = new Thread(new ParameterizedThreadStart(Utils.MoveObjectRocket));
            ClassForMove objRocket        = new ClassForMove(rocket, rocket_pb, bg_pb, NearestCount1, NearestCount2);

            moveRocketThread.Start(objRocket);
            //выход космонавтов
            Thread       moveCosmonautThread = new Thread(new ParameterizedThreadStart(Utils.CheckSuccesfullStart));
            ClassForMove objCosmonaut        = new ClassForMove(rocket, cosmonaut_pb, bg_pb, NearestCount1, NearestCount2);

            moveCosmonautThread.Start(objCosmonaut);
            //выплата страховки
            Insurance    insurance       = new InsuranceRocket();
            Thread       insuranceThread = new Thread(new ParameterizedThreadStart(Utils.CheckCrashStatus));
            ClassForMove objInsurance    = new ClassForMove(rocket, insurance_pb, bg_pb, NearestCount1, NearestCount2);

            insuranceThread.Start(objInsurance);
        }