예제 #1
0
 private void ConfigureCatalogueExtractabilityUI_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!_choicesFinalised)
     {
         if (_importedNewTable)
         {
             var confirm = MessageBox.Show("The database table was created as part of this import. Do you want to keep that?",
                                           "Confirm", MessageBoxButtons.YesNoCancel);
             if (confirm != DialogResult.Cancel)
             {
                 DialogResult = DialogResult.Cancel;
                 _catalogue.DeleteInDatabase();
                 _catalogue = null;
                 if (confirm == DialogResult.No)
                 {
                     _tableInfo.DeleteInDatabase();
                     _tableInfo = null;
                     if (TableCreated != null && TableCreated.Exists())
                     {
                         TableCreated.Drop();
                     }
                 }
                 else
                 {
                     Activator.Publish(TableInfoCreated);
                 }
             }
             else
             {
                 e.Cancel = true;
             }
         }
         else
         {
             if (MessageBox.Show(
                     "Are you sure you want to Cancel?",
                     "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 DialogResult = DialogResult.Cancel;
                 _catalogue.DeleteInDatabase();
                 _catalogue = null;
             }
             else
             {
                 e.Cancel = true;
             }
         }
     }
     else
     {
         if (CatalogueCreatedIfAny != null)
         {
             Activator.Publish(CatalogueCreatedIfAny);
         }
     }
 }
예제 #2
0
 public void Handle(TableCreated e)
 {
     _tables.Save(new TableView()
     {
         Id         = e.Id,
         Name       = e.Name,
         BuyIn      = e.BuyIn,
         SmallBlind = e.SmallBlind,
         MaxPlayers = e.MaxPlayers
     });
 }
예제 #3
0
 public void Handle(TableCreated e)
 {
     UsersHub.CurrentContext.Clients.Group(e.Metadata.UserId).goToTablesView();
 }
예제 #4
0
 /// <summary>
 /// Create table in DB
 /// </summary>
 protected virtual void OnTableCreated()
 {
     TableCreated?.Invoke(this, System.EventArgs.Empty);
 }
예제 #5
0
 protected virtual void OnTableCreated(TableEventArgs e) => TableCreated?.Invoke(this, e);
 /// <summary>
 ///
 /// </summary>
 /// <param name="tableInfo"></param>
 public static void TableCreatedInvoke(TableInfo tableInfo)
 {
     TableCreated?.Invoke(tableInfo);
 }