Esempio n. 1
0
        private void TasksDisableRemove_Click(object sender, EventArgs e)
        {
            if (TasksDisableBox.SelectedItem != null)
            {
                foreach (var item in Default.TasksToDisable)
                {
                    if (item == TasksDisableBox.SelectedItem.ToString())
                    {
                        Default.TasksToDisable.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                TasksDisableBox.Items.Clear();
                TasksDisableBox.Text = string.Empty;

                foreach (var item in Default.TasksToDisable)
                {
                    TasksDisableBox.Items.Add(item);
                }
            }
        }
Esempio n. 2
0
        private void ExclusionListRemove_Click(object sender, EventArgs e)
        {
            if (ExclusionListBox.SelectedItem != null)
            {
                foreach (var item in Default.ExclusionList)
                {
                    if (item == ExclusionListBox.SelectedItem.ToString())
                    {
                        Default.ExclusionList.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                ExclusionListBox.Items.Clear();
                ExclusionListBox.Text = string.Empty;

                foreach (var item in Default.ExclusionList)
                {
                    ExclusionListBox.Items.Add(item);
                }
            }
        }
Esempio n. 3
0
        private void ServicesManualRemove_Click(object sender, EventArgs e)
        {
            if (ServicesManualBox.SelectedItem != null)
            {
                foreach (var item in Default.ServicesToManual)
                {
                    if (item == ServicesManualBox.SelectedItem.ToString())
                    {
                        Default.ServicesToManual.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                ServicesManualBox.Items.Clear();
                ServicesManualBox.Text = string.Empty;

                foreach (var item in Default.ServicesToManual)
                {
                    ServicesManualBox.Items.Add(item);
                }
            }
        }
Esempio n. 4
0
        private void PathHideRemove_Click(object sender, EventArgs e)
        {
            if (PathHideListBox.SelectedItem != null)
            {
                foreach (var item in Default.DirectoriesToHide)
                {
                    if (item == PathHideListBox.SelectedItem.ToString())
                    {
                        Default.DirectoriesToHide.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                PathHideListBox.Items.Clear();
                PathHideListBox.Text = string.Empty;

                foreach (var item in Default.DirectoriesToHide)
                {
                    PathHideListBox.Items.Add(item);
                }
            }
        }
Esempio n. 5
0
        private void PathFilesDelOldRemove_Click(object sender, EventArgs e)
        {
            if (PathFilesDelOldBox.SelectedItem != null)
            {
                foreach (var item in Default.PathFilesToDeleteOlder)
                {
                    if (item == PathFilesDelOldBox.SelectedItem.ToString())
                    {
                        Default.PathFilesToDeleteOlder.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                PathFilesDelOldBox.Items.Clear();
                PathFilesDelOldBox.Text = string.Empty;

                foreach (var item in Default.PathFilesToDeleteOlder)
                {
                    PathFilesDelOldBox.Items.Add(item);
                }
            }
        }
Esempio n. 6
0
        private void FilesHideRemove_Click(object sender, EventArgs e)
        {
            if (FilesHideBox.SelectedItem != null)
            {
                foreach (var item in Default.FilesToHide)
                {
                    if (item == FilesHideBox.SelectedItem.ToString())
                    {
                        Default.FilesToHide.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                FilesHideBox.Items.Clear();
                FilesHideBox.Text = string.Empty;

                foreach (var item in Default.FilesToHide)
                {
                    FilesHideBox.Items.Add(item);
                }
            }
        }
Esempio n. 7
0
        private void DirDelRemove_Click(object sender, EventArgs e)
        {
            if (DirToDelBox.SelectedItem != null)
            {
                foreach (var item in Default.DirectoriesToDelete)
                {
                    if (item == DirToDelBox.SelectedItem.ToString())
                    {
                        Default.DirectoriesToDelete.Remove(item);
                        break;
                    }
                }
                Default.Save();
                Default.Reload();

                DirToDelBox.Items.Clear();
                DirToDelBox.Text = string.Empty;

                foreach (var item in Default.DirectoriesToDelete)
                {
                    DirToDelBox.Items.Add(item);
                }
            }
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            if (Default.LoggingEnabled)
            {
                EasyLogger.BackupLogs(EasyLogger.LogFile, 30);
                EasyLogger.AddListener(EasyLogger.LogFile);
            }

            if (Default.UpgradeRequired)
            {
                Default.Upgrade();
                Default.UpgradeRequired = false;
                Default.Save();
                Default.Reload();
            }
            if (Default.FirstRun)
            {
                Default.FirstRun = false;
                Default.Save();
                Default.Reload();

                SettingsForm settings = new SettingsForm();
                settings.ShowDialog();

                Environment.Exit(0);
            }

            if (args.Length > 0)
            {
                try
                {
                    string A0 = args[0].ToLower();

                    if (args[0] == "/optimize" || args[0] == "-optimize")
                    {
                        StartLightCleanup();
                    }
                    else
                    {
                        StartLightCleanup();
                    }
                }
                catch (Exception ex)
                {
                    EasyLogger.Info(ex.Message);
                }
            }
            else
            {
                // Run Settings and Close
                SettingsForm settings = new SettingsForm();
                settings.ShowDialog();
            }

            EasyLogger.Info("*********************  END OF OPTIMIZATIONS  *********************");

            EasyLogger.RemoveListener();

#if DEBUG
            using (StreamReader sr = File.OpenText(EasyLogger.LogFile))
            {
                string lines = sr.ReadToEnd();

                if (lines.ToLower().Contains("[error]"))
                {
                    MessageBox.Show("The log file contains errors!", "Maintenance", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    Process.Start(EasyLogger.LogDirectory);
                }
            }
#endif

            Environment.Exit(0);
        }