From 8942de0b41121ff1703803407a36d925af8aff52 Mon Sep 17 00:00:00 2001 From: Kyome22 Date: Mon, 21 Dec 2020 01:10:47 +0900 Subject: [PATCH] .NET Framework -> .NET Core --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 2 +- README.md | 13 +++- RunCat.sln | 12 ++-- RunCat/App.config | 6 -- RunCat/Program.cs | 54 ++++++++--------- RunCat/Properties/Settings.Designer.cs | 30 ---------- RunCat/Properties/Settings.settings | 7 --- RunCat/RunCat.csproj | 80 +++++++++++++------------ RunCat/RunCat.csproj.user | 6 ++ 10 files changed, 90 insertions(+), 120 deletions(-) delete mode 100644 .DS_Store delete mode 100644 RunCat/App.config delete mode 100644 RunCat/Properties/Settings.Designer.cs delete mode 100644 RunCat/Properties/Settings.settings create mode 100644 RunCat/RunCat.csproj.user diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 cd RunCat/ +> dotnet publish -c Release +``` + # Contributors + - [Kyome22](https://github.com/Kyome22) - [geforce-hisa0904](https://github.com/geforce-hisa0904) - [murakamiii](https://github.com/murakamiii) - [juner](https://github.com/juner) - [t13801206](https://github.com/t13801206) +- [MxShun](https://github.com/MxShun) diff --git a/RunCat.sln b/RunCat.sln index 0bfcefa..388dcc6 100644 --- a/RunCat.sln +++ b/RunCat.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30320.27 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunCat", "RunCat\RunCat.csproj", "{148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunCat", "RunCat\RunCat.csproj", "{10064461-1376-41CF-B6DA-A67B71BB2AC9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,15 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}.Release|Any CPU.Build.0 = Release|Any CPU + {10064461-1376-41CF-B6DA-A67B71BB2AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10064461-1376-41CF-B6DA-A67B71BB2AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10064461-1376-41CF-B6DA-A67B71BB2AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10064461-1376-41CF-B6DA-A67B71BB2AC9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F26512EE-25D3-4A16-96A9-B2F56F5890AC} + SolutionGuid = {7D6F6313-0157-43AE-8251-D67756F32A48} EndGlobalSection EndGlobal diff --git a/RunCat/App.config b/RunCat/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/RunCat/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/RunCat/Program.cs b/RunCat/Program.cs index e7656c4..1cb5914 100644 --- a/RunCat/Program.cs +++ b/RunCat/Program.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Takuto Nakamura +// Copyright 2020 Takuto Nakamura // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ using System.Diagnostics; using System.Windows.Forms; using System.Resources; +using System.ComponentModel; namespace RunCat { @@ -37,8 +38,8 @@ static void Main() public class RunCatApplicationContext : ApplicationContext { private PerformanceCounter cpuUsage; - private MenuItem themeMenu; - private MenuItem startupMenu; + private ToolStripMenuItem themeMenu; + private ToolStripMenuItem startupMenu; private NotifyIcon notifyIcon; private int current = 0; private string systemTheme = ""; @@ -55,41 +56,34 @@ public RunCatApplicationContext() cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); _ = cpuUsage.NextValue(); // discards first return value - themeMenu = new MenuItem("Theme", new MenuItem[] + themeMenu = new ToolStripMenuItem("Theme", null, new ToolStripMenuItem[] { - new MenuItem("Default", SetThemeIcons) + new ToolStripMenuItem("Default", null, SetThemeIcons) { - RadioCheck = true, Checked = true }, - new MenuItem("Light", SetLightIcons) - { - RadioCheck = true - }, - new MenuItem("Dark", SetDarkIcons) - { - RadioCheck = true - } + new ToolStripMenuItem("Light", null, SetLightIcons), + new ToolStripMenuItem("Dark", null, SetDarkIcons) }); - startupMenu = new MenuItem("Startup", SetStartup) - { - RadioCheck = true - }; + startupMenu = new ToolStripMenuItem("Startup", null, SetStartup); if (IsStartupEnabled()) { startupMenu.Checked = true; } + ContextMenuStrip contextMenuStrip = new ContextMenuStrip(new Container()); + contextMenuStrip.Items.AddRange(new ToolStripItem[] + { + themeMenu, + startupMenu, + new ToolStripMenuItem("Exit", null, Exit) + }); + notifyIcon = new NotifyIcon() { Icon = Resources.light_cat0, - ContextMenu = new ContextMenu(new MenuItem[] - { - themeMenu, - startupMenu, - new MenuItem("Exit", Exit) - }), + ContextMenuStrip = contextMenuStrip, Text = "0.0%", Visible = true }; @@ -100,7 +94,7 @@ public RunCatApplicationContext() StartObserveCPU(); current = 1; } - + private bool IsStartupEnabled() { string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run"; @@ -141,9 +135,9 @@ private void SetIcons() .ToArray(); } - private void UpdateCheckedState(MenuItem sender) + private void UpdateCheckedState(ToolStripMenuItem sender) { - foreach (MenuItem item in themeMenu.MenuItems) + foreach (ToolStripMenuItem item in themeMenu.DropDownItems) { item.Checked = false; } @@ -152,7 +146,7 @@ private void UpdateCheckedState(MenuItem sender) private void SetThemeIcons(object sender, EventArgs e) { - UpdateCheckedState((MenuItem)sender); + UpdateCheckedState((ToolStripMenuItem)sender); manualTheme = ""; systemTheme = GetAppsUseTheme(); SetIcons(); @@ -169,14 +163,14 @@ private void UpdateThemeIcons() private void SetLightIcons(object sender, EventArgs e) { - UpdateCheckedState((MenuItem)sender); + UpdateCheckedState((ToolStripMenuItem)sender); manualTheme = "light"; SetIcons(); } private void SetDarkIcons(object sender, EventArgs e) { - UpdateCheckedState((MenuItem)sender); + UpdateCheckedState((ToolStripMenuItem)sender); manualTheme = "dark"; SetIcons(); } diff --git a/RunCat/Properties/Settings.Designer.cs b/RunCat/Properties/Settings.Designer.cs deleted file mode 100644 index df1dbf9..0000000 --- a/RunCat/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace RunCat.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/RunCat/Properties/Settings.settings b/RunCat/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/RunCat/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/RunCat/RunCat.csproj b/RunCat/RunCat.csproj index c58ae5c..1521899 100644 --- a/RunCat/RunCat.csproj +++ b/RunCat/RunCat.csproj @@ -1,41 +1,43 @@  - - {148B00E2-DAFD-4AA6-BDBA-3A365047DD9B} - WinExe - True - net472 - true - appIcon.ico - 1.0.0.0 - RunCat - Copyright © 2020 - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - - + + + WinExe + netcoreapp3.1 + true + appIcon.ico + true + RunCat.Program + 1.6.0 + Takuto Nakamura + A cute runnning cat animation on your windows taskbar. + © 2020 Takuto Nakamura + LICENSE + https://github.com/Kyome22/RunCat_for_windows + true + win-x64 + true + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + + + + \ No newline at end of file diff --git a/RunCat/RunCat.csproj.user b/RunCat/RunCat.csproj.user new file mode 100644 index 0000000..28bc023 --- /dev/null +++ b/RunCat/RunCat.csproj.user @@ -0,0 +1,6 @@ + + + + <_LastSelectedProfileId>C:\Users\kyome\source\repos\RunCat_for_windows\RunCat\Properties\PublishProfiles\FolderProfile.pubxml + + \ No newline at end of file