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:
Rich
2015-01-19 20:52:32 +00:00
parent 25719bf869
commit 6a973a288b
4 changed files with 243 additions and 0 deletions

View File

@@ -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"];