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:
@@ -140,6 +140,27 @@ namespace Volian.Base.Library
|
||||
return "No Local Method";
|
||||
}
|
||||
}
|
||||
public static string CalledFromCSLA
|
||||
{
|
||||
get
|
||||
{
|
||||
StackTrace st = new StackTrace(true);
|
||||
StackFrame[] sfs = st.GetFrames();
|
||||
int count = 0;
|
||||
string lastWasCSLA = null;
|
||||
foreach (StackFrame sf in sfs)
|
||||
{
|
||||
string sType = sf.GetMethod().ReflectedType.FullName;
|
||||
string sMethod = sf.GetMethod().Name;
|
||||
if (sType.StartsWith("VEPROMS.CSLA.Library") && !sType.StartsWith("VEPROMS.CSLA.Library.Database")
|
||||
&& !sMethod.StartsWith("DataPortal") && !sMethod.StartsWith("SetParentSectionAndDocVersion"))// Only look at Local Methods
|
||||
lastWasCSLA = string.Format("{0}.{1}[{2}]", sType, sMethod, sf.GetFileLineNumber());
|
||||
else
|
||||
if (lastWasCSLA != null) return lastWasCSLA;
|
||||
}
|
||||
return "No CSLA Method";
|
||||
}
|
||||
}
|
||||
private static StackFrame[] _LastSFS;
|
||||
private static int MatchingStackFrame(StackFrame[] sfs)
|
||||
{
|
||||
|
Reference in New Issue
Block a user