Example #1
0
 public static void Shutdown(Form window, Writer db)
 {
     if (dbr == null && dbw == null)
     {
         Application.Exit();
         return;
     }
     else if (window == null && db == null)
         return;
     if ((window == dbw && dbr == null) || (window == dbr && dbw == null))
     {
         db.Close();
         Application.Exit();
         return;
     }
     if (window == dbr)
         dbr = null;
     else
         dbw = null;
 }
Example #2
0
 public static void Open(Writer db, bool writer, bool immediate = false)
 {
     if (writer)
     {
         if (dbw == null)
         {
             if (((DatabaseManager)db).databaseType == DatabaseManager.DBType.SQLITE && dbr != null)
             {
                 if (MessageBox.Show("Simultaneous reading and archiving is unsafe in sqlite mode. Close the reader to open the archiver?",
                                  "Conflict",
                                  MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     dbr.Close();
                     dbw = new ArchiverWindow(db);
                 }
                 else
                     return;
             }
             else
                 dbw = new ArchiverWindow(db);
         }
         dbw.Show();
         dbw.Focus();
     }
     else
     {
         if (dbr == null)
         {
             if (((DatabaseManager)db).databaseType == DatabaseManager.DBType.SQLITE && dbw != null)
             {
                 if (MessageBox.Show("Simultaneous reading and archiving is unsafe in sqlite mode. Close the archiver to open the reader?",
                                  "Conflict",
                                  MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     dbw.Close();
                     dbr = new Reader(db);
                 }
                 else
                     return;
             }
             else
                 dbr = new Reader(db);
         }
         dbr.Show();
         dbr.Focus();
     }
 }
Example #3
0
 public TricksterShit(Reader p,Parser.Resource[] shit)
 {
     parent = p;
     bytes[0] = new MemoryStream(shit[0].data);
     bytes[1] = new MemoryStream(shit[2].data);
     bg = Image.FromStream(bytes[0]);
     fg = Image.FromStream(bytes[1]);
     parent.BackgroundImage = bg;
     parent.mainPanel.BackgroundImage = fg;
     flashHeader = new WebBrowser();
     parent.Controls.Add(flashHeader);
     flashHeader.Width = 950;
     flashHeader.Height = 24;
     parent.InitFlashMovie(flashHeader,shit[1]);
     FixAlign();
 }