using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZSMusic.Winform
{
    public partial class FrmQuestion : UIForm
    {
        public FrmQuestion()
        {
            InitializeComponent();
        }

        private int errCount = 0;

        private void Answer(object sender, int index, string text)
        {
            UIRadioButtonGroup r = sender as UIRadioButtonGroup;
            if (r.SelectedIndex == Convert.ToInt32(r.Tag))
            {
                r.Style = UIStyle.Green;
            }
            else
            {
                r.Style = UIStyle.Red;
                errCount++;
                if (errCount >= 3)
                {
                    this.ShowErrorDialog("再接再厉!");
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                }
            }
            UIRadioButtonGroup[] list = new UIRadioButtonGroup[] { uiRadioButtonGroup1, uiRadioButtonGroup2, uiRadioButtonGroup3, uiRadioButtonGroup4, uiRadioButtonGroup5, uiRadioButtonGroup6 };
            if (list[0].Style == UIStyle.Green && list[1].Style == UIStyle.Green && list[2].Style == UIStyle.Green && list[3].Style == UIStyle.Green && list[4].Style == UIStyle.Green && list[5].Style == UIStyle.Green)
            {
                this.DialogResult = DialogResult.OK;
                UserSettings.Current.启用高级选项=true;
                this.Close();
            }
        }
    }
}
