1 |
william |
20 |
using System; |
2 |
|
|
using System.Collections.Generic; |
3 |
|
|
using System.Linq; |
4 |
|
|
using System.Text; |
5 |
|
|
using System.Reflection; |
6 |
william |
34 |
using RomCheater.UserSettingsSupport; |
7 |
|
|
using RomCheater.Logging.Properties; |
8 |
william |
814 |
using System.Windows.Forms; |
9 |
william |
20 |
|
10 |
william |
34 |
namespace RomCheater.Logging |
11 |
william |
20 |
{ |
12 |
william |
23 |
public static class LoggingConstants |
13 |
william |
20 |
{ |
14 |
william |
722 |
//private static SettingSubscriber SettingsSubscriber; |
15 |
william |
34 |
static LoggingConstants() |
16 |
|
|
{ |
17 |
william |
722 |
//SettingsSubscriber = new SettingSubscriber(); |
18 |
|
|
//SettingsSubscriber.AddSubscriber(Settings.Default); |
19 |
|
|
//Logging.Properties.Settings.Default; |
20 |
william |
875 |
try { AppName = Assembly.GetEntryAssembly().GetName().Name; } |
21 |
|
|
catch (Exception) { try { AppName = Assembly.GetCallingAssembly().GetName().Name; } |
22 |
william |
876 |
catch (Exception) { try { AppName = Assembly.GetExecutingAssembly().GetName().Name; } |
23 |
william |
875 |
catch (Exception) { AppName = DEFAULT_APP_NAME; } } } |
24 |
william |
880 |
|
25 |
|
|
AppLogFile = string.Format("{0}.log", AppName); |
26 |
|
|
AppFullLogPath = string.Format(@"{0}\{1}", Application.StartupPath, AppLogFile); |
27 |
|
|
|
28 |
|
|
try { AppVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(); } |
29 |
|
|
catch (Exception) |
30 |
|
|
{ |
31 |
|
|
try { AppVersion = Assembly.GetCallingAssembly().GetName().Version.ToString(); } |
32 |
|
|
catch (Exception) |
33 |
|
|
{ |
34 |
|
|
try { AppVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); } |
35 |
|
|
catch (Exception) { AppVersion = new Version(0, 0, 0, 0).ToString(); } |
36 |
|
|
} |
37 |
|
|
} |
38 |
william |
34 |
} |
39 |
william |
20 |
#region Application Constants |
40 |
william |
875 |
private const string DEFAULT_APP_NAME = "RomCheater"; |
41 |
|
|
public static string AppName = DEFAULT_APP_NAME; |
42 |
william |
24 |
public static string AppLogFile = string.Format("{0}.log", AppName); |
43 |
william |
819 |
public static string AppFullLogPath = string.Format(@"{0}\{1}", Application.StartupPath, AppLogFile); |
44 |
william |
20 |
public static string AppVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(); |
45 |
|
|
#if DEBUG |
46 |
|
|
public const string AppBuild = "Debug"; |
47 |
|
|
#else |
48 |
|
|
public const string AppBuild = "Release"; |
49 |
|
|
#endif |
50 |
|
|
#endregion |
51 |
|
|
} |
52 |
|
|
} |