1 |
#region Logging Defines |
2 |
// include this any class or method that required logging, and comment-out what is not needed |
3 |
|
4 |
#region Enabled logging levels |
5 |
#define LOGGING_ENABLE_INFO |
6 |
#define LOGGING_ENABLE_WARN |
7 |
#define LOGGING_ENABLE_DEBUG |
8 |
#define LOGGING_ENABLE_VERBOSEDEBUG |
9 |
#define LOGGING_ENABLE_ERROR |
10 |
#define LOGGING_ENABLE_VERBOSEERROR |
11 |
#define LOGGING_ENABLE_PROFILER |
12 |
#endregion |
13 |
#endregion |
14 |
using System; |
15 |
using System.Collections.Generic; |
16 |
using System.ComponentModel; |
17 |
using System.Data; |
18 |
using System.Drawing; |
19 |
using System.Linq; |
20 |
using System.Text; |
21 |
using System.Windows.Forms; |
22 |
using WeifenLuo.WinFormsUI.Docking; |
23 |
using System.IO; |
24 |
using RomCheater.Logging; |
25 |
using Enterprise.Logging; |
26 |
|
27 |
namespace RomCheater.Docking |
28 |
{ |
29 |
public partial class FloatingAboutBox : Form |
30 |
{ |
31 |
public FloatingAboutBox() |
32 |
{ |
33 |
InitializeComponent(); |
34 |
} |
35 |
private void FloatingAboutBox_Shown(object sender, EventArgs e) |
36 |
{ |
37 |
string path = Application.StartupPath; |
38 |
string version_file = "current-version.txt"; |
39 |
string full_path = string.Format(@"{0}\{1}", path, version_file); |
40 |
FileInfo fi = new FileInfo(full_path); |
41 |
if (!fi.Exists) |
42 |
{ |
43 |
gLog.Error.WriteLine("Could not find {0} in path {1}", version_file, path); |
44 |
return; |
45 |
} |
46 |
StringBuilder builder = new StringBuilder(); |
47 |
using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) |
48 |
{ |
49 |
StreamReader sr = new StreamReader(fs); |
50 |
while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); } |
51 |
sr.Close(); |
52 |
} |
53 |
txtVersion.Text = builder.ToString(); |
54 |
} |
55 |
} |
56 |
} |