Beispiel #1
0
        private void btnContinuar_click(object sender, RoutedEventArgs e)
        {
            WindowGame janela = new WindowGame();

            janela.Show();
            WindowGame2.Close();
        }
Beispiel #2
0
        private void btnCadastrar_click(object sender, RoutedEventArgs e)
        {
            if (txtLogin.Text != "" && txtSenha.Text != "")
            {
                if (txtSenha.Text == txtConfirma.Text)
                {
                    userModel.Username = Convert.ToString(txtLogin.Text);
                    userModel.Password = Convert.ToString(txtSenha.Text);
                    bool res;
                    res = bll.Incluir(userModel);
                    Aviso aviso = new Aviso("Usuário cadstrado!");
                    aviso.Show();

                    if (Entrar() > 0)
                    {
                        WindowGame janelaJogo = new WindowGame();
                        janelaJogo.Show();
                    }
                    this.Close();
                }
                else
                {
                    Aviso aviso = new Aviso("Senhas diferentes!");
                    aviso.Show();
                    txtSenha.Text    = "";
                    txtConfirma.Text = "";
                }
            }
            else
            {
                Aviso aviso = new Aviso("Preencher campos obrigatórios!");
                aviso.Show();
            }
        }
Beispiel #3
0
 private void btnJogar_Click(object sender, RoutedEventArgs e)
 {
     if (Entrar() > 0)
     {
         //chamar pagina de jogo
         WindowGame janelaGame = new WindowGame();
         janelaGame.Show();
         Hide();
     }
 }
Beispiel #4
0
        public void Contagem()
        {
            nuvem1.Visibility = Visibility.Collapsed;
            nuvem2.Visibility = Visibility.Collapsed;
            nuvem3.Visibility = Visibility.Collapsed;

            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = new TimeSpan(0, 0, 1); //intervalo de tempo, hora, min, segundo
            //timer.Tick += new EventHandler(timer_Tick);

            int hora = 00;
            int min  = 00;
            int sec  = 49;

            //FUNÇÃO TICK DE 1 SEGUNDO
            timer.Tick += (s, a) =>
            {
                string tempo = Convert.ToString(hora) + ":" + Convert.ToString(min) + ":" + Convert.ToString(sec);

                //QUANDO TIMER ZERAR, FECHA TELA 1 E ABRE TELA 2
                if (txtTime.Text == "00:00")
                {
                    try
                    {
                        //abre proxima janela
                        janela2.Show();
                        //fecha janela principal
                        WindowGame.Close();
                    }
                    catch
                    {
                        //quando fechar a janela 2, inicializa janela principal
                        WindowGame.Initialized += WindowGame_Initialized;
                    }
                }
                else
                {
                    txtTime.Text = Convert.ToDateTime(tempo).ToString("mm:ss");
                }

                if (sec > 0)
                {
                    sec--;
                }
                else if (sec <= 0)
                {
                    min--;
                    sec = 59;
                }
            };
            timer.Start();
        }
Beispiel #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.WindowGame1 = ((View.WindowGame)(target));

            #line 9 "..\..\WindowGame.xaml"
                this.WindowGame1.Initialized += new System.EventHandler(this.WindowGame1_Initialized);

            #line default
            #line hidden
                return;

            case 2:
                this.retTime = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 3:
                this.btnAplicar = ((System.Windows.Controls.Button)(target));

            #line 260 "..\..\WindowGame.xaml"
                this.btnAplicar.Click += new System.Windows.RoutedEventHandler(this.btnAplicar_click);

            #line default
            #line hidden
                return;

            case 4:
                this.btnLimpar = ((System.Windows.Controls.Button)(target));

            #line 281 "..\..\WindowGame.xaml"
                this.btnLimpar.Click += new System.Windows.RoutedEventHandler(this.LimparClick);

            #line default
            #line hidden
                return;

            case 5:
                this.btn1 = ((System.Windows.Controls.Button)(target));

            #line 297 "..\..\WindowGame.xaml"
                this.btn1.Click += new System.Windows.RoutedEventHandler(this.btn1Click);

            #line default
            #line hidden
                return;

            case 6:
                this.btn2 = ((System.Windows.Controls.Button)(target));

            #line 313 "..\..\WindowGame.xaml"
                this.btn2.Click += new System.Windows.RoutedEventHandler(this.btn2Click);

            #line default
            #line hidden
                return;

            case 7:
                this.btn3 = ((System.Windows.Controls.Button)(target));

            #line 329 "..\..\WindowGame.xaml"
                this.btn3.Click += new System.Windows.RoutedEventHandler(this.btn3Click);

            #line default
            #line hidden
                return;

            case 8:
                this.btn4 = ((System.Windows.Controls.Button)(target));

            #line 345 "..\..\WindowGame.xaml"
                this.btn4.Click += new System.Windows.RoutedEventHandler(this.btn4Click);

            #line default
            #line hidden
                return;

            case 9:
                this.btn5 = ((System.Windows.Controls.Button)(target));

            #line 361 "..\..\WindowGame.xaml"
                this.btn5.Click += new System.Windows.RoutedEventHandler(this.btn5Click);

            #line default
            #line hidden
                return;

            case 10:
                this.retResultado = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 11:
                this.lblResultado = ((System.Windows.Controls.Label)(target));
                return;

            case 12:
                this.btnRobo = ((System.Windows.Controls.Button)(target));
                return;

            case 13:
                this.nuvem1 = ((Microsoft.Expression.Controls.Callout)(target));
                return;

            case 14:
                this.nuvem2 = ((Microsoft.Expression.Controls.Callout)(target));
                return;

            case 15:
                this.nuvem3 = ((Microsoft.Expression.Controls.Callout)(target));
                return;

            case 16:
                this.txtTime = ((System.Windows.Controls.TextBox)(target));
                return;

            case 17:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.lblPontos = ((System.Windows.Controls.Label)(target));
                return;

            case 19:
                this.lblJogador = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }