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 |
|
26 |
namespace RomCheater.Docking |
27 |
{ |
28 |
public partial class FloatingAboutBox : Form |
29 |
{ |
30 |
public FloatingAboutBox() |
31 |
{ |
32 |
InitializeComponent(); |
33 |
} |
34 |
private void FloatingAboutBox_Shown(object sender, EventArgs e) |
35 |
{ |
36 |
string path = Application.StartupPath; |
37 |
string version_file = "current-version.txt"; |
38 |
string full_path = string.Format(@"{0}\{1}", path, version_file); |
39 |
FileInfo fi = new FileInfo(full_path); |
40 |
if (!fi.Exists) |
41 |
{ |
42 |
logger.Error.WriteLine("Could not find {0} in path {1}", version_file, path); |
43 |
return; |
44 |
} |
45 |
StringBuilder builder = new StringBuilder(); |
46 |
using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) |
47 |
{ |
48 |
StreamReader sr = new StreamReader(fs); |
49 |
while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); } |
50 |
sr.Close(); |
51 |
} |
52 |
txtVersion.Text = builder.ToString(); |
53 |
} |
54 |
} |
55 |
} |