public MainForm() { InitializeComponent(); #if !DEBUG mnuAdmin.Visible = false; #endif OpenDB: //load settings _mysettings = new MySettings(); _mysettings = _mysettings.load(); string appPath = utils.helpers.getAppPath(); _licenseMail = new LicenseMail(); //subscribe to new license mails _licenseMail.StateChanged += on_new_licensemail; addLog("Please select Exchange-Connect to start test"); string dbFile = _mysettings.SQLiteDataBaseFilename; if (!dbFile.Contains('\\')) { //build full file name dbFile = utils.helpers.getAppPath() + dbFile; } _licenseDataBase = new LicenseDataBase(ref this.dataGridView1, dbFile); if (_licenseDataBase.bIsValidDB == false) { MessageBox.Show("Error accessing or creating database file: " + dbFile, "Fatal ERROR"); SettingsForm dlg = new SettingsForm(); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { goto OpenDB; //try again } else { MessageBox.Show("Cannot run without valid database path and file name", "Exchange License Mail Grabber"); exitApp(); } } else { _licenseDataBase.StateChanged += new StateChangedEventHandler(_licenseDataBase_StateChanged); loadData(); } readDGVlayout(); }
public outlookMain() { InitializeComponent(); //subscribe to new license mails _licenseMail.StateChanged += on_new_licensemail; _olk = new OutlookMail.OutlookMail(ref _licenseMail); string dbFile = _mysettings.SQLiteDataBaseFilename; if (!dbFile.Contains('\\')) { //build full file name dbFile = utils.helpers.getAppPath() + dbFile; } _licenseDataBase = new LicenseDataBase(ref this.dataGridView1, dbFile); _licenseDataBase.StateChanged += new StateChangedEventHandler(_licenseDataBase_StateChanged); if (_licenseDataBase.bIsValidDB == false) { MessageBox.Show("Error accessing or creating database file: " + dbFile, "Fatal ERROR"); Application.Exit(); } else loadData(); }