private void EnableUndo(MigrationTuple migration) { _undoToolStripMenuItem.Text = string.Format("Undo migration {0}", migration); _undoToolStripMenuItem.Enabled = true; }
private void ReserveMigrationNumber(MigrationType type) { try { var migrationNumber = _migrationNumberTrackerClient.ReserveMigrationNumber(type); var migrationTuple = new MigrationTuple { MigrationType = type, Number = migrationNumber, }; Settings.Default.LastResrevedMigration = migrationTuple; Settings.Default.Save(); Clipboard.SetText(migrationNumber.ToMigrationPrefix()); EnableUndo(migrationTuple); _mainIcon.ShowBalloonTip(2000, "Migration reserved successfully!", string.Format("Migration {0} reserved and copied to clipboard.", migrationTuple), ToolTipIcon.Info); } catch (Exception e) { HandleExceptionInHardcoreWay(e); } }