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

Code before:
                new ToolStripSeparator(),
                appVersionMenu,
                new ToolStripMenuItem("Exit", null, Exit)
            );

            SetIcons();

            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;

Review comment (suggestion):
```suggestion
            Func<T, string> getTitle,
```

Code after:
                new ToolStripSeparator(),
                appVersionMenu,
                new ToolStripMenuItem("Exit", null, Exit)
            );

            SetIcons();

            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()