Repository: Kyome22/RunCat_for_windows
File: RunCat365/Program.cs (C#)

Code before:
            notifyIcon = new NotifyIcon()
            {
                Icon = icons[0],
                ContextMenuStrip = contextMenuStrip,
                Text = "0.0%",
                Visible = true
            };

            notifyIcon.DoubleClick += new EventHandler(HandleDoubleClick);

            SetAnimation();
            StartObserveCPU();

            current = 1;
        }

        private ToolStripMenuItem ChargeToolStripMenu<T>(
            string title,
            Func<T, string> obtainText,
            EventHandler onClickEvent,
            Func<T, bool> isChecked ) where T : Enum
        {
            var items = new List<ToolStripMenuItem>();
            foreach (T value in Enum.GetValues(typeof(T)))
            {
                items.Add(new ToolStripMenuItem(obtainText(value), null, onClickEvent) { Checked = isChecked(value) });
            }
            return new ToolStripMenuItem(title, null, items.ToArray());
        }

        private void OnApplicationExit(object sender, EventArgs e)
        {
            UserSettings.Default.Runner = runner.ToString();
            UserSettings.Default.Theme = manualTheme.ToString();
            UserSettings.Default.FPSMaxLimit = fpsMaxLimit.ToString();
            UserSettings.Default.Save();
        }

        private bool IsStartupEnabled()
        {
            string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run";
            using (RegistryKey rKey = Registry.CurrentUser.OpenSubKey(keyName))
            {
                return (rKey.GetValue(Application.ProductName) != null) ? true : false;
            }
        }

        private Theme GetSystemTheme()
        {
            string keyName = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
            using (RegistryKey rKey = Registry.CurrentUser.OpenSubKey(keyName))

Review comment (suggestion):
Please respect the original format.

```suggestion
                var item = new ToolStripMenuItem(obtainText(value), null, onClickEvent) 
                { 
                    Checked = isChecked(value)
                };
                items.Add(item);
```

Code after:
            notifyIcon = new NotifyIcon()
            {
                Icon = icons[0],
                ContextMenuStrip = contextMenuStrip,
                Text = "0.0%",
                Visible = true
            };

            notifyIcon.DoubleClick += new EventHandler(HandleDoubleClick);

            SetAnimation();
            StartObserveCPU();

            current = 1;
        }

        private ToolStripMenuItem CreateMenuFromEnum<T>(
            string title,
            Func<T, string> getTitle,
            EventHandler onClickEvent,
            Func<T, bool> isChecked
        ) where T : Enum
        {
            var items = new List<ToolStripMenuItem>();
            foreach (T value in Enum.GetValues(typeof(T)))
            {
                var item = new ToolStripMenuItem(getTitle(value), null, onClickEvent)
                {
                    Checked = isChecked(value) 
                };
                items.Add(item);
            }
            return new ToolStripMenuItem(title, null, items.ToArray());
        }

        private void OnApplicationExit(object sender, EventArgs e)
        {
            UserSettings.Default.Runner = runner.ToString();
            UserSettings.Default.Theme = manualTheme.ToString();
            UserSettings.Default.FPSMaxLimit = fpsMaxLimit.ToString();
            UserSettings.Default.Save();
        }

        private bool IsStartupEnabled()
        {
            string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run";
            using (RegistryKey rKey = Registry.CurrentUser.OpenSubKey(keyName))
            {
                return (rKey.GetValue(Application.ProductName) != null) ? true : false;
            }
        }