Exemplo n.º 1
0
        private void btShrink_Click(object sender, EventArgs e)
        {
            if (!CreateBackup())
            {
                return;
            }

            bool ok = false;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                ok = db.Shrink(tbFileName.Text, openPassword, tbPassword.Text.Trim());
                if (ok)
                {
                    GlobalText.ShowInfo("ShrinkDone");
                }
                else
                {
                    GlobalText.ShowError("ShrinkError", db.LastError);
                }
            }
            catch (Exception ex)
            {
                GlobalText.ShowError("ShrinkError", ex.Message);
            }
            this.Cursor = Cursors.Default;

            if (ok)
            {
                LoadDatabase(tbFileName.Text, tbPassword.Text.Trim());
            }
            SetActiveButtons();
        }