Exemple #1
0
 private void receiveMessage(object sender, MessageEvent e)
 {
     if (e.type.Contains("wpf"))
     {
         if (e.value.Contains("mainwindow"))
         {
             firstWindow.Hide();
             mainWindow.Show();
         }
         else if (e.value.Contains("firstwindow"))
         {
             mainWindow.Hide();
             firstWindow.updateLast(databaseManager.getLastProjects());
             firstWindow.Show();
         }
     }
     else if (e.type.Contains("exit"))
     {
         Application.Current.Shutdown();
     }
     else if (e.type.Contains("database_add"))
     {
         databaseManager.insertFile(e.value.ToString());
     }
     else if (e.type.Contains("open"))
     {
         Console.WriteLine(e.value.ToString());
         firstWindow.Hide();
         mainWindow.openFile(e.value.ToString());
         mainWindow.Show();
     }
 }
Exemple #2
0
        public App()
        {
            databaseManager = new DatabaseManager();

            firstWindow = new FirstWindow();
            firstWindow.message += receiveMessage;
            firstWindow.updateLast(databaseManager.checkProjects());

            mainWindow = new MainWindow();
            mainWindow.message += receiveMessage;

            App.Current.MainWindow = firstWindow;
            firstWindow.Show();
        }
Exemple #3
0
        public App()
        {
            databaseManager = new DatabaseManager();

            firstWindow          = new FirstWindow();
            firstWindow.message += receiveMessage;
            firstWindow.updateLast(databaseManager.checkProjects());

            mainWindow          = new MainWindow();
            mainWindow.message += receiveMessage;

            App.Current.MainWindow = firstWindow;
            firstWindow.Show();
        }