Exemple #1
0
        private void btn_verify_Click(object sender, EventArgs e)
        {
            if (XMLSettings.VerifyXMLStructure(XMLPath, BatchClass.Name.Replace(" ", ""), out string message))
            {
                MessageBox.Show(message, "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                DialogResult result = MessageBox.Show(message + "\n\nDo you want to reset all values to default?", "ERROR", MessageBoxButtons.YesNo, MessageBoxIcon.Error);

                if (result == DialogResult.Yes)
                {
                    result = MessageBox.Show("Are you sure you want to reset everything back to default?\n\nAll data will be wiped!", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                    if (result == DialogResult.Yes)
                    {
                        XMLSettings.ResetBatchClassValuesToDefault(XMLPath, BatchClass.Name.Replace(" ", ""));
                        UpdateUI();
                        ApplyState(false);
                    }
                }
            }
        }