Beispiel #1
0
 private void Login_Button_Click(object sender, EventArgs e)
 {
     try
     {
         Login_Button.Enabled = false;
         if (MCHandler.AuthenticateLogin(Username_Login.Text, password_login.Text))
         {
             Launch2.l2.SwitchWindows(12);
         }
         Login_Button.Enabled = true;
     }
     catch (Exception errormessage)
     {
         ErrorWindow ew = new ErrorWindow(errormessage);
         ew.Show();
     }
 }
 public void SwitchWindows(int id)
 {
     try
     {
         HideAllWindows();
         if (id == 0)
         {
             HomeWindow.Visible         = true;
             this.BackColor             = System.Drawing.Color.Black;
             this.BackgroundImage       = global::GADD_Application.Properties.Resources.split_logo;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
         }
         //MC Login Window
         if (id == 11)
         {
             if (GADD_Application.Properties.Settings.Default.username != "" && GADD_Application.Properties.Settings.Default.password != "")
             {
                 if (MCHandler.AuthenticateLogin(GADD_Application.Properties.Settings.Default.username, GADD_Application.Properties.Settings.Default.password))
                 {
                     SwitchWindows(12);
                 }
                 else
                 {
                     LoginWindow.Visible        = true;
                     this.BackColor             = System.Drawing.Color.Black;
                     this.BackgroundImage       = global::GADD_Application.Properties.Resources.Minecraft_Path_Tracing_Feature;
                     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                 }
             }
             else
             {
                 LoginWindow.Visible        = true;
                 this.BackColor             = System.Drawing.Color.Black;
                 this.BackgroundImage       = global::GADD_Application.Properties.Resources.Minecraft_Path_Tracing_Feature;
                 this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             }
         }
         //MC Main Window
         if (id == 12)
         {
             MCMainWindow.Visible = true;
             MainWindowMC.MWMC.InitializeWindow();
             this.BackColor             = System.Drawing.Color.Black;
             this.BackgroundImage       = global::GADD_Application.Properties.Resources.Minecraft_Path_Tracing_Feature;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
         }
         if (id == 21)
         {
             mainWindowArma.Visible = true;
             MainWindowArma.MWArma.InitializeWindow();
             this.BackColor             = System.Drawing.Color.Black;
             this.BackgroundImage       = global::GADD_Application.Properties.Resources.Liv1_Phil;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
         }
     }
     catch (Exception errormessage)
     {
         SphubCore.ErrorWindow ew = new SphubCore.ErrorWindow(errormessage);
         ew.Show();
     }
 }
 private void MCGPPlay_Click(object sender, EventArgs e)
 {
     MCHandler.Play();
 }