Added Objects DebugProfile and DebugDBTrack for command-line parameters /Profile and /DBTrack
Added code to retrieve command-line parameters. Added property CalledFromCSLA to retrieve the CSLA object and method used by DBTracking. Added ProfileTimer object to track CPU using by methods
This commit is contained in:
@@ -91,6 +91,32 @@ namespace Volian.Base.Library
|
||||
}
|
||||
return def;
|
||||
}
|
||||
public static float GetCommandFloat(string commandName, float def)
|
||||
{
|
||||
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
|
||||
foreach (string parameter in parameters)
|
||||
{
|
||||
if (parameter.ToUpper().StartsWith("/" + commandName.ToUpper() + "="))
|
||||
{
|
||||
float result = def;
|
||||
if (float.TryParse(parameter.Substring(commandName.Length + 2), out result))
|
||||
return result;
|
||||
else
|
||||
return def;
|
||||
}
|
||||
}
|
||||
return def;
|
||||
}
|
||||
public static bool GetCommandFlag(string commandName)
|
||||
{
|
||||
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
|
||||
foreach (string parameter in parameters)
|
||||
{
|
||||
if (parameter.ToUpper().Equals("/" + commandName.ToUpper()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private static void LoadOperatingMode()
|
||||
{
|
||||
string opMode = ConfigurationManager.AppSettings["OperatingMode"];
|
||||
|
Reference in New Issue
Block a user