Esempio n. 1
0
        private void MainWindowKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.F2:
                CurrentUserNotifications.SendNotification(ESB2Login.Login());
                break;

            case Key.Escape:
                if (CurrentUserNotifications.CurrentUser != null)
                {
                    CurrentUserNotifications.SendNotification(ESB2Login.Logout(CurrentUserNotifications.CurrentUser));
                }

                if (ESB2db.GetDatabase().ChangeTracker.HasChanges())
                {
                    ESB2db.GetDatabase().SaveChanges();
                }

                break;
            }
        }
Esempio n. 2
0
 public MainWindow()
 {
     ESB2db.InitializeDatabase();
     InitializeComponent();
     CurrentUserNotifications.SendNotification(null);
 }