using System; using System.Windows.Forms; namespace App { static class Program { static readonly ScreenSaver saver = new(); /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length > 0) { string arg = args[0].ToLower().Trim(); // Settings if (arg.StartsWith("/c")) { Application.Run(new AboutBox()); } // Preview else if (arg.StartsWith("/p")) { // Do nothing with preview. } // Screensaver else if (arg.StartsWith("/s")) { saver.Run(); } else { MessageBox.Show("Sorry, but the command line argument \"" + arg + "\" is not valid.", "Colorclock", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } // No args, run About box. else { Application.Run(new AboutBox()); } } } }