From 4e8b7932bde8413f709bb4699e1490512215e9a6 Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 19 Oct 2010 15:53:44 +0000 Subject: [PATCH] Changed Property - CalledFrom - Returns Method that called the current Method --- PROMS/Volian.Base.Library/vlnStackTrace.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Base.Library/vlnStackTrace.cs b/PROMS/Volian.Base.Library/vlnStackTrace.cs index 981a085a..aba09961 100644 --- a/PROMS/Volian.Base.Library/vlnStackTrace.cs +++ b/PROMS/Volian.Base.Library/vlnStackTrace.cs @@ -118,16 +118,14 @@ namespace Volian.Base.Library int count = 0; foreach (StackFrame sf in sfs) { - if (sf.GetFileLineNumber() != 0) + if (sf.GetFileLineNumber() != 0) // Only look at Local Methods { count++; + if (count > 4) // The fourth entry should be the Calling Method { - string sMethod = sf.GetMethod().Name; - string sNamespace = sf.GetMethod().ReflectedType.Namespace; string sType = sf.GetMethod().ReflectedType.Name; - sMethod += string.Format(" {0}[{1}]", sf.GetFileName(), sf.GetFileLineNumber()); - if (count > 3) - return string.Format("{0}.{1}.{2}", sNamespace, sType, sMethod); + string sMethod = sf.GetMethod().Name; + return string.Format("{0}.{1}[{2}]", sType, sMethod, sf.GetFileLineNumber()); } } }