Example #1
0
        private void ApplyAll()
        {
            if (wv != WindowsVersion.Unsupported)
            {
                string msg = "";

                if (wv == WindowsVersion.Windows7)
                {
                    msg = "This will apply every option in Universal and Windows 7 tab. Continue?";
                }
                if (wv == WindowsVersion.Windows8)
                {
                    msg = "This will apply every option in Universal and Windows 8.1 tab. Continue?";
                }
                if (wv == WindowsVersion.Windows10)
                {
                    msg = "This will apply every option in Universal and Windows 10 tab. Continue?";
                }
                if (wv == WindowsVersion.WindowsServer2008)
                {
                    msg = "This will apply every option in Universal and Windows Server 2008 tab. Continue?";
                }
                if (wv == WindowsVersion.WindowsServer2012)
                {
                    msg = "This will apply every option in Universal and Windows Server 2012 tab. Continue?";
                }
                if (wv == WindowsVersion.WindowsServer2016)
                {
                    msg = "This will apply every option in Universal and Windows Server 2016 tab. Continue?";
                }

                MessagerForm r = new MessagerForm(this, MessagerType.Optimize, msg);
                r.ShowDialog(this);
            }
        }
Example #2
0
 private void button62_Click(object sender, EventArgs e)
 {
     if (listDesktopItems.Items.Count > 0)
     {
         MessagerForm r = new MessagerForm(this, MessagerType.Integrator, removedesktopitemsmsg);
         r.ShowDialog(this);
     }
 }
Example #3
0
 private void button46_Click(object sender, EventArgs e)
 {
     if (hl.Items.Count > 0)
     {
         MessagerForm r = new MessagerForm(this, MessagerType.Hosts, removeentriesmsg);
         r.ShowDialog(this);
     }
 }
Example #4
0
 private void button22_Click(object sender, EventArgs e)
 {
     if (listStartupItems.Items.Count > 0)
     {
         MessagerForm r = new MessagerForm(this, MessagerType.Startup, removeallmsg);
         r.ShowDialog(this);
     }
 }
Example #5
0
 private void ok_Click(object sender, EventArgs e)
 {
     if (Directory.Exists(textBox1.Text))
     {
         Optimize.SetEdgeDownloadFolder(textBox1.Text);
         this.Close();
     }
     else
     {
         MessagerForm f = new MessagerForm(null, MessagerType.Error, errormsg);
         f.ShowDialog();
     }
 }
Example #6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (IsAdmin() == false)
            {
                MessagerForm f = new MessagerForm(null, MessagerType.Error, noadminmsg);
                f.ShowDialog();

                Application.Exit();
            }
            else
            {
                if (IsSevenOrHigher() == true)
                {
                    string resource = "Optimizer.Newtonsoft.Json.dll";
                    EmbeddedAssembly.Load(resource, "Newtonsoft.Json.dll");
                    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

                    if (!Directory.Exists(Required.CoreFolder))
                    {
                        Required.Deploy();
                    }

                    // for backward compatibility
                    if (File.Exists(Options.SettingsFile))
                    {
                        if (File.ReadAllText(Options.SettingsFile).Contains("FirstRun"))
                        {
                            File.Delete(Options.SettingsFile);
                        }
                    }

                    // load settings, if there is no settings, load defaults
                    Options.LoadSettings();

                    Application.Run(new MainForm());
                }
                else
                {
                    MessagerForm f = new MessagerForm(null, MessagerType.Error, unsupportedmsg);
                    f.ShowDialog();

                    Application.Exit();
                }
            }
        }
Example #7
0
        private void button45_Click(object sender, EventArgs e)
        {
            MessagerForm f = new MessagerForm(this, MessagerType.Restart, restartmsg);

            f.ShowDialog();
        }