Exemplo n.º 1
0
 private void ProcessField(Field NewField)
 {
     if (gamemode)
     {
         WaitForPlayerForm LookForParnter = new WaitForPlayerForm();
         LookForParnter.Owner = this;
         if (LookForParnter.ShowDialog() == DialogResult.OK)
         {
             GameForm       = new FieldForm(new Game(NewField, true));
             GameForm.Owner = this;
             this.Hide();
             GameForm.ShowDialog();
         }
     }
     else
     {
         ConnectToTheGameForm ConnectForm = new ConnectToTheGameForm();
         ConnectForm.Owner = this;
         if (ConnectForm.ShowDialog() == DialogResult.OK)
         {
             GameForm       = new FieldForm(new Game(NewField, false));
             GameForm.Owner = this;
             this.Hide();
             GameForm.ShowDialog();
         }
     }
     this.Show();
 }
Exemplo n.º 2
0
 ///////////////////////SafeUpdaters-----------------------------------------------------------------------------------------------------------------------------
 private void SafeClose(FieldForm form)
 {
     if (form.InvokeRequired)
     {
         SafeFormClose CloseForm = new SafeFormClose(SafeClose);
         this.Invoke(CloseForm, form);
     }
     else
     {
         form.Close();
     }
 }