using System;
using System.Windows.Forms;
using System.Collections.Generic;
using RJH.CommandLineHelper;
namespace VistaPerformanceA1._1
{
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
public static string m_infoPath;
public static bool m_isHidden;
public static string m_showEscape;
/// <summary>
/// Commandline switches defined below.
/// </summary>
#region Commandline switches defined
[CommandLineSwitch("showinfo", "dumps info text in the display.")]
[CommandLineAlias("infoPath")]
public string showiNFO
{
get { return m_infoPath; }
set { m_infoPath = value; }
}
[CommandLineSwitch("hidden", "Keeps the program window hidden.")]
public bool isHidden
{
get { return m_isHidden; }
set { m_isHidden = value; }
}
[CommandLineSwitch("showescape", "Shows a timer with interupt options.")]
[CommandLineAlias("nfoPath")]
public string showEscape
{
get { return m_showEscape; }
set { m_showEscape = value; }
}
#endregion
private int Run(string[] cmdLine)
{
Parser parser = new Parser(System.Environment.CommandLine, this);
// Parse the command line.
parser.Parse();
string[] unhandled = parser.UnhandledSwitches;
if (unhandled != null)
{
Console.WriteLine("\nThe following switches were not handled.");
foreach (string s in unhandled)
Console.WriteLine(" - {0}", s);
}
return 0;
}
[STAThread]
private static int Main(string[] cmdLine)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application app = new Application();
return app.Run(cmdLine);
frmMain frmMain1 = new frmMain();
if (m_isHidden == true) { frmMain1.Visible = true; }
Application.Run(frmMain1);
}
}
}