Beispiel #1
0
        protected override void OnExit(ExitEventArgs e)
        {
            if (_dbContext != null)
            {
                _dbContext.SaveChanges();
                _dbContext.Dispose();
                _dbContext = null;
            }

            base.OnExit(e);
        }
Beispiel #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            this.DispatcherUnhandledException += App_DispatcherUnhandledException;

            //System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("ru-RU");
            _dbContext = new DownworkContext();
#if DEBUG
            _dbContext.LogToConsole();
#endif
        }