Added Command Line support to set the operating mode to Debug, Demo or Production

This commit is contained in:
Rich 2014-09-02 18:30:48 +00:00
parent b84141f9e5
commit 080b1098bc

View File

@ -79,9 +79,22 @@ namespace Volian.Base.Library
}
set { _ComparePROMStoPROMSPDF = value; }
}
public static string GetCommand(string commandName, string def)
{
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
foreach (string parameter in parameters)
{
if (parameter.ToUpper().StartsWith("/" + commandName.ToUpper() + "="))
{
return parameter.Substring(commandName.Length + 2);
}
}
return def;
}
private static void LoadOperatingMode()
{
string opMode = ConfigurationManager.AppSettings["OperatingMode"];
opMode = GetCommand("MODE",opMode);
if (opMode != null && opMode != "")
{
_DebugMode = opMode.ToUpper() == "DEBUG";