/[RomCheater]/trunk/RomCheater/Docking/FloatingAboutBox.cs
ViewVC logotype

Contents of /trunk/RomCheater/Docking/FloatingAboutBox.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 838 - (show annotations) (download)
Tue Sep 16 00:57:18 2014 UTC (6 years ago) by william
File size: 1904 byte(s)
+ add an icon resource

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 this.Icon = Core.Properties.Resources.romcheater_icon;
35 }
36 private void FloatingAboutBox_Shown(object sender, EventArgs e)
37 {
38 string path = Application.StartupPath;
39 string version_file = "current-version.txt";
40 string full_path = string.Format(@"{0}\{1}", path, version_file);
41 FileInfo fi = new FileInfo(full_path);
42 if (!fi.Exists)
43 {
44 gLog.Error.WriteLine("Could not find {0} in path {1}", version_file, path);
45 return;
46 }
47 StringBuilder builder = new StringBuilder();
48 using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
49 {
50 StreamReader sr = new StreamReader(fs);
51 while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); }
52 sr.Close();
53 }
54 txtVersion.Text = builder.ToString();
55 }
56 }
57 }

  ViewVC Help
Powered by ViewVC 1.1.22