Ejemplo n.º 1
0
        //恢复默认设置
        private void btnDefault_Click(object sender, EventArgs e)
        {
            //询问是否恢复默认设置
            if (MessageBox.Show("恢复默认设置?当前未保存的设置将会丢失", "恢复默认设置", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            //保存新设置
            AcDownSettings s = new AcDownSettings();

            Config.setting = s;
            Config.SaveSettings();
            //关闭窗体
            this.Close();
        }
Ejemplo n.º 2
0
        //恢复默认设置
        private void btnDefault_Click(object sender, EventArgs e)
        {
            //询问是否恢复默认设置
            if (MessageBox.Show("恢复默认设置?当前未保存的设置将会丢失", "恢复默认设置", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            //保存新设置
            AcDownSettings s = new AcDownSettings();

            CoreManager.ConfigManager.Settings = s;
            CoreManager.ConfigManager.SaveSettings();
            //删除Firstrun文件
            FirstrunHandler fh = new FirstrunHandler();

            fh.DeleteFirstRunFile();

            //关闭窗体
            this.Close();
        }