Пример #1
0
 private void allowCustomCPUModelToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (useCustomCPUModelToolStripMenuItem.Checked == true)
     {
         IniFunc.writeString("ReCPU", "UseCustomCPU", "true", ApplicationData + @"\ReCPU\Settings.ini");
         inputsellab.Text   = "Input CPU model:";
         dein.DropDownStyle = ComboBoxStyle.DropDown;
         dein.Items.Clear();
         dein.Enabled     = true;
         dein.Text        = null;
         manuname.Enabled = false;
         manuname.Items.Clear();
         manuname.Text = null;
         modu1.Enabled = false;
         modu1.Items.Clear();
         modu1.Text     = null;
         cpugen.Enabled = false;
         cpugen.Items.Clear();
         cpugen.Text = null;
     }
     else
     {
         IniFunc.writeString("ReCPU", "UseCustomCPU", "false", ApplicationData + @"\ReCPU\Settings.ini");
         inputsellab.Text   = "Select CPU model:";
         dein.DropDownStyle = ComboBoxStyle.DropDownList;
         manuname.Enabled   = true;
         modu1.Enabled      = true;
         cpugen.Enabled     = true;
         manuname.Items.Clear();
         manuname.Items.Add("Intel Core");
     }
     usecustomcpu = IniFunc.getString("ReCPU", "UseCustomCPU", "false", ApplicationData + @"\ReCPU\Settings.ini");
 }
Пример #2
0
 public Form1()
 {
     if (!Directory.Exists(ApplicationData + @"\ReCPU"))
     {
         Directory.CreateDirectory(ApplicationData + @"\ReCPU");
     }
     if (!File.Exists(ApplicationData + @"\ReCPU\Settings.ini"))
     {
         File.Create(ApplicationData + @"\ReCPU\Settings.ini").Close();
     }
     InitializeComponent();
     //if (File.Exists(ApplicationData + @"\ReCPU\clear"))
     enableblur   = IniFunc.getString("ReCPU", "ClearMode", "false", ApplicationData + @"\ReCPU\Settings.ini");
     usecustomcpu = IniFunc.getString("ReCPU", "UseCustomCPU", "false", ApplicationData + @"\ReCPU\Settings.ini");
     if (enableblur == "true")
     {
         EnableBlur();
         isclear.Checked = true;
     }
     if (usecustomcpu == "true")
     {
         inputsellab.Text   = "Input or select CPU model:";
         dein.DropDownStyle = ComboBoxStyle.DropDown;
         useCustomCPUModelToolStripMenuItem.Checked = true;
         manuname.Enabled = false;
         modu1.Enabled    = false;
         cpugen.Enabled   = false;
     }
     if (!File.Exists(ApplicationData + @"\ReCPU\ORGCPU.reg"))
     {
         barLabel.Text     = "Backing up original CPU information...";
         barProgress.Value = 20;
         global::ReCPU.RegExportImport.ExportReg(ApplicationData + @"\ReCPU\ORGCPU.reg", @"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0");
     }
 }
Пример #3
0
        private void isclear_Click(object sender, EventArgs e)
        {
            if (isclear.Checked == true)
            {
                IniFunc.writeString("ReCPU", "ClearMode", "true", ApplicationData + @"\ReCPU\Settings.ini");
                switch (MessageBox.Show(@"ClearMode should only be enabled under Windows 10 environment.
Do not try it under Windows 7/8/8.1.
The application will atomaticly reload to take effect.
Please notice: The display effect is not ideal.
Continue?", "Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                case DialogResult.None:
                    break;

                case DialogResult.OK:
                    break;

                case DialogResult.Cancel:
                    break;

                case DialogResult.Abort:
                    break;

                case DialogResult.Retry:
                    break;

                case DialogResult.Ignore:
                    break;

                case DialogResult.Yes:
                    break;

                case DialogResult.No:
                    isclear.Checked = false;
                    return;

                default:
                    break;
                }
                this.Hide();
                Form1 form = new Form1();
                form.ShowDialog();
                this.Close();
            }
            else
            {
                IniFunc.writeString("ReCPU", "ClearMode", "false", ApplicationData + @"\ReCPU\Settings.ini");
                this.Hide();
                Form1 form = new Form1();
                form.ShowDialog();
                this.Close();
            }
        }