1
0
Fork 0
colorclock-screensaver/Program.cs

48 lines
976 B
C#

using System;
using System.Windows.Forms;
namespace App
{
static class Program
{
static readonly ScreenSaver saver = new();
/// <summary>
/// The main entry point for the application.
/// </summary>
[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());
}
}
}
}