示例#1
0
        private void CallBack(IAsyncResult results)
        {
            RunTaskAsync restoreDB = results.AsyncState as RunTaskAsync;

            restoreDB.EndInvoke(results);

            try
            {
                MessageBox.Show("Operation completed successfully", "Restore", MessageBoxButtons.OK, MessageBoxIcon.Information);
                complete = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Restore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void CallBack(IAsyncResult results)
        {
            try
            {
                RunTaskAsync backupDB = results.AsyncState as RunTaskAsync;
                backupDB.EndInvoke(results);

                exitLoop = true;
                endTime  = DateTime.Now.ToShortTimeString();

                SaveBackupDetails();

                UpdateDefaultFileName();
                MessageBox.Show("Operation completed successfully", "Backup", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Backup", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }