BF2Statistics.ManageStatsDBForm.ClearStatsBtn_Click C# (CSharp) Method

ClearStatsBtn_Click() private method

Clears the stats database of all data
private ClearStatsBtn_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void ClearStatsBtn_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(
                "Are you sure you want to clear the stats database? This will ERASE ALL stats data, and cannot be recovered!",
                "Confirm",
                MessageBoxButtons.OKCancel, 
                MessageBoxIcon.Warning) == DialogResult.OK)
            {
                try
                {
                    using (StatsDatabase Database = new StatsDatabase())
                    {
                        Database.Truncate();
                    }
                    Notify.Show("Database Successfully Cleared!", "All stats have successfully been cleared.", AlertType.Success);
                }
                catch (Exception E)
                {
                    MessageBox.Show(
                        "An error occured while clearing the stats database!\r\n\r\nMessage: " + E.Message, 
                        "Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error
                    );
                }
            }
        }
    }