コード例 #1
0
ファイル: Program.cs プロジェクト: chengdong0421/percentage
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrayIcon trayIcon = new TrayIcon();

            if (args != null)
            {
                if (args.Length == 4)
                {
                    try{
                        trayIcon.setColor(int.Parse(args[0]) % 256, int.Parse(args[1]) % 256, int.Parse(args[2]) % 256, int.Parse(args[3]) % 256);
                    }
                    catch (Exception e) {}
                }
                else if (args.Length == 5)
                {
                    try{
                        trayIcon.setColor(int.Parse(args[0]) % 256, int.Parse(args[1]) % 256, int.Parse(args[2]) % 256, int.Parse(args[3]) % 256);
                        trayIcon.setFont(args[4]);
                    }
                    catch (Exception e) {}
                }
                else
                {
                }
            }
            else
            {
            }


            Application.Run();
        }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrayIcon trayIcon = new TrayIcon();

            Application.Run();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: lyc2017/percentage
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrayIcon trayIcon = new TrayIcon();

            // If there is a parameter, try to set the font by the parameter.
            if (args != null && args.Length == 1)
            {
                try
                {
                    trayIcon.setFont(args[0]);
                }
                catch (Exception e) { }
            }

            Application.Run();
        }