/[RomCheater]/trunk/RomCheater/Main.cs
ViewVC logotype

Contents of /trunk/RomCheater/Main.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (show annotations) (download)
Wed May 9 11:29:33 2012 UTC (9 years, 2 months ago) by william
File size: 1900 byte(s)
+ add settings upgrade subscriber support (needs to be called in a static constructor for types that are always used)

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 RomCheater.Logging;
10 using RomCheater.Properties;
11 using RomCheater.UserSettingsSupport;
12
13 namespace RomCheater
14 {
15 public partial class Main : Form
16 {
17 static Main()
18 {
19 SettingSubscriber.AddSubscriber(Settings.Default);
20 }
21 private const string t = "RomCheater";
22 #region LogWriterSupport
23 static LogWriter _LoggerInstance;
24 static LogWriter LoggerInstance
25 {
26 get { return _LoggerInstance; }
27 set { _LoggerInstance = value; }
28 }
29 #endregion
30
31
32 public Main()
33 {
34 InitializeComponent();
35
36
37 try
38 {
39 if (Settings.Default.UpgradeRequired)
40 {
41 Settings.Default.Upgrade();
42 Settings.Default.Reload();
43 Settings.Default.UpgradeRequired = false;
44 Settings.Default.Save();
45 }
46 }
47 catch
48 {
49 Settings.Default.Reset();
50 }
51 LoggerInstance = logwriter;
52 LoggerInstance.CreateNewLog(false);
53 }
54
55 private void mnuItemExit_Click(object sender, EventArgs e)
56 {
57 this.Close();
58 }
59
60 private void btnCopyLogToClipboard_Click(object sender, EventArgs e)
61 {
62
63 }
64
65 private void Main_Load(object sender, EventArgs e)
66 {
67 logger.Info.WriteLine("this is an info line");
68 logger.Debug.WriteLine("this is a debug line");
69 logger.Error.WriteLine("this is an error line");
70 }
71 }
72 }

  ViewVC Help
Powered by ViewVC 1.1.22