private void ShowLoginForm() { var frmAuth = new LogIn(_serviceCalls); frmAuth.FormClosed += FrmAuthOnFormClosed; frmAuth.ShowDialog(this); frmAuth.Dispose(); }
void ReleaseDesignerOutlets() { if (btnLogin != null) { btnLogin.Dispose(); btnLogin = null; } if (dataProgressLabel != null) { dataProgressLabel.Dispose(); dataProgressLabel = null; } if (headerView != null) { headerView.Dispose(); headerView = null; } if (lblDate != null) { lblDate.Dispose(); lblDate = null; } if (LogIn != null) { LogIn.Dispose(); LogIn = null; } if (loginScrollView != null) { loginScrollView.Dispose(); loginScrollView = null; } if (progressView != null) { progressView.Dispose(); progressView = null; } if (txtPassword != null) { txtPassword.Dispose(); txtPassword = null; } if (txtUserName != null) { txtUserName.Dispose(); txtUserName = null; } }
private void BttnStartGame_Click(object sender, EventArgs e) { tableLayoutPanel1.Hide(); start = new LogIn { Dock = DockStyle.Fill }; start.startGame = () => { start.Dispose(); Controls.Remove(start); Controls.Add(ca); bttnStartGame.Focus(); ca.GamePage = (wo) => { gP = wo; }; ca.TerminarJuego = () => { player.Score = DatosJuego.puntaje; PlayerDAO.CreateNew(player); DatosJuego.vidas = 3; DatosJuego.ticksRealizados = 0; DatosJuego.puntaje = 0; Controls.Remove(ca); ca = null; ca = new ControlArkanoid { Dock = DockStyle.Fill, }; ca.Width = Width; ca.Height = Height; if (gP) { Controls.Add(w); } else { Controls.Add(gO); } }; bttnStartGame.Focus(); }; Controls.Add(start); }
private void Form1_Load(object sender, EventArgs e) { start = new LogIn { Dock = DockStyle.Fill }; topScores = new HighScores { Dock = DockStyle.Fill }; ca = new ControlArkanoid { Dock = DockStyle.Fill }; ca.Width = Width; ca.Height = Height; player = new Player(); gO = new GameOverUser { Dock = DockStyle.Fill }; gO.backToMenu = () => { Controls.Remove(gO); tableLayoutPanel1.Show(); }; w = new Winner { Dock = DockStyle.Fill }; w.backToMenuW = () => { Controls.Remove(w); tableLayoutPanel1.Show(); }; start.startGame = () => { start.Dispose(); Controls.Remove(start); Controls.Add(ca); bttnStartGame.Focus(); ca.GamePage = (wo) => { gP = wo; }; ca.TerminarJuego = () => { player.Score = DatosJuego.puntaje; PlayerDAO.CreateNew(player); DatosJuego.vidas = 3; DatosJuego.ticksRealizados = 0; DatosJuego.puntaje = 0; Controls.Remove(ca); ca = null; ca = new ControlArkanoid { Dock = DockStyle.Fill, }; ca.Width = Width; ca.Height = Height; if (gP) { Controls.Add(w); } else { Controls.Add(gO); } }; bttnStartGame.Focus(); }; topScores.backMenu = () => { Controls.Remove(topScores); tableLayoutPanel1.Show(); }; ca.GamePage = (wo) => { gP = wo; }; ca.TerminarJuego = () => { player.Score = DatosJuego.puntaje; PlayerDAO.CreateNew(player); Controls.Remove(ca); DatosJuego.vidas = 3; DatosJuego.puntaje = 0; DatosJuego.ticksRealizados = 0; ca = null; ca = new ControlArkanoid { Dock = DockStyle.Fill, }; ca.Width = Width; ca.Height = Height; if (gP) { Controls.Add(w); } else { Controls.Add(gO); } }; bttnStartGame.Focus(); }