예제 #1
0
        private void btnMaciBitir_Click(object sender, RoutedEventArgs e)
        {
            frmMacBitir frm = new frmMacBitir();

            frm.ShowDialog();
            db.Kayitlar.InsertOnSubmit(new Kayitlar
            {
                macid = Global.MacId,
                tarih = DateTime.Now,
                islem = Global.KayitBaslik + "Maç bitir ekranı açıldı"
            });
            MacBitti();
            db.SubmitChanges();
            //  DegerSifirla();
            if (frm.Bitti)
            {
                if (frm.Kazanan)
                {
                    frmMacBitti frm2 = new frmMacBitti(Global.KirmiziAd, Global.KirmiziUlke, Global.KirmiziUlkeBayrak, Global.KirmiziRenk.Clone());
                    frm2.ShowDialog();
                }
                else
                {
                    frmMacBitti frm2 = new frmMacBitti(Global.MaviAd, Global.MaviUlke, Global.MaviUlkeBayrak, Global.MaviRenk.Clone());
                    frm2.ShowDialog();
                }
            }
        }
예제 #2
0
        private void Global_MaviSkorDegistiEvent(int Skor, int Adet)
        {
            lblMaviSkor.Dispatcher.Invoke(() =>
            {
                lblMaviSkor.Content = Skor;
            });
            //  playbackDevice.Stop();
            if (Adet == 1)
            {
                fileStream1.Position = 0;
                if (Global.SesEfekti)
                {
                    Player1.Play();
                }
            }
            else if (Adet == 2)
            {
                fileStream2.Position = 0;
                if (Global.SesEfekti)
                {
                    Player2.Play();
                }
            }
            else if (Adet == 3)
            {
                fileStream3.Position = 0;
                if (Global.SesEfekti)
                {
                    Player3.Play();
                }
            }

            if (Skor >= Global.MaxPuanSayi && Global.MaxPuan)
            {
                Global.MacBitti = true;
                MacBitti();
            }
            if (Skor - Global.KirmiziSkor >= 20 && Global.OnikiFarkPuani)
            {
                frmMacBitti frm = new frmMacBitti(Global.MaviAd, Global.MaviUlke, Global.MaviUlkeBayrak, Global.MaviRenk.Clone());
                frm.ShowDialog();
                MacBitti();
            }
            if (Global.RaundSayisi == 0)
            {
                frmMacBitti frm = new frmMacBitti(Global.MaviAd, Global.MaviUlke, Global.MaviUlkeBayrak, Global.MaviRenk.Clone());
                frm.ShowDialog();
                MacBitti();
            }
        }
예제 #3
0
        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            if (Global.MacBitti)
            {
                if (Global.MaviSkor > Global.KirmiziSkor)
                {
                    frmMacBitti frm = new frmMacBitti(Global.MaviAd, Global.MaviUlke, Global.MaviUlkeBayrak, Global.MaviRenk.Clone());

                    frm.ShowDialog();
                }
                else if (Global.KirmiziSkor > Global.MaviSkor)
                {
                    frmMacBitti frm = new frmMacBitti(Global.KirmiziAd, Global.KirmiziUlke, Global.KirmiziUlkeBayrak, Global.KirmiziRenk.Clone());

                    frm.ShowDialog();
                }

                Global.MacBitti = false;
            }
        }