Added Command Line support to set the operating mode to Debug, Demo or Production
This commit is contained in:
parent
b84141f9e5
commit
080b1098bc
@ -79,9 +79,22 @@ namespace Volian.Base.Library
|
|||||||
}
|
}
|
||||||
set { _ComparePROMStoPROMSPDF = value; }
|
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()
|
private static void LoadOperatingMode()
|
||||||
{
|
{
|
||||||
string opMode = ConfigurationManager.AppSettings["OperatingMode"];
|
string opMode = ConfigurationManager.AppSettings["OperatingMode"];
|
||||||
|
opMode = GetCommand("MODE",opMode);
|
||||||
if (opMode != null && opMode != "")
|
if (opMode != null && opMode != "")
|
||||||
{
|
{
|
||||||
_DebugMode = opMode.ToUpper() == "DEBUG";
|
_DebugMode = opMode.ToUpper() == "DEBUG";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user