1 |
using System; |
2 |
using libmsmoneyfile; |
3 |
using System.IO; |
4 |
using System.Windows.Forms; |
5 |
using Enterprise.Logging; |
6 |
|
7 |
namespace libmsmoney_unittest |
8 |
{ |
9 |
class Program |
10 |
{ |
11 |
const string msmoney_file1 = "/home/william/temp/msmoney/decrypt/My Money.mny.mdb"; |
12 |
const string msmoney_file2 = "/home/william/temp/msmoney/My Money.mny"; |
13 |
const string msmoney_file3 = "/home/william/temp/msmoney/My Money Backup 0.mbf"; |
14 |
|
15 |
const string msmoney_file = msmoney_file1; |
16 |
|
17 |
static void Log_OnFlush(object sender, LoggerOnFlushEventArgs e) { OnLogFlush(e.Buffer); } |
18 |
static void OnLogFlush(string logmessage) |
19 |
{ |
20 |
//if (this.IsDisposed) { return; } |
21 |
////UpdateStatus(logmessage); |
22 |
////UpdateLogOutput(logmessage); |
23 |
//Application.DoEvents(); |
24 |
} |
25 |
static void create_log() |
26 |
{ |
27 |
string log_path = Application.StartupPath; |
28 |
string log_filename = string.Format("{0}.log", typeof(Program).Assembly.GetName().Name); |
29 |
FileInfo log_file = new FileInfo(string.Format(@"{0}\{1}", log_path, log_filename)); |
30 |
gLog.CreateLog(log_file.FullName, false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush)); |
31 |
} |
32 |
public static void Main (string[] args) |
33 |
{ |
34 |
create_log (); |
35 |
var data = MSMoneyFile.ParseMSMoneyFile (msmoney_file); |
36 |
} |
37 |
} |
38 |
} |