ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/FloatingAboutBox.cs
Revision: 152
Committed: Mon May 28 02:01:34 2012 UTC (11 years ago) by william
File size: 1408 byte(s)
Log Message:
+ add support to save dock layout

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using WeifenLuo.WinFormsUI.Docking;
10 using System.IO;
11 using RomCheater.Logging;
12
13 namespace RomCheater.Docking
14 {
15 public partial class FloatingAboutBox : Form
16 {
17 public FloatingAboutBox()
18 {
19 InitializeComponent();
20 }
21 private void FloatingAboutBox_Shown(object sender, EventArgs e)
22 {
23 string path = Application.StartupPath;
24 string version_file = "current-version.txt";
25 string full_path = string.Format(@"{0}\{1}", path, version_file);
26 FileInfo fi = new FileInfo(full_path);
27 if (!fi.Exists)
28 {
29 logger.Error.WriteLine("Could not find {0} in path {1}", version_file, path);
30 return;
31 }
32 StringBuilder builder = new StringBuilder();
33 using (FileStream fs = new FileStream(full_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
34 {
35 StreamReader sr = new StreamReader(fs);
36 while (!sr.EndOfStream) { builder.AppendLine(sr.ReadLine()); }
37 sr.Close();
38 }
39 txtVersion.Text = builder.ToString();
40 }
41 }
42 }