Example #1
0
        private void Init()
        {
            init  = true;
            debug = new DebugOutputWindow();
            TabPage tp = new TabPage();

            tp.Parent       = tabControl1;
            tp.Text         = debug.Text;
            debug.MdiParent = this;
            debug.Show();
            debug.TabPag            = tp;
            debug.WindowState       = FormWindowState.Maximized;
            tabControl1.SelectedTab = tp;

            Debug.SetBox(debug.rtb1);
            Debug.LogLn("Hello there! Im starting...");
            Application.DoEvents();
            bool exist = DBAccess.CheckIfDBExists();

            Debug.LogLn("Database file found : " + exist);
            if (!exist)
            {
                DialogResult result = MessageBox.Show("No database found, do you want to create a new one?", "Database", MessageBoxButtons.YesNo);
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    DBAccess.CreateDataBase();
                    Debug.LogLn("Database file created");
                }
                else
                {
                    this.Close();
                }
            }
            DBAccess.LoadSettings();
            bool needsScan = DBAccess.CheckIfScanIsNeeded();

            Debug.LogLn("Initial Scan needed : " + needsScan);
            if (needsScan)
            {
                DialogResult result = MessageBox.Show("Database is empty, do you want to start initial scan?", "Database", MessageBoxButtons.YesNo);
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    OpenFileDialog d = new OpenFileDialog();
                    d.Filter = "DragonAgeInquisition.exe|DragonAgeInquisition.exe";
                    if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        DBAccess.StartScan(Path.GetDirectoryName(d.FileName) + "\\");
                    }
                    Debug.LogLn("Initial Scan Done");
                }
                else
                {
                    this.Close();
                }
            }
            Debug.LogLn("I'm ready!");
        }
Example #2
0
 private void Init()
 {
     init = true;
     debug = new DebugOutputWindow();
     OpenMaxed(debug);
     Debug.SetBox(debug.rtb1);
     Debug.LogLn("Hello there! Im starting...");
     Application.DoEvents();
     bool exist = DBAccess.CheckIfDBExists();
     Debug.LogLn("Database file found : " + exist);
     if (!exist)
     {
         DialogResult result = MessageBox.Show("No database found, do you want to create a new one?", "Database", MessageBoxButtons.YesNo);
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             DBAccess.CreateDataBase();
             Debug.LogLn("Database file created");
         }
         else
             this.Close();
     }
     DBAccess.LoadSettings();
     bool needsScan = DBAccess.CheckIfScanIsNeeded();
     Debug.LogLn("Initial Scan needed : " + needsScan);
     if (needsScan)
     {
         DialogResult result = MessageBox.Show("Database is empty, do you want to start initial scan?", "Database", MessageBoxButtons.YesNo);
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             OpenFileDialog d = new OpenFileDialog();
             d.Filter = "DragonAgeInquisition.exe|DragonAgeInquisition.exe";
             if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 DBAccess.StartScan(Path.GetDirectoryName(d.FileName) + "\\");
             Debug.LogLn("Initial Scan Done");
         }
         else
             this.Close();
     }
     Debug.LogLn("I'm ready!");
 }