Example #1
0
 /// <summary>
 /// We override Save here because we want to prompt for a new name if this table is new and the user has
 /// not changed the default name
 /// </summary>
 /// <returns></returns>
 protected override bool Save()
 {
     if (table.IsNew && table.Name == Name)
     {
         TableNamePromptDialog dlg = new TableNamePromptDialog();
         dlg.TableName = table.Name;
         if (DialogResult.Cancel == dlg.ShowDialog())
         {
             return(false);
         }
         table.Name = dlg.TableName;
     }
     return(base.Save());
 }
Example #2
0
 /// <summary>
 /// We override Save here because we want to prompt for a new name if this table is new and the user has
 /// not changed the default name
 /// </summary>
 /// <returns></returns>
 protected override bool Save()
 {
     if (_table.IsNew && _table.Name == Name)
     {
         TableNamePromptDialog dlg = new TableNamePromptDialog();
         dlg.TableName = _table.Name;
         if (DialogResult.Cancel == dlg.ShowDialog())
         {
             return(false);
         }
         _table.Name = dlg.TableName;
     }
     try
     {
         return(base.Save());
     }
     catch (MySqlClient.MySqlException ex)
     {
         // Undo name edited
         Debug.WriteLine(ex.Message);
         _table.Name = Name;
         throw;
     }
 }