Added google analytics. (only enabled in production)

This commit is contained in:
kay.one 2011-10-27 22:13:56 -07:00
commit 5b3f0bdffe
4 changed files with 40 additions and 14 deletions

View file

@ -7,23 +7,20 @@ namespace NzbDrone.Common
{
public class EnviromentProvider
{
public virtual String LogPath
{
get { return Environment.CurrentDirectory; }
}
public virtual bool IsUserInteractive
{
get { return Environment.UserInteractive; }
}
#if DEBUG
private static readonly bool isInDebug = true;
#else
private static readonly bool isInDebug = false;
#endif
private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower();
public static bool IsProduction
{
get
{
if (Debugger.IsAttached) return false;
var processName = Process.GetCurrentProcess().ProcessName.ToLower();
if (isInDebug || Debugger.IsAttached) return false;
Console.WriteLine(processName);
if (processName.Contains("nunit")) return false;
@ -34,6 +31,16 @@ namespace NzbDrone.Common
}
}
public virtual String LogPath
{
get { return Environment.CurrentDirectory; }
}
public virtual bool IsUserInteractive
{
get { return Environment.UserInteractive; }
}
public virtual string ApplicationPath
{
get